/* ─── Design tokens — DARK (default) ────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:         #050816;
  --bg-alt:     #030712;
  --bg-sidebar: #020610;

  /* Surfaces */
  --surface-1: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.065);
  --surface-3: rgba(255, 255, 255, 0.095);

  /* Borders */
  --border:   rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.13);

  /* Text */
  --text:    rgba(255, 255, 255, 0.93);
  --muted:   rgba(255, 255, 255, 0.60);
  --muted-2: rgba(255, 255, 255, 0.37);

  /* Brand */
  --primary:        #6ea8fe;
  --primary-2:      #2f81f7;
  --primary-bg:     rgba(110, 168, 254, 0.09);
  --primary-border: rgba(110, 168, 254, 0.26);
  --primary-glow:   rgba(47, 129, 247, 0.35);

  /* States */
  --danger:  #f85149;
  --success: #3ddc97;

  /* Radii */
  --r-xs:   6px;
  --r-sm:   10px;
  --r:      14px;
  --r-lg:   18px;
  --r-xl:   22px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px  rgba(0, 0, 0, 0.35);
  --shadow:    0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 72px rgba(0, 0, 0, 0.60);
  --glow:      0 0 0 3px rgba(110, 168, 254, 0.14);

  /* Typography */
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Motion */
  --ease:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* ─── Design tokens — LIGHT ─────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:         #f5f7ff;
  --bg-alt:     #eef1fb;
  --bg-sidebar: #e8ecf7;

  --surface-1: rgba(0, 0, 0, 0.04);
  --surface-2: rgba(0, 0, 0, 0.07);
  --surface-3: rgba(0, 0, 0, 0.10);

  --border:   rgba(0, 0, 0, 0.09);
  --border-2: rgba(0, 0, 0, 0.14);

  --text:    rgba(0, 0, 0, 0.88);
  --muted:   rgba(0, 0, 0, 0.54);
  --muted-2: rgba(0, 0, 0, 0.35);

  --primary:        #2f81f7;
  --primary-2:      #1a6fdb;
  --primary-bg:     rgba(47, 129, 247, 0.08);
  --primary-border: rgba(47, 129, 247, 0.25);
  --primary-glow:   rgba(47, 129, 247, 0.18);

  --danger:  #d93025;
  --success: #1e8a4c;

  --shadow-sm: 0 2px 8px  rgba(0, 0, 0, 0.08);
  --shadow:    0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 24px 72px rgba(0, 0, 0, 0.18);
  --glow:      0 0 0 3px rgba(47, 129, 247, 0.14);
}

/* ─── Theme transition — smooth crossfade on toggle ─────────────────────────── */
*, *::before, *::after {
  transition:
    background-color 0.22s ease,
    border-color     0.22s ease,
    color            0.22s ease,
    box-shadow       0.22s ease;
}

/* Exclude elements where transitions would look wrong */
.typing-dots span,
.dot,
[class*="btn"]:active,
.citation-ref:hover,
.pill:hover {
  transition: none;
}

/* ─── Theme toggle button ────────────────────────────────────────────────────── */
#themeBtn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  font-size: 16px;
  flex-shrink: 0;
}

/* Light-mode overrides for glass panels */
[data-theme="light"] .topbar,
[data-theme="light"] .chat-header {
  background: rgba(238, 241, 251, 0.88);
}

[data-theme="light"] .composer {
  background: rgba(238, 241, 251, 0.85);
}

[data-theme="light"] .modal {
  background: rgba(245, 247, 255, 0.97);
}

[data-theme="light"] .auth-overlay {
  background: var(--bg-alt);
  background-image:
    radial-gradient(ellipse 90% 55% at 15% 25%, rgba(47, 129, 247, 0.07) 0%, transparent 65%),
    radial-gradient(ellipse 70% 45% at 85% 75%, rgba(110, 168, 254, 0.05) 0%, transparent 65%);
}

[data-theme="light"] .auth-card {
  background: rgba(245, 247, 255, 0.96);
}

[data-theme="light"] .code {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.80);
}

[data-theme="light"] .msg.user .bubble {
  background: linear-gradient(160deg, rgba(47, 129, 247, 0.12), rgba(47, 129, 247, 0.06));
  border-color: rgba(47, 129, 247, 0.18);
}

[data-theme="light"] .dot.ok {
  animation: pulse-ring-light 2.4s ease-out infinite;
}

