/* ============================================================
   HarixAI — Geist Design System (Light Theme)
   Complete implementation from DESIGN.md
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ---- Brand ---- */
  --primary: #171717;
  --secondary: #4d4d4d;
  --tertiary: #006bff;
  --neutral: #f2f2f2;
  --background-100: #ffffff;
  --background-200: #fafafa;

  /* ---- Gray ---- */
  --gray-100: #f2f2f2;
  --gray-200: #ebebeb;
  --gray-300: #e6e6e6;
  --gray-400: #eaeaea;
  --gray-500: #c9c9c9;
  --gray-600: #a8a8a8;
  --gray-700: #8f8f8f;
  --gray-800: #7d7d7d;
  --gray-900: #4d4d4d;
  --gray-1000: #171717;

  /* ---- Gray Alpha ---- */
  --gray-alpha-100: #0000000d;
  --gray-alpha-200: #00000015;
  --gray-alpha-300: #0000001a;
  --gray-alpha-400: #00000014;
  --gray-alpha-500: #00000036;
  --gray-alpha-600: #0000003d;
  --gray-alpha-700: #00000070;
  --gray-alpha-800: #00000082;
  --gray-alpha-900: #000000b3;
  --gray-alpha-1000: #000000e8;

  /* ---- Blue ---- */
  --blue-100: #f0f7ff;
  --blue-200: #e9f4ff;
  --blue-300: #dfefff;
  --blue-400: #cae7ff;
  --blue-500: #94ccff;
  --blue-600: #48aeff;
  --blue-700: #006bff;
  --blue-800: #0059ec;
  --blue-900: #005ff2;
  --blue-1000: #002359;

  /* ---- Red ---- */
  --red-100: #ffeeef;
  --red-200: #ffe8ea;
  --red-300: #ffe3e4;
  --red-400: #ffd7d6;
  --red-500: #ffb1b3;
  --red-600: #ff676d;
  --red-700: #fc0035;
  --red-800: #ea001d;
  --red-900: #d8001b;
  --red-1000: #47000c;

  /* ---- Amber ---- */
  --amber-100: #fff6de;
  --amber-200: #fff4cf;
  --amber-300: #fff1c1;
  --amber-400: #ffdc73;
  --amber-500: #ffc543;
  --amber-600: #ffa600;
  --amber-700: #ffae00;
  --amber-800: #ff9300;
  --amber-900: #aa4d00;
  --amber-1000: #561900;

  /* ---- Green ---- */
  --green-100: #ecfdec;
  --green-200: #e5fce7;
  --green-300: #d3fad1;
  --green-400: #b9f5bc;
  --green-500: #82eb8d;
  --green-600: #4ce15e;
  --green-700: #28a948;
  --green-800: #279141;
  --green-900: #107d32;
  --green-1000: #003a00;

  /* ---- Teal ---- */
  --teal-100: #defffb;
  --teal-200: #ddfef6;
  --teal-300: #ccf9f1;
  --teal-400: #b1f7ec;
  --teal-500: #52f0db;
  --teal-600: #00e3c4;
  --teal-700: #00ac96;
  --teal-800: #00927f;
  --teal-900: #007f70;
  --teal-1000: #003f34;

  /* ---- Purple ---- */
  --purple-100: #faf0ff;
  --purple-200: #f9f0ff;
  --purple-300: #f6e8ff;
  --purple-400: #f2d9ff;
  --purple-500: #dfa7ff;
  --purple-600: #c979ff;
  --purple-700: #a000f8;
  --purple-800: #8500d1;
  --purple-900: #7d00cc;
  --purple-1000: #2f004e;

  /* ---- Pink ---- */
  --pink-100: #ffe8f6;
  --pink-200: #ffe8f3;
  --pink-300: #ffdfeb;
  --pink-400: #ffd3e1;
  --pink-500: #fdb3cc;
  --pink-600: #f97ea7;
  --pink-700: #f22782;
  --pink-800: #e4106e;
  --pink-900: #c41562;
  --pink-1000: #460523;

  /* ---- Spacing (4 px scale) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-16: 64px;
  --space-24: 96px;

  /* ---- Border Radius ---- */
  --rounded-sm: 6px;
  --rounded-md: 12px;
  --rounded-lg: 16px;
  --rounded-full: 9999px;

  /* ---- Shadows / Elevations ---- */
  --shadow-raised: 0 2px 2px rgba(0,0,0,.04);
  --shadow-popover: 0 1px 1px rgba(0,0,0,.02), 0 4px 8px -4px rgba(0,0,0,.04), 0 16px 24px -8px rgba(0,0,0,.06);
  --shadow-modal: 0 1px 1px rgba(0,0,0,.02), 0 8px 16px -4px rgba(0,0,0,.04), 0 24px 32px -8px rgba(0,0,0,.06);

  /* ---- Fonts ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;

  /* ---- Motion ---- */
  --ease-out-back: cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
}

