@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #080C12;
  --surface:   #0D1420;
  --surface2:  #111B2B;
  --border:    #1C2A3E;
  --accent:    #00D4FF;
  --accent-dim:#00AACC;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --text:      #DCE8F5;
  --text-muted:#5A7494;
  --text-dim:  #3A5470;
  --green:     #00E887;
  --red:       #FF3B6B;
  --yellow:    #FFB800;
  --radius:    10px;
  --radius-sm: 6px;
  --transition: 0.18s ease;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Layout ───────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}

/* ── Nav ──────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.nav-logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  color: var(--bg);
}

.nav-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--text);
}

.nav-title span {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  letter-spacing: 0.02em;
}

.nav-link:hover { color: var(--accent); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: #18DFFF;
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover {
  background: var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: rgba(255,255,255,0.04);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(255, 59, 107, 0.3);
}
.btn-danger:hover {
  background: rgba(255, 59, 107, 0.1);
  border-color: var(--red);
}

.btn-sm { padding: 0.35rem 0.9rem; font-size: 13px; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 15px; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(0, 212, 255, 0.25);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ── Forms ────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.form-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.form-input,
.form-textarea,
.form-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  padding: 0.6rem 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

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

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-active {
  background: rgba(0, 232, 135, 0.1);
  color: var(--green);
  border: 1px solid rgba(0, 232, 135, 0.2);
}
.badge-active::before { background: var(--green); }

.badge-inactive {
  background: rgba(90, 116, 148, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(90, 116, 148, 0.2);
}
.badge-inactive::before { background: var(--text-muted); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2.8rem;
  color: var(--text);
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Back link ────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  transition: color var(--transition);
  cursor: pointer;
  background: none;
  border: none;
}
.back-link:hover { color: var(--accent); }
.back-link svg { transition: transform var(--transition); }
.back-link:hover svg { transform: translateX(-2px); }

/* ── Stat mini ────────────────────────────────────────────── */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.stat-chip strong {
  color: var(--accent);
  font-size: 14px;
}

/* ── Toast ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9999;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease forwards;
  max-width: 320px;
}

.toast-success { border-left: 3px solid var(--green); color: var(--green); }
.toast-error   { border-left: 3px solid var(--red);   color: var(--red); }
.toast-info    { border-left: 3px solid var(--accent); color: var(--accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 212, 255, 0.03) 0%, transparent 50%);
  padding: 2rem;
}

.login-box {
  width: 100%;
  max-width: 420px;
}

.login-brand {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: var(--bg);
  margin: 0 auto 1rem;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.25);
}

.login-brand h1 {
  font-size: 2.2rem;
  letter-spacing: 0.12em;
  color: var(--text);
}

.login-brand h1 span { color: var(--accent); }

.login-brand p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
}

.login-card .form-group { margin-bottom: 1rem; }
.login-card .btn-primary { width: 100%; margin-top: 0.5rem; height: 46px; font-size: 15px; }

#login-error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin-top: 0.75rem;
  display: none;
}

/* ── Dashboard Grid ───────────────────────────────────────── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.client-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

.client-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-glow), rgba(0, 212, 255, 0.05));
  border: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.client-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1.2;
}

.client-industry {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.client-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.conv-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
}

.conv-count strong {
  color: var(--text);
  font-size: 15px;
}

/* ── Client Detail ────────────────────────────────────────── */
.client-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.client-detail-title {
  font-size: 3rem;
}

.client-detail-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 4px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-muted);
}