@keyframes pulse-ring-light {
  0%   { box-shadow: 0 0 0 0   rgba(30, 138, 76, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(30, 138, 76, 0); }
  100% { box-shadow: 0 0 0 0   rgba(30, 138, 76, 0); }
}

[data-theme="light"] .sessions-list::-webkit-scrollbar-thumb,
[data-theme="light"] .messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .empty-icon {
  background: linear-gradient(135deg, rgba(47, 129, 247, 0.12), rgba(47, 129, 247, 0.06));
}

[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #3d8ffe, #2472e8);
  border-color: rgba(47, 129, 247, 0.5);
  box-shadow: 0 2px 14px rgba(47, 129, 247, 0.22);
}

/* ─── Keyframes ─────────────────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* Typing dots: each dot bounces in sequence */
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.3; }
  30%            { transform: translateY(-6px); opacity: 1; }
}

/* Status dot pulse when connected */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0   rgba(61, 220, 151, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0   rgba(61, 220, 151, 0); }
}

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

/* Subtle shimmer for loading skeletons */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}

/* Send button ripple */
@keyframes send-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* ─── Reset + base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code { font-family: var(--mono); }

/* ─── App shell ────────────────────────────────────────────────────────────── */
.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  overflow: hidden;
}

/* ─── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 6, 18, 0.88);
  backdrop-filter: blur(20px) saturate(1.5);
  position: relative;
  z-index: 20;
  flex-shrink: 0;
}

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

.logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6ea8fe, #2f81f7);
  box-shadow: 0 4px 18px rgba(47, 129, 247, 0.4);
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.subtitle {
  font-size: 11px;
  color: var(--muted-1);
  margin-top: 1px;
}

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

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
}

.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  border-color: rgba(110, 168, 254, 0.38);
  background: linear-gradient(135deg, rgba(110, 168, 254, 0.92), rgba(47, 129, 247, 0.88));
  color: #fff;
  box-shadow: 0 2px 14px rgba(47, 129, 247, 0.28);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 24px rgba(47, 129, 247, 0.45);
  filter: brightness(1.1);
}

.btn-primary:active:not(:disabled) {
  animation: send-pop 0.2s var(--ease);
}

.btn-secondary { background: var(--surface-1); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

/* Spinner inside button */
.btn-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn-loading::after {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.card {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ─── Chat header ───────────────────────────────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 6, 18, 0.55);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.chat-status {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  transition: background 0.4s;
}

.dot.ok {
  background: var(--success);
  animation: pulse-ring 2.4s ease-out infinite;
}

.chat-actions { display: flex; gap: 8px; }

/* ─── Caveat banner ─────────────────────────────────────────────────────────── */
.chat-caveat {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5px 18px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  cursor: default;
  user-select: none;
}

[data-theme="light"] .chat-caveat {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: #2f3238;
}

.caveat-text {
  max-width: 900px;
}

/* ─── Small button variant ──────────────────────────────────────────────────── */
.btn-sm {
  padding: 4px 12px;
  font-size: 11.5px;
  border-radius: var(--r-xs);
}

/* ─── Chat layout ───────────────────────────────────────────────────────────── */
.chat-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.chat-sidebar {
  width: 232px;
  border-right: 1px solid var(--border);
  padding: 14px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-sidebar);
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 6px;
}

.sidebar-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted-2);
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  padding: 1px 2px 1px 1px;
}

/* Slim scrollbar */
.sessions-list::-webkit-scrollbar { width: 3px; }
.sessions-list::-webkit-scrollbar-track { background: transparent; }
.sessions-list::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 2px;
}

.session-row {
  display: flex;
  align-items: center;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  padding: 2px 4px 2px 8px;
  transition: background 0.15s, border-color 0.15s;
  animation: fade-in 0.25s var(--ease);
}

.session-row:hover {
  background: var(--surface-1);
  border-color: var(--border);
}

.session-row.active {
  background: var(--primary-bg);
  border-color: var(--primary-border);
}

.chat-pill {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
  font-family: var(--font);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: left;
  padding: 6px 0;
  transition: color 0.15s;
}

.session-row:hover   .chat-pill { color: var(--text); }
.session-row.active  .chat-pill { color: var(--primary); font-weight: 500; }