/* ============================================================
   DARK THEME OVERRIDES
   ============================================================ */
body.dark-theme {
  color-scheme: dark;
  --primary: #ededed;
  --secondary: #a1a1a1;
  --background-100: #171717;
  --background-200: #171717;
  --gray-100: #262626;
  --gray-200: #262626;
  --gray-300: #404040;
  --gray-400: #333333;
  --gray-500: #737373;
  --gray-600: #a3a3a3;
  --gray-700: #d4d4d4;
  --gray-800: #e5e5e5;
  --gray-900: #f5f5f5;
  --gray-1000: #fafafa;
  --gray-alpha-100: rgba(255, 255, 255, 0.05);
  --gray-alpha-200: rgba(255, 255, 255, 0.07);
  --gray-alpha-300: rgba(255, 255, 255, 0.1);
  --gray-alpha-400: rgba(255, 255, 255, 0.1);
  --gray-alpha-500: rgba(255, 255, 255, 0.2);
  --gray-alpha-600: rgba(255, 255, 255, 0.3);
  --shadow-raised: 0 2px 2px rgba(0,0,0,.5);
  --shadow-popover: 0 1px 1px rgba(0,0,0,.4), 0 4px 8px -4px rgba(0,0,0,.5), 0 16px 24px -8px rgba(0,0,0,.6);
  --shadow-modal: 0 1px 1px rgba(0,0,0,.4), 0 8px 16px -4px rgba(0,0,0,.5), 0 24px 32px -8px rgba(0,0,0,.6);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background-100);
  color: var(--gray-1000);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--blue-200); color: var(--blue-1000); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--rounded-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
/* Headings */
.heading-72 { font-size: 72px; font-weight: 600; line-height: 72px; letter-spacing: -4.32px; }
.heading-64 { font-size: 64px; font-weight: 600; line-height: 64px; letter-spacing: -3.84px; }
.heading-56 { font-size: 56px; font-weight: 600; line-height: 56px; letter-spacing: -3.36px; }
.heading-48 { font-size: 48px; font-weight: 600; line-height: 56px; letter-spacing: -2.88px; }
.heading-40 { font-size: 40px; font-weight: 600; line-height: 48px; letter-spacing: -2.4px; }
.heading-32 { font-size: 32px; font-weight: 600; line-height: 40px; letter-spacing: -1.28px; }
.heading-24 { font-size: 24px; font-weight: 600; line-height: 32px; letter-spacing: -0.96px; }
.heading-20 { font-size: 20px; font-weight: 600; line-height: 26px; letter-spacing: -0.4px; }
.heading-16 { font-size: 16px; font-weight: 600; line-height: 24px; letter-spacing: -0.32px; }
.heading-14 { font-size: 14px; font-weight: 600; line-height: 20px; letter-spacing: -0.28px; }