.meta-item svg { color: var(--text-dim); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .client-detail-header { flex-direction: column; }
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Toggle ───────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toggle-label {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 13px;
  transition: background var(--transition);
}

.toggle input:checked + .toggle-track { background: var(--green); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle input:checked ~ .toggle-thumb { transform: translateX(22px); }

.toggle-status {
  font-size: 13px;
  font-weight: 600;
  min-width: 52px;
}

/* ── Conversation Log ─────────────────────────────────────── */
.conv-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.conv-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.conv-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
}

.conv-item-header:hover { background: rgba(255,255,255,0.02); }

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

.conv-msg-count {
  font-size: 12px;
  color: var(--text-muted);
}

.conv-messages {
  display: none;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  flex-direction: column;
  gap: 0.5rem;
}

.conv-messages.open { display: flex; }

.msg-row {
  display: flex;
  gap: 0.5rem;
  font-size: 13px;
  line-height: 1.5;
}

.msg-role {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 1px;
}

.msg-role-user {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.msg-role-assistant {
  background: rgba(0, 232, 135, 0.08);
  color: var(--green);
  border: 1px solid rgba(0, 232, 135, 0.15);
}

.msg-content { color: var(--text); flex: 1; }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

.empty-state p { font-size: 14px; }

/* ── Chat Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.chat-window {
  width: 380px;
  height: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 212, 255, 0.1);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .chat-window {
  transform: translateY(0);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.chat-header-info { display: flex; align-items: center; gap: 10px; }

.chat-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-glow);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.chat-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.chat-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.chat-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
  font-size: 18px;
  line-height: 1;
}
.chat-close:hover { color: var(--text); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 85%;
  animation: msgAppear 0.15s ease forwards;
}

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

.chat-msg-user { align-self: flex-end; align-items: flex-end; }
.chat-msg-assistant { align-self: flex-start; align-items: flex-start; }

.chat-bubble {
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
}

.chat-msg-user .chat-bubble {
  background: var(--accent);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}

.chat-msg-assistant .chat-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-time {
  font-size: 10px;
  color: var(--text-dim);
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

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

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

.chat-input-area {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  background: var(--surface2);
}

.chat-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 13.5px;
  padding: 0.55rem 0.85rem;
  outline: none;
  transition: border-color var(--transition);
}

.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-dim); }

.chat-send {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
}
.chat-send:hover { background: #18DFFF; box-shadow: 0 0 12px rgba(0, 212, 255, 0.35); }
.chat-send:disabled { opacity: 0.45; pointer-events: none; }

/* ── New Client Form ──────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 700px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .chat-window { width: 100%; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .chat-window { border-radius: 16px 16px 0 0; height: 75vh; }
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── Markdown rendering ───────────────────────────────────── */
/* Applied via .md class on assistant chat bubbles and conv-log entries */

.md p { margin: 0 0 0.55em; }
.md p:last-child { margin-bottom: 0; }

.md strong, .md b { font-weight: 700; }
.md em, .md i     { font-style: italic; }

.md ul, .md ol {
  margin: 0.4em 0 0.55em 1.3em;
  padding: 0;
}
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li { margin-bottom: 0.2em; line-height: 1.55; }
.md li:last-child { margin-bottom: 0; }
.md ul ul, .md ol ul { list-style: circle; }
.md ul ol, .md ol ol { list-style: lower-alpha; }

.md h1, .md h2, .md h3, .md h4 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
  margin: 0.6em 0 0.3em;
  line-height: 1.15;
}
.md h1 { font-size: 1.25em; }
.md h2 { font-size: 1.1em; }
.md h3, .md h4 { font-size: 1em; }

.md code {
  font-family: 'Courier New', monospace;
  font-size: 0.88em;
  background: rgba(0, 212, 255, 0.07);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--accent);
}

.md pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75em 1em;
  overflow-x: auto;
  margin: 0.5em 0;
}
.md pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 0.85em;
}

.md blockquote {
  border-left: 3px solid var(--accent);
  margin: 0.5em 0;
  padding: 0.2em 0 0.2em 0.85em;
  color: var(--text-muted);
  font-style: italic;
}

.md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.6em 0;
}

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

.chat-bubble.md { line-height: 1.55; }
.chat-bubble.md > *:first-child { margin-top: 0; }
.chat-bubble.md > *:last-child  { margin-bottom: 0; }

.msg-content.md { line-height: 1.55; }
.msg-content.md > *:first-child { margin-top: 0; }
.msg-content.md > *:last-child  { margin-bottom: 0; }

/* ── Loading spinner ──────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 212, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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