.del-btn {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 11px;
  padding: 4px 5px;
  border-radius: var(--r-xs);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.session-row:hover .del-btn { opacity: 1; }
.del-btn:hover { color: var(--danger); background: rgba(248, 81, 73, 0.10); }

/* ─── Messages pane ─────────────────────────────────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.messages {
  padding: 28px 36px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
  scroll-behavior: smooth;
}

.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

/* ─── Message bubbles ───────────────────────────────────────────────────────── */
.msg {
  display: grid;
  gap: 6px;
  max-width: 840px;
  animation: fade-up 0.32s var(--ease);
}

.msg.user      { align-self: flex-end; }
.msg.assistant { align-self: flex-start; width: 100%; max-width: 840px; }

.meta {
  font-size: 11.5px;
  color: var(--muted-2);
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 6px;
}

.msg.user .meta { justify-content: flex-end; }

/* Small avatar in meta row */
.meta-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6ea8fe, #2f81f7);
  color: #fff;
}

.bubble {
  border-radius: var(--r-lg);
  padding: 20px 24px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  line-height: 1.75;
  word-wrap: break-word;
  font-size: 15px;
  letter-spacing: 0.005em;
  color: var(--text);
}

.msg.user .bubble {
  background: linear-gradient(160deg, rgba(110, 168, 254, 0.16), rgba(47, 129, 247, 0.09));
  border-color: rgba(110, 168, 254, 0.20);
  border-bottom-right-radius: var(--r-xs);
}

.msg.assistant .bubble {
  border-bottom-left-radius: var(--r-xs);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ─── Typing dots ───────────────────────────────────────────────────────────── */
.typing-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 0;
  min-height: 24px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  display: block;
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }

/* Label next to dots */
.thinking-label {
  font-size: 12px;
  color: var(--muted-2);
  margin-left: 4px;
}

/* ─── Composer ──────────────────────────────────────────────────────────────── */
.composer {
  padding: 14px 24px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  border-top: 1px solid var(--border);
  background: rgba(3, 6, 18, 0.75);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.input {
  width: 100%;
  resize: none;
  padding: 12px 15px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  min-height: 48px;
  max-height: 130px;
  line-height: 1.55;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input:focus {
  border-color: rgba(110, 168, 254, 0.48);
  box-shadow: var(--glow);
  background: var(--surface-2);
}

.input::placeholder { color: var(--muted-2); }

#sendBtn {
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r);
  font-size: 14px;
}

/* ─── Followup pills ────────────────────────────────────────────────────────── */
.followups {
  display: grid;
  gap: 8px;
  padding-top: 6px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--muted);
  border-radius: var(--r-full);
  padding: 6px 13px;
  font-size: 12.5px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.pill:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 129, 247, 0.15);
}

/* ─── Suggestion cards ─────────────────────────────────────────────────────── */
.suggestions-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 4px;
  animation: fade-up 0.35s var(--ease, ease);
}

.suggestions-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.suggestions-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 700px) {
  .suggestions-row {
    grid-template-columns: 1fr;
  }
}

.suggestion-card {
  display: flex;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md, 10px);
  background: var(--surface-1);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  transition: all 0.2s var(--ease, ease);
  min-height: 56px;
}

.suggestion-card:hover {
  border-color: var(--primary-border);
  background: var(--primary-bg);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(47, 129, 247, 0.12);
}

.suggestion-card:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Center the industry suggestions on the empty state */
.empty-state + .suggestions-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}

.suggestions-contextual {
  margin-top: 8px;
}

/* ─── Sources / citation badges ─────────────────────────────────────────────── */
.sources-list {
  display: grid;
  gap: 4px;
  padding-top: 4px;
}

.sources-list-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--muted-2);
  padding: 0 4px;
  margin-bottom: 2px;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 5px 8px;
  border-radius: var(--r-xs);
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.source-item:hover {
  background: var(--surface-1);
  border-color: var(--border);
}

.source-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.source-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 11px;
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  border: 1px solid var(--primary-border);
  background: var(--primary-bg);
  transition: background 0.15s, box-shadow 0.15s;
}

.source-link:hover {
  background: rgba(110, 168, 254, 0.18);
  box-shadow: 0 2px 8px rgba(47, 129, 247, 0.2);
  text-decoration: none;
}

.citation-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 3px;
  line-height: 1;
  font-family: var(--font);
}

.citation-ref:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(47, 129, 247, 0.3);
}