/* Labels */
.label-20 { font-size: 20px; font-weight: 400; line-height: 32px; }
.label-18 { font-size: 18px; font-weight: 400; line-height: 20px; }
.label-16 { font-size: 16px; font-weight: 400; line-height: 20px; }
.label-14 { font-size: 14px; font-weight: 400; line-height: 20px; }
.label-14-mono { font-family: var(--font-mono); font-size: 14px; font-weight: 400; line-height: 20px; }
.label-13 { font-size: 13px; font-weight: 400; line-height: 16px; }
.label-13-mono { font-family: var(--font-mono); font-size: 13px; font-weight: 400; line-height: 20px; }
.label-12 { font-size: 12px; font-weight: 400; line-height: 16px; }
.label-12-mono { font-family: var(--font-mono); font-size: 12px; font-weight: 400; line-height: 16px; }

/* Copy */
.copy-24 { font-size: 24px; font-weight: 400; line-height: 36px; }
.copy-20 { font-size: 20px; font-weight: 400; line-height: 36px; }
.copy-18 { font-size: 18px; font-weight: 400; line-height: 28px; }
.copy-16 { font-size: 16px; font-weight: 400; line-height: 24px; }
.copy-14 { font-size: 14px; font-weight: 400; line-height: 20px; }
.copy-14-mono { font-family: var(--font-mono); font-size: 14px; font-weight: 400; line-height: 20px; }
.copy-13 { font-size: 13px; font-weight: 400; line-height: 18px; }
.copy-13-mono { font-family: var(--font-mono); font-size: 13px; font-weight: 400; line-height: 18px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  border-radius: var(--rounded-sm);
  padding: 0 10px;
  height: 40px;
  transition: all var(--duration-fast) var(--ease-out-back);
  outline: none;
  white-space: nowrap;
  user-select: none;
}
.btn:focus-visible {
  box-shadow: 0 0 0 2px var(--background-100), 0 0 0 4px var(--blue-700);
}
.btn:disabled, .btn.disabled {
  background-color: var(--gray-100) !important;
  color: var(--gray-700) !important;
  border-color: var(--gray-alpha-400) !important;
  cursor: not-allowed;
  box-shadow: none !important;
}

/* Primary */
.btn-primary {
  background-color: var(--primary);
  color: var(--background-100);
}
.btn-primary:hover:not(:disabled) { background-color: var(--secondary); }
.btn-primary:active:not(:disabled) { background-color: var(--gray-900); transform: scale(.98); }

/* Secondary */
.btn-secondary {
  background-color: var(--background-100);
  color: var(--primary);
  border: 1px solid var(--gray-alpha-400);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--gray-100);
  border-color: var(--gray-alpha-500);
}
.btn-secondary:active:not(:disabled) {
  background-color: var(--gray-200);
  border-color: var(--gray-alpha-600);
  transform: scale(.98);
}

/* Tertiary */
.btn-tertiary {
  background-color: transparent;
  color: var(--primary);
}
.btn-tertiary:hover:not(:disabled) { background-color: var(--gray-alpha-100); }
.btn-tertiary:active:not(:disabled) { background-color: var(--gray-alpha-200); }

/* Error / Danger */
.btn-error {
  background-color: var(--red-800);
  color: #ffffff;
}
.btn-error:hover:not(:disabled) { background-color: var(--red-700); }
.btn-error:active:not(:disabled) { background-color: var(--red-900); transform: scale(.98); }

/* Sizes */
.btn-sm { font-size: 14px; padding: 0 6px; height: 32px; }
.btn-lg { font-size: 16px; font-weight: 500; padding: 0 14px; height: 48px; }
.btn-icon { width: 40px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 32px; }

/* ============================================================
   INPUTS
   ============================================================ */
.input, .textarea, .select {
  background-color: var(--background-100);
  color: var(--primary);
  font-size: 14px;
  line-height: 20px;
  border-radius: var(--rounded-sm);
  border: 1px solid var(--gray-alpha-400);
  padding: 0 12px;
  height: 40px;
  width: 100%;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--gray-alpha-500); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--gray-alpha-600);
  box-shadow: 0 0 0 2px var(--background-100), 0 0 0 4px var(--blue-700);
}
.input:disabled, .textarea:disabled, .select:disabled {
  background-color: var(--gray-100);
  color: var(--gray-700);
  cursor: not-allowed;
}
.input::placeholder, .textarea::placeholder { color: var(--gray-600); }

