:root {
  --bg-primary:    #07090f;
  --bg-secondary:  #0e1117;
  --bg-card:       rgba(255, 255, 255, 0.04);
  --bg-input:      rgba(255, 255, 255, 0.06);
  --border:        rgba(255, 255, 255, 0.08);
  --border-hover:  rgba(255, 255, 255, 0.15);

  --gold:          #d4af37;
  --gold-dim:      rgba(212, 175, 55, 0.15);
  --green:         #1a9a6c;
  --green-dim:     rgba(26, 154, 108, 0.15);
  --red-dim:       rgba(220, 70, 70, 0.12);

  --text-primary:  #f0f0f0;
  --text-muted:    #8892a4;
  --text-faint:    #4a5568;

  --sidebar-w:     280px;
  --radius-lg:     16px;
  --radius-md:     10px;
  --radius-sm:     6px;

  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --glow-gold:     0 0 20px rgba(212,175,55,0.2);
  --glow-gold-lg:  0 0 40px rgba(212,175,55,0.3);
}

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

body {
  font-family: 'Inter', 'Noto Naskh Arabic', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  position: relative;
}

/* Subtle dot-grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.sidebar, .main { position: relative; z-index: 1; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 16px;
  overflow: hidden;
  transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease;
}

.sidebar.collapsed { width: 0; min-width: 0; padding: 0; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
}

.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), #b8960c);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--glow-gold);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.logo-icon:hover {
  transform: rotate(-8deg) scale(1.1);
  box-shadow: var(--glow-gold-lg);
}

.logo-text { font-size: 14px; font-weight: 700; line-height: 1.2; }
.logo-text span { display: block; color: var(--text-muted); font-weight: 400; font-size: 11px; }

.new-chat-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--gold-dim);
  border: 1px solid rgba(212,175,55,0.3);
  color: var(--gold);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.new-chat-btn:hover {
  background: rgba(212,175,55,0.25);
  box-shadow: 0 0 12px rgba(212,175,55,0.2);
  transform: translateY(-1px);
}
.new-chat-btn:active { transform: translateY(0); }

.sidebar-section { font-size: 10px; font-weight: 600; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; padding: 0 6px; }

.history-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }

.history-item {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: all 0.15s;
}
.history-item:hover { background: var(--bg-card); color: var(--text-primary); padding-left: 14px; }
.history-item.active { background: var(--green-dim); color: var(--green); }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }

.status-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 11px; color: var(--text-muted);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
  transition: background 0.3s;
}
.status-dot.online  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.status-dot.offline { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.status-dot.loading { background: var(--gold); animation: pulse 1s infinite; }

.model-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
  color-scheme: dark;
  transition: border-color 0.2s;
}
.model-select:focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-dim); }

.model-select option {
  background: #111827;
  color: #f8fafc;
}

.model-select option:checked,
.model-select option:hover {
  background: #1d4ed8;
  color: #ffffff;
}

/* ── Main Chat Area ───────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.top-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(7,9,15,0.85);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.toggle-sidebar {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; padding: 4px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, transform 0.2s;
  line-height: 1;
}
.toggle-sidebar:hover { color: var(--text-primary); transform: scale(1.1); }

.top-bar-title { font-size: 15px; font-weight: 600; }
.top-bar-sub   { font-size: 11px; color: var(--text-muted); margin-left: auto; }

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* ── Messages ────────────────────────────────────────── */
.message { display: flex; gap: 12px; max-width: 860px; animation: msgIn 0.35s ease; }
.message.user { flex-direction: row-reverse; align-self: flex-end; }
.message.assistant { align-self: flex-start; width: 100%; }

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

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.avatar.user-av { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; }
.avatar.ai-av   { background: linear-gradient(135deg, var(--gold), #b8960c); color: #000; font-size: 16px; }

.bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  line-height: 1.7;
  font-size: 14px;
  max-width: 100%;
  word-break: break-word;
}
.message.user .bubble {
  background: linear-gradient(135deg, #1d4ed8, #3730a3);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  color: #fff;
}
.message.assistant .bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  flex: 1;
  position: relative;
}

.bubble .content { white-space: pre-wrap; }
.bubble .content b,
.bubble .content strong { color: var(--gold); }
.bubble .content em { color: #c4b5fd; font-style: italic; }
.bubble .content h3 {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  margin: 12px 0 6px; border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.bubble .content h4 {
  font-size: 13px; font-weight: 600; color: var(--gold);
  margin: 10px 0 4px;
}
.bubble .content ul,
.bubble .content ol {
  padding-left: 20px; margin: 6px 0;
}
.bubble .content li { margin: 3px 0; }
.bubble .content p  { margin: 4px 0; }
.bubble .content code {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  color: #93c5fd;
}

.cursor {
  display: inline-block;
  width: 2px; height: 14px;
  background: var(--text-primary);
  margin-left: 1px;
  vertical-align: text-bottom;
  border-radius: 1px;
  animation: blink 0.55s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Copy button on AI messages */
.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  display: flex; align-items: center; gap: 4px;
}
.message.assistant .bubble:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text-primary); border-color: var(--border-hover); background: rgba(255,255,255,0.08); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }


/* ── Citation Cards ──────────────────────────────────── */
.citations {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.citations-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; user-select: none;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 0;
  transition: color 0.15s;
}
.citations-header:hover { color: var(--text-primary); }
.citations-toggle { font-size: 10px; margin-left: auto; transition: transform 0.25s; }
.citations-toggle.open { transform: rotate(180deg); }

.citations-body { display: none; flex-direction: column; gap: 8px; margin-top: 8px; }
.citations-body.open { display: flex; animation: fadeIn 0.2s ease; }

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

.cite-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: default;
}
.cite-card:hover {
  transform: translateY(-2px);
  border-color: rgba(212,175,55,0.35);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.cite-card.ocr   { border-left-color: var(--green); }
.cite-card.ocr:hover { border-color: rgba(26,154,108,0.35); }
.cite-card.mixed { border-left-color: #8b5cf6; }

.cite-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.cite-law   { font-weight: 600; color: var(--text-primary); }
.cite-art   { color: var(--gold); font-size: 11px; }
.cite-score { margin-left: auto; font-size: 10px; color: var(--text-muted); background: var(--bg-card); padding: 2px 6px; border-radius: 20px; }
.cite-badge { font-size: 9px; padding: 2px 5px; border-radius: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.cite-badge.ocr { background: var(--green-dim); color: var(--green); }
.cite-badge.en  { background: rgba(59,130,246,0.15); color: #60a5fa; }
.cite-badge.ar  { background: var(--gold-dim); color: var(--gold); }
.cite-excerpt { color: var(--text-muted); line-height: 1.6; direction: auto; }

/* ── Welcome Screen ──────────────────────────────────── */
.welcome {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; text-align: center; gap: 24px; padding: 40px 20px;
  animation: msgIn 0.5s ease;
}

.welcome-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--gold), #b8960c);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: var(--glow-gold);
  animation: float 3.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0);    box-shadow: var(--glow-gold); }
  50%       { transform: translateY(-8px); box-shadow: var(--glow-gold-lg); }
}