.citation-ref--plain {
  cursor: default;
  color: var(--muted-2);
  background: var(--surface-1);
  border-color: var(--border);
}

.citation-ref--plain:hover { transform: none; }

.bubble sup,
.bubble sup.cite-inline {
  line-height: 1;
  vertical-align: middle;
  display: inline;
  white-space: nowrap;
}

/* ─── Footer / debug ────────────────────────────────────────────────────────── */
.footer-row {
  padding: 8px 16px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.debug summary, .advanced summary {
  color: var(--muted-2);
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  padding: 4px 0;
}

.debug-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.code {
  margin: 6px 0 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  overflow: auto;
  max-height: 200px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
}

/* ─── User pill (topbar) ────────────────────────────────────────────────────── */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border-radius: var(--r-full);
  background: var(--surface-1);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ea8fe, #2f81f7);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(47, 129, 247, 0.3);
}

.user-name {
  font-size: 12.5px;
  color: var(--text);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Settings modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fade-in 0.18s ease;
}

.modal-overlay.hidden { display: none; }

.modal {
  width: min(680px, 100%);
  border-radius: var(--r-xl);
  border: 1px solid var(--border-2);
  background: rgba(5, 9, 26, 0.97);
  backdrop-filter: blur(30px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slide-up 0.28s var(--ease);
}

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

.modal-footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.modal-title   { font-size: 15px; font-weight: 700; }
.modal-subtitle { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.modal-body    { padding: 20px; display: grid; gap: 16px; }

/* ─── Form elements ─────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }

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

.help {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.5;
}

.text {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.text:focus {
  border-color: rgba(110, 168, 254, 0.48);
  box-shadow: var(--glow);
  background: var(--surface-2);
}

.text::placeholder { color: var(--muted-2); }

.text.area {
  resize: vertical;
  min-height: 80px;
  font-family: var(--mono);
  font-size: 12px;
}

.advanced { margin-top: 4px; }
.advanced summary { font-size: 12px; color: var(--muted-2); cursor: pointer; padding: 4px 0; }
.advanced-grid    { margin-top: 12px; display: grid; gap: 10px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }

/* ─── Auth overlay ──────────────────────────────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 200;
  background: var(--bg-alt);
  background-image:
    radial-gradient(ellipse 90% 55% at 15% 25%, rgba(47, 129, 247, 0.08) 0%, transparent 65%),
    radial-gradient(ellipse 70% 45% at 85% 75%, rgba(110, 168, 254, 0.06) 0%, transparent 65%);
}

.auth-overlay.hidden { display: none; }

.auth-card {
  width: min(400px, 100%);
  background: rgba(5, 9, 26, 0.92);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(110, 168, 254, 0.04);
  backdrop-filter: blur(28px);
  animation: slide-up 0.38s var(--ease);
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(135deg, #6ea8fe, #2f81f7);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 28px rgba(47, 129, 247, 0.45);
}

.auth-brand {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-top: -4px;
}

.auth-tagline {
  font-size: 13px;
  color: var(--muted);
  margin-top: -12px;
}

.auth-tabs {
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.18s var(--ease);
}

.auth-tab.active {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.auth-tab:hover:not(.active) {
  background: var(--surface-1);
  color: var(--text);
}

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

.auth-form.hidden { display: none; }

.auth-submit {
  width: 100%;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  border-radius: var(--r-sm);
  justify-content: center;
}

/* Session-expired / auth notice banner */
.auth-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: var(--r-sm);
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.30);
  color: #f59e0b;
  font-size: 13px;
  line-height: 1.45;
  animation: fade-up 0.22s var(--ease);
}

.auth-notice::before { content: "⚠"; font-size: 15px; flex-shrink: 0; }

.auth-notice.hidden { display: none; }

[data-theme="light"] .auth-notice {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(180, 120, 0, 0.25);
  color: #92400e;
}

.auth-error {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(248, 81, 73, 0.09);
  border: 1px solid rgba(248, 81, 73, 0.24);
  color: #ff9b97;
  font-size: 12.5px;
  line-height: 1.5;
  animation: fade-up 0.22s var(--ease);
}

.auth-error.hidden { display: none; }