.input-sm { height: 32px; font-size: 14px; padding: 0 12px; }
.input-lg { height: 48px; font-size: 16px; padding: 0 12px; }

.textarea {
  height: auto;
  min-height: 80px;
  padding: 8px 12px;
  resize: vertical;
  line-height: 1.5;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238f8f8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Form groups */
.form-group { margin-bottom: var(--space-4); }
.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-1000);
}
.form-group .help-text {
  margin-top: 4px;
  font-size: 13px;
  color: var(--gray-700);
}
.form-group.error .input,
.form-group.error .textarea,
.form-group.error .select { border-color: var(--red-700); }
.form-group.error .help-text { color: var(--red-800); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background-color: var(--background-100);
  border: 1px solid var(--gray-alpha-400);
  border-radius: var(--rounded-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-raised);
}
.card-hover {
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
.card-hover:hover {
  border-color: var(--gray-alpha-500);
  box-shadow: var(--shadow-popover);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  border-radius: var(--rounded-full);
  white-space: nowrap;
}
.badge-gray   { background: var(--gray-100); color: var(--gray-900); }
.badge-blue   { background: var(--blue-100); color: var(--blue-900); }
.badge-green  { background: var(--green-100); color: var(--green-900); }
.badge-red    { background: var(--red-100); color: var(--red-900); }
.badge-amber  { background: var(--amber-100); color: var(--amber-900); }
.badge-purple { background: var(--purple-100); color: var(--purple-900); }
.badge-teal   { background: var(--teal-100); color: var(--teal-900); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.geist-table { width: 100%; border-collapse: collapse; }
table.geist-table th,
table.geist-table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-alpha-400);
  font-size: 14px;
  line-height: 20px;
}
table.geist-table th {
  font-weight: 600;
  color: var(--gray-900);
  background: var(--background-200);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.geist-table tbody tr {
  transition: background-color var(--duration-fast);
}
table.geist-table tbody tr:hover { background-color: var(--background-200); }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-alpha-400);
  gap: 0;
  overflow-x: auto;
}
.tab-item {
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-item:hover { color: var(--gray-1000); }
.tab-item.active {
  color: var(--gray-1000);
  border-bottom-color: var(--gray-1000);
}

/* ============================================================
   MODAL / OVERLAY
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal), visibility var(--duration-normal);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--background-100);
  border-radius: var(--rounded-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(8px) scale(.98);
  transition: transform var(--duration-normal) var(--ease-out-back);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--rounded-sm);
  font-size: 14px;
  line-height: 20px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-popover);
  animation: toastIn var(--duration-normal) var(--ease-out-back) forwards;
  min-width: 280px;
  max-width: 420px;
}
.toast-success { background: var(--green-100); color: var(--green-1000); border: 1px solid var(--green-400); }
.toast-error   { background: var(--red-100);   color: var(--red-1000);   border: 1px solid var(--red-400); }
.toast-info    { background: var(--blue-100);  color: var(--blue-1000);  border: 1px solid var(--blue-400); }
.toast-warning { background: var(--amber-100); color: var(--amber-1000); border: 1px solid var(--amber-400); }

.toast.removing {
  animation: toastOut var(--duration-fast) ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(16px); }
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--background-100);
  border: 1px solid var(--gray-alpha-400);
  border-radius: var(--rounded-md);
  padding: var(--space-5) var(--space-6);
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--rounded-full);
  overflow: hidden;
}
.progress-bar .progress-fill {
  height: 100%;
  border-radius: var(--rounded-full);
  background: var(--tertiary);
  transition: width var(--duration-slow);
}
.progress-bar .progress-fill.warning { background: var(--amber-600); }
.progress-bar .progress-fill.danger  { background: var(--red-700); }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--rounded-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  width: 100%;
  height: 1px;
  background: var(--gray-alpha-400);
  margin: var(--space-4) 0;
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--rounded-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-lg { width: 40px; height: 40px; font-size: 16px; }
.avatar-brand { background: var(--primary); color: var(--background-100); }
.avatar-user  { background: var(--blue-100); color: var(--blue-900); }
.avatar-muted { background: var(--gray-200); color: var(--gray-800); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-6); }
.container-sm { max-width: 680px; margin: 0 auto; padding: 0 var(--space-6); }
.container-lg { max-width: 1400px; margin: 0 auto; padding: 0 var(--space-6); }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Gap */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Sizing */
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }

/* Spacing */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* Text */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-700); }
.text-secondary { color: var(--gray-900); }
.text-success { color: var(--green-800); }
.text-error   { color: var(--red-800); }
.text-link {
  color: var(--blue-700);
  cursor: pointer;
  transition: color var(--duration-fast);
}
.text-link:hover { color: var(--blue-800); text-decoration: underline; }

/* Display */
.hidden  { display: none; }
.block   { display: block; }
.inline  { display: inline; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Positioning */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Border */
.border-bottom { border-bottom: 1px solid var(--gray-alpha-400); }
.border-top    { border-top: 1px solid var(--gray-alpha-400); }

/* ============================================================
   CODE BLOCKS (for AI chat messages)
   ============================================================ */
.code-block {
  position: relative;
  border-radius: var(--rounded-md);
  overflow: hidden;
  margin: var(--space-3) 0;
}
.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gray-200);
  padding: var(--space-2) var(--space-3);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-alpha-400);
}
.code-block pre {
  background: var(--gray-100);
  padding: var(--space-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-1000);
  margin: 0;
}
.code-block .copy-btn {
  background: var(--background-100);
  border: 1px solid var(--gray-alpha-400);
  border-radius: var(--rounded-sm);
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.code-block .copy-btn:hover { background: var(--gray-200); }

/* Inline code */
code:not([class]) {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .heading-72 { font-size: 48px; line-height: 52px; letter-spacing: -2.5px; }
  .heading-64 { font-size: 40px; line-height: 44px; letter-spacing: -2px; }
  .heading-56 { font-size: 36px; line-height: 40px; letter-spacing: -1.5px; }
  .heading-48 { font-size: 32px; line-height: 38px; letter-spacing: -1.2px; }
  .container { padding: 0 var(--space-4); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .heading-72 { font-size: 36px; line-height: 40px; letter-spacing: -1.8px; }
  .heading-40 { font-size: 28px; line-height: 34px; letter-spacing: -1px; }
  .heading-32 { font-size: 24px; line-height: 30px; }
  .container { padding: 0 var(--space-4); }
  .hide-mobile { display: none !important; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   TOOL CALL BADGE (WEB SEARCH)
   ============================================================ */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-100);
  color: var(--blue-800);
  padding: 4px 12px;
  border-radius: var(--rounded-full);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  border: 1px solid var(--blue-200);
  animation: fade-in-up 0.3s ease-out;
}
body.dark-theme .tool-badge {
  background: rgba(0, 112, 243, 0.15);
  border-color: rgba(0, 112, 243, 0.3);
  color: var(--blue-400);
}
.tool-badge.done {
  background: var(--green-100);
  color: var(--green-800);
  border-color: var(--green-200);
}
body.dark-theme .tool-badge.done {
  background: rgba(30, 200, 110, 0.15);
  border-color: rgba(30, 200, 110, 0.3);
  color: var(--green-400);
}
.tool-pulse {
  animation: pulse-op 1.5s infinite;
}
@keyframes pulse-op {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

/* ============================================================
   THINKING UI
   ============================================================ */
.think-container {
  margin-bottom: 16px;
  border-radius: var(--rounded-md);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all 0.2s ease;
}
.think-header {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  list-style: none; /* Hide default arrow */
}
.think-header::-webkit-details-marker {
  display: none;
}
.think-header:hover {
  background: var(--gray-alpha-100);
}
.think-content {
  padding: 14px;
  padding-top: 0;
  font-size: 14px;
  color: var(--gray-700);
  border-top: 1px solid transparent;
}
.think-container[open] .think-content {
  border-top-color: var(--gray-200);
  margin-top: 4px;
}

.think-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--gray-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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