.welcome h1 {
  font-size: 26px; font-weight: 700;
  background: linear-gradient(120deg, var(--gold) 0%, #f5f5f5 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome p  { color: var(--text-muted); max-width: 480px; line-height: 1.7; font-size: 14px; }

.example-queries {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  max-width: 600px; width: 100%;
}

.example-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 12px; text-align: left;
  cursor: pointer; transition: all 0.22s;
  direction: auto;
  opacity: 0;
  animation: slideInUp 0.4s ease both;
}
.example-btn:nth-child(1) { animation-delay: 0.06s; }
.example-btn:nth-child(2) { animation-delay: 0.12s; }
.example-btn:nth-child(3) { animation-delay: 0.18s; }
.example-btn:nth-child(4) { animation-delay: 0.24s; }
.example-btn:nth-child(5) { animation-delay: 0.30s; }
.example-btn:nth-child(6) { animation-delay: 0.36s; }

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

.example-btn:hover {
  background: var(--gold-dim);
  border-color: rgba(212,175,55,0.4);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.example-btn:active { transform: translateY(0); }

/* ── Input Bar ───────────────────────────────────────── */
.input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(7,9,15,0.92);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.input-box {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim), 0 0 20px rgba(212,175,55,0.08);
}

#query-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 14px;
  resize: none; max-height: 120px; line-height: 1.5;
  font-family: inherit;
}
#query-input::placeholder { color: var(--text-faint); }
#query-input::-webkit-scrollbar { display: none; }