/* ─── Empty state (example prompts) ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px 24px;
  text-align: center;
  animation: fade-up 0.4s var(--ease);
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(110, 168, 254, 0.18), rgba(47, 129, 247, 0.10));
  border: 1px solid var(--primary-border);
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 8px;
}

.empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.empty-sub {
  font-size: 13px;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.5;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 840px) {
  .debug-grid { grid-template-columns: 1fr; }
  .messages   { padding: 18px 22px; }
  .chat-sidebar { width: 200px; }
}

@media (max-width: 620px) {
  .chat-sidebar { display: none; }
  .messages { padding: 14px 16px; }
  .user-name { display: none; }
  .auth-card { padding: 28px 22px; }
  .composer  { padding: 12px 14px 16px; }
}

/* ─── Citation badge — button variant ──────────────────────────────────────── */
.citation-ref--btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-family: var(--font);
  cursor: pointer;
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  vertical-align: middle;
  margin-left: 3px;
  text-decoration: none;
}

.citation-ref--btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 1px 4px rgba(47, 129, 247, 0.3);
}

.citation-ref--btn:active { transform: scale(0.96); }

/* ─── Source Viewer Modal ───────────────────────────────────────────────────── */
.src-viewer-overlay { align-items: center; }

.src-viewer-modal {
  display: flex;
  flex-direction: column;
  width: min(680px, 96vw);
  height: 82vh;          /* fixed height so the body always has room to scroll */
  max-height: 82vh;
  padding: 0;
  overflow: hidden;
}

.src-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.src-viewer-header-info { min-width: 0; flex: 1; }

.src-viewer-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
  line-height: 1.35;
}

.src-viewer-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.src-viewer-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.src-viewer-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 16px 18px;
  display: block;
}

.src-viewer-body::-webkit-scrollbar { width: 5px; }
.src-viewer-body::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

/* Chunk cards use inline styles — see _makeChunkCard in app.js */

/* ─── Source viewer states ──────────────────────────────────────────────────── */
.src-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.src-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

.src-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}

.src-empty-icon { font-size: 36px; margin-bottom: 12px; }

.src-empty a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.src-note {
  font-size: 12px;
  color: var(--muted-2);
  text-align: center;
  padding: 4px 0 8px;
  margin: 0;
}

/* ─── Auth: forgot/reset password panels ────────────────────────────────────── */
.auth-footer-link {
  text-align: center;
  margin-top: 10px;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}

.link-btn:hover { opacity: 0.75; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
  transition: color 0.15s;
}

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

.auth-panel-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 16px;
}

/* ─── Role badges ───────────────────────────────────────────────────────────── */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.role-badge--admin {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.35);
  color: #f59e0b;
}

.role-badge--user {
  background: var(--primary-bg);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* ─── Admin panel modal ─────────────────────────────────────────────────────── */
.modal-wide { width: min(860px, 100%); }

.admin-stats {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.stat-chip {
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.stat-chip--admin {
  background: rgba(251, 191, 36, 0.09);
  border-color: rgba(251, 191, 36, 0.28);
  color: #f59e0b;
}

.admin-table-wrap {
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
}

.admin-table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.admin-table-wrap::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 2px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-2);
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.admin-table tbody tr:hover { background: var(--surface-1); }
.admin-table tbody tr.admin-row-self { background: var(--primary-bg); }

.admin-table td {
  padding: 10px 16px;
  vertical-align: middle;
  color: var(--text);
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6ea8fe, #2f81f7);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.admin-name { font-weight: 500; }
.self-tag   { font-style: normal; color: var(--muted-2); font-weight: 400; font-size: 11px; }
.admin-email  { color: var(--muted); font-size: 12.5px; }
.admin-joined { color: var(--muted-2); font-size: 12px; white-space: nowrap; }

.role-select {
  padding: 4px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.role-select:focus  { border-color: var(--primary-border); }
.role-select:disabled { opacity: 0.4; cursor: not-allowed; }

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

.btn-tbl {
  padding: 4px 10px;
  border-radius: var(--r-xs);
  font-size: 11.5px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-tbl:hover { background: var(--surface-3); color: var(--text); }

.btn-tbl--reset:hover {
  border-color: var(--primary-border);
  background: var(--primary-bg);
  color: var(--primary);
}

.btn-tbl--del:hover {
  border-color: rgba(248, 81, 73, 0.3);
  background: rgba(248, 81, 73, 0.08);
  color: var(--danger);
}

.admin-empty {
  text-align: center;
  padding: 32px;
  color: var(--muted-2);
  font-size: 13px;
}

.admin-empty--error { color: var(--danger); }

.admin-feedback {
  font-size: 13px;
  min-height: 20px;
  transition: color 0.2s;
}

.admin-feedback--ok    { color: var(--success); }
.admin-feedback--error { color: var(--danger); }

/* ─── My Account modal ──────────────────────────────────────────────────────── */
.acct-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.acct-row:last-child { border-bottom: none; margin-bottom: 6px; }

.acct-label {
  min-width: 60px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.account-info {
  padding: 4px 0 12px;
}

.field-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* Success banner (same shape as error) */
.auth-success {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(61, 220, 151, 0.09);
  border: 1px solid rgba(61, 220, 151, 0.25);
  color: var(--success);
  font-size: 12.5px;
  line-height: 1.5;
  animation: fade-up 0.22s var(--ease);
}

.auth-success.hidden { display: none; }

/* ─── Admin: Global SurfSense Settings section ─────────────────────────────── */
.admin-global-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-1) 0%, transparent 100%);
}

.admin-global-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-global-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(110, 168, 254, 0.18), rgba(47, 129, 247, 0.10));
  border: 1px solid var(--primary-border);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}

.admin-global-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-global-desc {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
}

.admin-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-url-row .text { flex: 1; }

.admin-url-row .btn { flex-shrink: 0; }

/* ─── Admin: SurfSense status badges in table ──────────────────────────────── */
.ss-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
  font-family: var(--font);
  background: none;
}