/* Send button */
.send-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #b8960c);
  border: none; border-radius: 10px;
  color: #000; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; box-shadow: var(--glow-gold);
  padding: 0;
}
.send-btn:hover:not(:disabled) { transform: scale(1.08); box-shadow: var(--glow-gold-lg); }
.send-btn:active:not(:disabled) { transform: scale(0.96); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

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

.input-hint { font-size: 10px; color: var(--text-faint); text-align: center; margin-top: 8px; }

/* ── Similar Cases Section ──────────────────────────────── */
.similar-cases {
  margin-top: 12px;
  border-top: 1px solid rgba(99,102,241,0.2);
  padding-top: 10px;
}

.similar-cases-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: #818cf8;
  cursor: pointer; user-select: none;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 0;
  transition: color 0.15s;
}
.similar-cases-header:hover { color: #a5b4fc; }
.similar-cases-toggle { font-size: 10px; margin-left: auto; transition: transform 0.25s; }
.similar-cases-toggle.open { transform: rotate(180deg); }

.similar-cases-body { display: none; flex-direction: column; gap: 8px; margin-top: 8px; }
.similar-cases-body.open { display: flex; animation: fadeIn 0.2s ease; }

.case-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(99,102,241,0.2);
  border-left: 3px solid #6366f1;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  cursor: default;
}
.case-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.case-header {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.case-title   { font-weight: 600; color: #c7d2fe; flex: 1; }
.case-outcome {
  font-size: 10px; padding: 2px 7px; border-radius: 20px; font-weight: 600;
  white-space: nowrap;
}
.case-outcome.won     { background: rgba(34,197,94,0.15); color: #4ade80; }
.case-outcome.lost    { background: var(--red-dim); color: #f87171; }
.case-outcome.settled { background: rgba(251,191,36,0.15); color: #fbbf24; }
.case-outcome.partial { background: rgba(99,102,241,0.15); color: #818cf8; }
.case-outcome.pending { background: rgba(148,163,184,0.12); color: #94a3b8; }
.case-sim  { font-size: 10px; color: #818cf8; background: rgba(99,102,241,0.1); padding: 2px 6px; border-radius: 20px; }
.case-type { font-size: 10px; color: var(--text-muted); }
.case-facts { color: var(--text-muted); line-height: 1.6; margin-bottom: 4px; }
.case-laws  { font-size: 11px; color: #818cf8; }

/* ── Add Case Modal ──────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #111827;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%; max-width: 580px;
  max-height: 85vh; overflow-y: auto;
  animation: modalIn 0.25s ease;
}

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

.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 20px; color: #c7d2fe; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.06em; }
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 9px 12px;
  border-radius: var(--radius-sm); font-size: 13px;
  font-family: inherit; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}
.form-textarea { resize: vertical; min-height: 72px; }

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
  color-scheme: dark;
}
.form-select option { background: #111827; color: #f8fafc; }
.form-select option:checked, .form-select option:hover { background: #4338ca; color: #ffffff; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; border: none; padding: 10px 20px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all 0.2s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.btn-cancel {
  background: var(--bg-card); color: var(--text-muted);
  border: 1px solid var(--border); padding: 10px 20px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  transition: all 0.2s;
}
.btn-cancel:hover { color: var(--text-primary); border-color: var(--border-hover); }

/* ── Case library sidebar btn ────────────────────────────── */
.cases-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  color: #818cf8;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all 0.2s; white-space: nowrap;
}
.cases-btn:hover {
  background: rgba(99,102,241,0.2);
  color: #a5b4fc;
  transform: translateY(-1px);
}

/* ── Error bubble ────────────────────────────────────── */
.error-msg {
  background: var(--red-dim);
  border: 1px solid rgba(220,70,70,0.3);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  animation: msgIn 0.3s ease;
}

/* ── Toast Notifications ─────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  max-width: 340px;
  pointer-events: all;
  animation: toastIn 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
}
.toast.success {
  background: rgba(26,154,108,0.18);
  border-color: rgba(26,154,108,0.4);
  color: #4ade80;
}
.toast.error {
  background: rgba(220,70,70,0.15);
  border-color: rgba(220,70,70,0.4);
  color: #fca5a5;
}
.toast.info {
  background: rgba(212,175,55,0.12);
  border-color: rgba(212,175,55,0.3);
  color: var(--gold);
}
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-text { flex: 1; }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: 0.6; font-size: 14px;
  padding: 0; line-height: 1;
  transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px) scale(0.95); max-height: 0; padding: 0; margin: 0; }
}
.toast.removing { animation: toastOut 0.25s ease forwards; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── Animations ──────────────────────────────────────── */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes spin  { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.spinner { animation: spin 1s linear infinite; display: inline-block; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .sidebar.mobile-open { display: flex; position: fixed; height: 100vh; z-index: 100; }
  .example-queries { grid-template-columns: 1fr; }
  .toast-container { bottom: 16px; right: 16px; left: 16px; }
  .toast { max-width: 100%; }
}