.ss-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ss-badge--ok {
  background: rgba(61, 220, 151, 0.10);
  border-color: rgba(61, 220, 151, 0.28);
  color: var(--success);
}

.ss-badge--ok:hover {
  background: rgba(61, 220, 151, 0.18);
}

.ss-badge--warn {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.28);
  color: #f59e0b;
}

.ss-badge--warn:hover {
  background: rgba(251, 191, 36, 0.18);
}

.ss-badge--none {
  background: rgba(248, 81, 73, 0.08);
  border-color: rgba(248, 81, 73, 0.22);
  color: var(--danger);
}

.ss-badge--none:hover {
  background: rgba(248, 81, 73, 0.15);
}

.ss-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ss-badge--ok .ss-badge-dot   { background: var(--success); }
.ss-badge--warn .ss-badge-dot { background: #f59e0b; }
.ss-badge--none .ss-badge-dot { background: var(--danger); }

/* Sub-modals (SurfSense config, reset password) stack above the admin panel */
#ssConfigOverlay,
#resetPwOverlay {
  z-index: 110;
}

/* ─── SurfSense config modal field sections ────────────────────────────────── */
.ss-config-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  padding: 6px 0 2px;
}

.ss-config-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-1);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 4px;
}

.ss-config-info-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* ─── Utility ────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Modern markdown typography ─────────────────────────────────────────────── */

/* Paragraphs */
.bubble .mk-p {
  margin: 0 0 12px 0;
}
.bubble .mk-p:last-child {
  margin-bottom: 0;
}

/* Headings */
.bubble .mk-h {
  margin: 20px 0 8px 0;
  font-weight: 700;
  font-size: 1.05em;
}
.bubble .mk-h:first-child {
  margin-top: 0;
}

/* Ordered lists */
.bubble .mk-ol {
  margin: 8px 0 12px 0;
  padding-left: 24px;
  list-style: decimal;
  list-style-position: outside;
}
.bubble .mk-ol > li {
  margin: 8px 0;
  padding-left: 8px;
}

/* Unordered lists */
.bubble .mk-ul {
  margin: 4px 0 10px 0;
  padding-left: 24px;
  list-style: disc;
  list-style-position: outside;
}
.bubble .mk-ul > li {
  margin: 2px 0;
  padding-left: 8px;
}

/* Nested bullets inside numbered items */
.bubble .mk-ul.mk-nested {
  margin: 4px 0 2px 0;
}

/* Inline code */
.mk-code {
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.87em;
}

/* Bold & italic */
strong {
  font-weight: 700;
  color: var(--text);
}
em {
  font-style: italic;
  color: var(--text);
}

/* Citation badges sit neatly inline */
.bubble sup.cite-inline {
  margin-left: 1px;
}
.bubble sup.cite-inline .citation-ref--btn {
  margin: 0 1px;
}

/* Fallback legacy classes */
.sources, .followups { padding-left: 0; display: grid; gap: 6px; }
