/* ═══════════════════════════════════════════════════════════════════════════
   CLAJAMA Design System — v2 (CLAJAMA Conversational OS)
   
   Design heritage: ÆON's thermodynamic minimalism acquired into CLAJAMA's
   conversational operating environment. Gold + deep dark + purple accent.
   
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--input-h) + 16px);
  margin: 0;
  width: 100%;
  max-width: 100vw;
  position: relative;
  min-height: 100vh;
}

/* ── Ambient Background (CLAJAMA heritage) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(123, 77, 255, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(123, 77, 255, 0.03) 0%, transparent 50%);
}

/* Ambient grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(123, 77, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 77, 255, 0.015) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* Landing page override — no fixed header or input bar */
body.landing-active {
  padding-top: 0;
  padding-bottom: 0;
}

/* Chat/dashboard pages — global input bar suppressed */
body.chat-active {
  padding-bottom: 0;
}

/* ── CSS Custom Properties ── */
:root {
  /* ── Core backgrounds (CLAJAMA deep dark) ── */
  --bg-deep:         #030406;
  --bg-soft:         #070a10;
  --bg-surface:      #0b0d12;
  --bg-panel:        rgba(7, 10, 16, 0.88);
  --bg-raised:       rgba(11, 13, 18, 0.92);

  /* ── Aliases for template compatibility (landing pages use --surface, --raised, --border) ── */
  --surface:         var(--bg-surface);
  --raised:          var(--bg-raised);
  --border:          var(--border-subtle);
  --accent-text:     rgba(255, 255, 255, 0.95);

  /* ── Accent Purple (CLAJAMA primary) ── */
  --accent:          #7B4DFF;
  --accent-mid:      #9C6BFF;
  --accent-glow:     #B38CFF;
  --accent-soft:     rgba(123, 77, 255, 0.12);
  --accent-border:   rgba(123, 77, 255, 0.20);
  --accent-tint:     rgba(123, 77, 255, 0.06);

  /* ── Accent Purple (CLAJAMA heritage, secondary) ── */
  --accent-purple:     #7B4DFF;
  --accent-purple-mid: #9C6BFF;
  --accent-purple-tint: rgba(123, 77, 255, 0.10);
  --accent-hover:      rgba(123, 77, 255, 0.12);

  /* ── Accent Purple (secondary) ── */
  --accent-cyan:       #00ffe0; /* deprecated */
  --accent-cyan-tint:  rgba(0, 255, 224, 0.08); /* deprecated */

  /* ── Status colors (CLAJAMA heritage) ── */
  --status-green:    #3ae878;
  --status-red:      #ff5a6e;
  --status-yellow:   #ffc107;

  /* ── Text ── */
  --text-primary:    rgba(255, 255, 255, 0.92);
  --text-body:       rgba(255, 255, 255, 0.80);
  --text-secondary:  rgba(255, 255, 255, 0.55);
  --text-muted:      rgba(255, 255, 255, 0.25);

  /* ── Glassmorphism borders ── */
  --border-subtle:   rgba(255, 255, 255, 0.05);
  --border-light:    rgba(255, 255, 255, 0.06);
  --border-medium:   rgba(255, 255, 255, 0.08);
  --border-strong:   rgba(255, 255, 255, 0.10);
  --border-color:    var(--border-medium);

  /* ── Glows & Shadows ── */
  --glow-primary:    0 0 40px rgba(123, 77, 255, 0.35);
  --glow-subtle:     0 0 20px rgba(123, 77, 255, 0.25);
  --glow-modal:      0 0 40px rgba(123, 77, 255, 0.15);
  --shadow-modal:    0 25px 50px rgba(0, 0, 0, 0.50);
  --glow-bg:         radial-gradient(circle at 50% 0%, rgba(123, 77, 255, 0.20) 0%, transparent 70%);

  /* ── Radius ── */
  --radius-sm:       10px;
  --radius-md:       12px;
  --radius-lg:       20px;
  --radius-xl:       24px;
  --radius-pill:     50px;
  --radius-full:     9999px;

  /* ── Spacing ── */
  --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-md: 16px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ── Type Scale (rem = 16px) ── */
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 13px;
  --text-md:   14px;
  --text-body: 15px;
  --text-lg:   18px;
  --text-xl:   24px;
  --text-2xl:  32px;
  --text-3xl:  42px;

  /* ── Timing ── */
  --motion-fast:  150ms ease;
  --motion-base:  240ms ease;
  --motion-slow:  400ms ease;

  /* ── Layout ── */
  --header-h:     56px;
  --sidebar-w:    240px;
  --sidebar-w-collapsed: 60px;

  --input-h:      68px;

  /* ── Font family ── */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE MENU — bottom sheet overlay (hidden on desktop via media query)
   ═══════════════════════════════════════════════════════════════════════════ */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.2s ease;
  opacity: 0;
}
.mobile-overlay.open {
  display: flex;
  opacity: 1;
}

/* Show panel when overlay is open */
.mobile-overlay.open ~ .mobile-panel,
.mobile-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  background: var(--surface, var(--bg-surface, #0b0d12));
  border: 0.5px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 12px 12px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 16px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  z-index: 201;
}

.mobile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--border);
}
.mobile-panel-title {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}
.mobile-panel-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--raised);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s;
  font-family: inherit;
}
.mobile-panel-close:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.mobile-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mobile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 300;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.1s;
}
.mobile-item:hover {
  background: var(--accent-tint);
  color: var(--accent);
}
.mobile-item .mi-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.mobile-divider {
  height: 0.5px;
  background: var(--border);
  margin: 6px 10px;
}
.mobile-item-divider {
  height: 0.5px;
  background: var(--border);
  margin: 6px 10px;
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */

.heading-clajama {
  font-weight: 200;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.heading-xl {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
}

/* Hero-specific heading keeps the lighter weight for the massive display size */
.hero-headline {
  font-weight: 700;
}

.accent { color: var(--accent); }
.accent-cyan { color: var(--accent-cyan); }
.accent-purple { color: var(--accent-purple); }
.muted { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS — Pill style (CLAJAMA heritage)
   ═══════════════════════════════════════════════════════════════════════════ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--motion-base);
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  color: #030406;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(123, 77, 255, 0.20);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--motion-base);
  background: rgba(123, 77, 255, 0.10);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.btn-secondary:hover {
  background: rgba(123, 77, 255, 0.18);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--motion-fast);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ── Legacy button aliases (for backward compatibility) ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--motion-base);
  border: none;
  cursor: pointer;
}
.btn.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-mid)); color: #030406; }
.btn.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(123,77,255,0.2); }
.btn.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-medium); }
.btn.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════════════════
   APP SHELL — Two-Column Layout
   ═══════════════════════════════════════════════════════════════════════════ */

.app-shell {
  margin-left: var(--sidebar-w);
  min-height: calc(100vh - var(--header-h));
  display: flex;
}

/* ── App shell with context panel (3-column desktop layout) ── */
.app-shell.has-context .main-content {
  max-width: 900px;
}

.app-shell.has-context .context-panel {
  display: flex;
  flex-direction: column;
}

/* ── Context Panel (right column, desktop only) ── */
.context-panel {
  width: var(--context-w, 280px);
  background: var(--bg-surface, #0e0e14);
  border-left: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Context panel sections with better visual hierarchy */
.context-panel .sidebar-inner {
  flex: 1;
  overflow-y: auto;
  padding: 20px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.context-panel .section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.context-panel .section-icon.icon-project {
  background: rgba(123, 77, 255, 0.12);
  color: var(--accent);
}

.context-panel .section-icon.icon-actions {
  background: rgba(34, 197, 94, 0.10);
  color: var(--color-status-green, #22c55e);
}

.context-panel .section-icon.icon-memory {
  background: rgba(245, 158, 11, 0.10);
  color: var(--color-status-warn, #f59e0b);
}

/* Section header with icon */
.context-section-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.context-section-header .section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  line-height: 1.3;
}

.context-section-header .section-subtitle {
  font-size: 10px;
  color: rgba(255,255,255,0.18);
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 400;
}
/* Sections */
.context-section { margin-bottom: 16px; }

/* Active Project card */
.context-project-card {
  background: var(--raised, rgba(255,255,255,0.03));
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: var(--radius-md, 8px);
  padding: 12px;
  margin: 0 4px;
  transition: border-color 0.2s ease;
}
.context-project-card:hover {
  border-color: var(--accent, #7B4DFF);
}
.context-project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.context-project-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.context-project-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted, #5a5a6a);
  background: rgba(255,255,255,0.04);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.context-project-prompt {
  font-size: 11px;
  color: var(--text-muted, #5a5a6a);
  margin-top: 8px;
  line-height: 1.4;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
}

/* Empty state */
.context-empty {
  text-align: center;
  padding: 16px 8px;
}
.context-empty-icon {
  opacity: 0.4;
  margin-bottom: 8px;
}
.context-empty-text {
  font-size: 13px;
  color: var(--text-muted, #5a5a6a);
}
.context-empty-sub {
  font-size: 11px;
  color: var(--text-muted, #5a5a6a);
  margin-top: 2px;
}

/* Divider */
.context-divider {
  height: 1px;
  background: var(--border-subtle, rgba(255,255,255,0.06));
  margin: 12px 0;
}

/* Action buttons */
.context-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 8px);
  color: var(--text-secondary, #a0a0b0);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: inherit;
}

.context-action-btn:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border, rgba(255,255,255,0.08));
  color: var(--text-primary, #fff);
}

.context-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.context-action-btn:hover svg {
  opacity: 0.9;
}

.context-action-shortcut {
  margin-left: auto;
  font-size: 10px;
  color: rgba(255,255,255,0.15);
  font-weight: 400;
  letter-spacing: 0.02em;
  background: rgba(255,255,255,0.03);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Quick Stats (two items side by side) */
.context-stats {
  display: flex;
  gap: 8px;
  margin: 0 4px;
}
.context-stat {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  border-radius: var(--radius-sm, 6px);
  padding: 10px;
  text-align: center;
}
.context-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #fff);
}
.context-stat-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted, #5a5a6a);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Action buttons (merged — single source) */
.context-action-btn + .context-action-btn {
  margin-top: 6px;
}

/* When context panel is present, input bar stops at its left edge */
.app-shell.has-context + .input-bar-wrapper,
.app-shell.has-context ~ .input-bar-wrapper,
.app-shell.has-context ~ * .input-bar-wrapper {
  right: var(--context-w, 280px);
}

.app-shell[data-collapsed="true"] {
  margin-left: var(--sidebar-w-collapsed);
}

/* ── Main Content Area ── */
.main-content {
  overflow-y: auto;
  padding: 20px 24px;
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   APP HEADER — Fixed 56px Bar
   ═══════════════════════════════════════════════════════════════════════════ */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
}

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

.header-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--motion-fast);
}
.header-hamburger:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  color: #030406;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.header-logo-text {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 6px 16px;
  transition: all var(--motion-fast);
}
.header-search:focus-within {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 10px rgba(123, 77, 255, 0.08);
}
.header-search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.header-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  padding: 2px 0;
}
.header-search-input::placeholder { color: var(--text-muted); }
.header-search-kbd {
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: inherit;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--motion-fast);
}
.header-icon-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.header-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.header-avatar-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--motion-fast);
}
.header-avatar-btn:hover {
  background: rgba(255,255,255,0.06);
}
.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── User Dropdown Menu ──────────────────────────────────────────────── */
.header-user-menu {
  position: relative;
  display: flex;
}
.header-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--bg-surface, #111118);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 1002;
  overflow: hidden;
  animation: fadeSlideIn 0.15s ease;
}
.header-user-dropdown.open {
  display: block;
}
.user-dropdown-header {
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}
.user-dropdown-email {
  font-size: 12px;
  color: var(--text-muted, #888);
}
.user-dropdown-divider {
  height: 1px;
  background: var(--border-subtle, rgba(255,255,255,0.06));
  margin: 4px 0;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary, #fff);
  text-decoration: none;
  transition: background 0.1s ease;
  cursor: pointer;
}
.user-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
}
.user-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}
.user-dropdown-danger {
  color: #ef4444;
}
.user-dropdown-danger:hover {
  background: rgba(239,68,68,0.1);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR — Semantic Command Dock
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-w);
  background: rgba(7, 10, 16, 0.95);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  height: calc(100vh - var(--header-h));
  position: fixed;
  top: var(--header-h);
  left: 0;
  padding: 12px 8px;
}

/* Collapsed sidebar */
.sidebar[data-collapsed="true"] {
  width: var(--sidebar-w-collapsed);
}
.sidebar[data-collapsed="true"] .sidebar-item-label,
.sidebar[data-collapsed="true"] .sidebar-group-label,
.sidebar[data-collapsed="true"] .sidebar-spacer,
.sidebar[data-collapsed="true"] .sidebar-footer {
  display: none;
}
.sidebar[data-collapsed="true"] .sidebar-item {
  justify-content: center;
  padding: 8px;
}
.sidebar[data-collapsed="true"] .sidebar-item-icon {
  margin: 0;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 8px 12px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: all var(--motion-fast);
  cursor: pointer;
  width: 100%;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
}
.sidebar-item:hover {
  background: rgba(123, 77, 255, 0.06);
  color: var(--text-primary);
}
.sidebar-item.active {
  background: rgba(123, 77, 255, 0.08);
  color: var(--accent);
}

/* Sidebar tool dock groups */
.sidebar-group { margin-bottom: 12px; }
.sidebar-group-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 12px 4px;
  margin-top: 8px;
}
.sidebar-spacer { flex: 1; min-height: 12px; }
.sidebar-footer { border-top: 1px solid var(--border-subtle); padding-top: 8px; margin-top: 4px; }

/* Quick Stats in sidebar (between Tasks and Billing) */
.sidebar-quick-stats {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  margin-bottom: 4px;
}
.sidebar-stat {
  flex: 1;
  background: var(--raised);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
  border-radius: var(--radius-sm, 6px);
  padding: 6px;
  text-align: center;
}
.sidebar-stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.sidebar-stat-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 1px;
}
.sidebar[data-collapsed="true"] .sidebar-quick-stats { display: none; }
.sidebar .sidebar-inner { display: flex; flex-direction: column; height: 100%; }
.sidebar-item-primary { margin-bottom: 4px; }

/* New Chat button at top of sidebar */
.sidebar-new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 16px);
  margin: 8px 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sidebar-new-chat:hover {
  background: var(--accent-hover, #6a3de8);
  border-color: var(--accent-hover, #6a3de8);
}
.sidebar-new-chat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-new-chat-label {
  white-space: nowrap;
}
.sidebar[data-collapsed="true"] .sidebar-new-chat {
  width: auto;
  margin: 8px auto;
  padding: 8px;
  justify-content: center;
}
.sidebar[data-collapsed="true"] .sidebar-new-chat-label {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS — CLAJAMA style (rounded, gold-tinted borders, hover lift)
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 24px;
  transition: all var(--motion-base);
}
.card:hover {
  border-color: var(--accent-border);
  background: var(--bg-raised);
}

.card .card-icon {
  font-size: 1.3rem;
  margin-bottom: 12px;
  display: block;
}

.card h3, .card h4 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.card p {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT / MESSAGING
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0 140px; /* Bottom space for fixed input bar */
}

/* ── Chat container (scrollable wrapper) ── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
}
.chat-container .chat-messages {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.chat-container .chat-thinking {
  padding: 8px 24px 0;
}

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 85%;
}

.chat-msg.jama,
.chat-msg.ai { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.chat-avatar.ai {
  background: rgba(123, 77, 255, 0.12);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.chat-avatar.user {
  background: rgba(123, 77, 255, 0.12);
  color: var(--accent-purple);
  border: 1px solid rgba(123, 77, 255, 0.20);
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.7;
  word-wrap: break-word;
}
.chat-bubble.jama,
.chat-bubble.ai {
  background: rgba(11, 13, 18, 0.70);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  border-radius: 20px 20px 20px 4px;
}
.chat-bubble.user {
  background: rgba(123, 77, 255, 0.10);
  border: 1px solid rgba(123, 77, 255, 0.16);
  color: var(--text-primary);
  border-radius: 20px 20px 4px 20px;
}

/* ── Message content & timestamp (created by input_bar.js) ── */
.chat-msg-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-timestamp {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  padding: 0 4px;
}
.chat-msg-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}
.jama-avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Thinking indicator ── */
.chat-thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  animation: thinkPulse 1.5s ease-in-out infinite;
}
.chat-thinking-dots {
  display: flex;
  gap: 4px;
}
.chat-thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: thinkDot 1.2s ease-in-out infinite;
}
.chat-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.04em;
}
.chat-thinking-step {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}
.chat-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinkDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}
.chat-thinking-text {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INPUT BAR
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   GLOBAL INPUT BAR — #inputBarWrapper / .input-bar-wrapper
   Fixed at bottom, spans sidebar to right edge.
   Contains: attach btn, textarea, voice btn, send btn,
             and action chips row below.
   ═══════════════════════════════════════════════════════ */

/* -- Mode indicator: shows chat context (dashboard vs project) -- */
.input-mode-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0 4px 4px;
}
.input-mode-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
  letter-spacing: 0.03em;
  background: rgba(123, 77, 255, 0.1);
  color: var(--accent);
  border: 0.5px solid rgba(123, 77, 255, 0.2);
}
.input-mode-badge.input-mode-project {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

/* -- Wrapper: gradient fade + fixed position -- */
.input-bar-wrapper {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 40;
  padding: 8px 24px 12px;
  background: linear-gradient(180deg, transparent 0%, rgba(3,4,6,0.97) 30%);
  transition: opacity var(--motion-fast), transform var(--motion-fast);
}

/* -- Input row: attach / textarea / voice / send -- */
.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(11, 13, 18, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 6px 6px 6px 12px;
  backdrop-filter: blur(18px);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.input-bar:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 0 16px rgba(123, 77, 255, 0.10);
}

/* -- Textarea wrap (flex grows) -- */
.input-field-wrap {
  flex: 1;
  display: flex;
  align-items: center;
}

/* -- The actual textarea -- */
.input-field {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 300;
  font-family: var(--font-sans);
  outline: none;
  resize: none;
  min-height: 38px;
  max-height: 110px;
  line-height: 1.5;
  padding: 6px 0;
}
.input-field::placeholder {
  color: var(--text-muted);
  font-weight: 300;
  opacity: 0.6;
}

/* -- Attach / Voice / Send buttons -- */
.input-attach-btn,
.input-voice-btn,
.input-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--motion-fast), background var(--motion-fast);
  flex-shrink: 0;
  padding: 0;
}
.input-attach-btn:hover,
.input-voice-btn:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
}
.input-send-btn {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
}
.input-send-btn:hover {
  background: var(--accent-hover);
  filter: brightness(1.1);
}
.input-send-btn:disabled,
.input-attach-btn:disabled,
.input-voice-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* -- Action chips row below input -- */
.input-chips {
  display: flex;
  gap: 6px;
  padding: 8px 2px 0;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
  font-family: var(--font-sans);
  line-height: 1;
}
.chip:hover {
  background: rgba(123, 77, 255, 0.10);
  color: var(--text-primary);
  border-color: var(--accent-border);
}
.chip svg {
  flex-shrink: 0;
}

/* -- Loading state overlay -- */
.input-bar-wrapper.is-loading .input-bar {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Thinking indicator on non-chat pages ── */
.input-bar-wrapper.thinking::after {
  content: 'Jama is thinking…';
  position: absolute;
  top: -24px;
  left: 16px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  animation: thinking-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes thinking-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
/* (dead classes .chat-input, .chat-send-btn, .quick-chips, .qa-chip removed) */

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL SHELL
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  display: flex;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--motion-base), visibility 0s var(--motion-base);
}
.modal-overlay.open {
  visibility: visible;
  opacity: 1;
  transition: opacity var(--motion-base), visibility 0s 0s;
}

.modal-panel {
  background: rgba(7, 10, 16, 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(123, 77, 255, 0.10), 0 25px 50px rgba(0, 0, 0, 0.50);
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform var(--motion-slow), opacity var(--motion-base);
}

.modal-overlay.open .modal-panel {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
}

/* ── Modal grip (mobile drag handle) ── */
.modal-grip {
  display: none;
  width: 36px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border-medium);
  margin: 8px auto 0;
}

.show-mobile.modal-grip {
  display: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--motion-fast);
}
.modal-close:hover {
  background: rgba(123, 77, 255, 0.08);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* ── Modal shell (modal-panel-* classes) ── */
.modal-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-panel-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-primary);
}
.modal-panel-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--motion-fast);
}
.modal-panel-close:hover {
  background: rgba(123, 77, 255, 0.08);
  color: var(--text-primary);
}
.modal-panel-body {
  padding: 24px;
  overflow-y: auto;
}
.modal-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ── Modal Form Fields (for project_create.ts, etc.) ── */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-input,
.modal-textarea {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  padding: 12px 14px;
  outline: none;
  transition: all var(--motion-fast);
}

.modal-input:focus,
.modal-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-tint);
}

.modal-input::placeholder,
.modal-textarea::placeholder {
  color: var(--text-muted);
}

.modal-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

/* ── Modal Type Grid (website/store/blog/portfolio buttons) ── */
.modal-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.modal-type-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  cursor: pointer;
  transition: all var(--motion-fast);
}

.modal-type-btn:hover {
  border-color: var(--accent-border);
  background: var(--accent-tint);
  color: var(--text-primary);
}

.modal-type-btn.active {
  border-color: var(--accent);
  background: rgba(123, 77, 255, 0.08);
  color: var(--text-primary);
}

.modal-type-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.modal-type-btn.active svg {
  opacity: 1;
}

/* ── Modal Actions (footer buttons) ── */
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

/* ── Utils ── */
.show-mobile { display: none; }
@media (max-width: 639px) {
  .show-mobile { display: block; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTEXT PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   GRID & LAYOUT HELPERS
   ═══════════════════════════════════════════════════════════════════════════ */

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--grid-min, 260px), 1fr));
  gap: var(--grid-gap, 16px);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }

@media (max-width: 1023px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* ── Mobile Hamburger Menu ── */
#hm-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  gap: 4px;
  padding: 8px;
  position: relative;
  z-index: 1001;
}
#hm-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary, #fff);
  border-radius: 2px;
  transition: all 0.2s ease;
}
#hm-btn.hm-open #hm-line1 { transform: rotate(45deg) translate(4px, 4px); }
#hm-btn.hm-open #hm-line2 { opacity: 0; }
#hm-btn.hm-open #hm-line3 { transform: rotate(-45deg) translate(4px, -4px); }
.hm-dropdown {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-deep, #07070b);
  z-index: 1000;
  overflow-y: auto;
  animation: fadeSlideIn 0.2s ease;
}
.hm-dropdown.hm-open { display: block; }
.hm-scroll { padding: 8px 0; }
.hm-menu-list { list-style: none; margin: 0; padding: 0; }
.hm-label {
  padding: 12px 20px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted, #888);
  font-weight: 600;
}
.hm-item {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  color: var(--text-primary, #fff);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.hm-item:hover { background: var(--accent-tint, rgba(123,77,255,0.08)); color: var(--accent); }
.hm-divider { height: 1px; background: var(--border, rgba(255,255,255,0.06)); margin: 4px 20px; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATS ROW (CLAJAMA heritage)
   ═══════════════════════════════════════════════════════════════════════════ */

.stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value {
  font-size: 28px;
  font-weight: 200;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}
th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 400;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(123, 77, 255, 0.03);
}
td {
  padding: 10px 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

.input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 300;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--motion-fast);
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 8px rgba(123, 77, 255, 0.06);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION DIVIDERS
   ═══════════════════════════════════════════════════════════════════════════ */

.section-divider {
  border: none;
  height: 1px;
  background: var(--border-subtle);
  margin: 0;
}

.section-divider-lg {
  margin: 40px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE: MOBILE (< 640px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 639px) {
  .app-shell {
    margin-left: 0;
  }
  
  .sidebar { display: none; }
  .context-panel { display: none; }
  .app-shell.has-context .context-panel { display: none; }
  
  #hm-btn { display: flex; }
  .header-hamburger { display: flex; }
  .header-search { display: none; }
  
  .main-content {
    padding: 12px 12px;
  }
  
  .input-bar-wrapper {
    left: 0;
    right: 0;
    padding: 6px 10px 10px;
  }
  .app-shell.has-context + .input-bar-wrapper,
  .app-shell.has-context ~ .input-bar-wrapper,
  .app-shell.has-context ~ * .input-bar-wrapper {
    right: 0;
  }
  .input-chips { gap: 4px; padding-top: 6px; }
  .chip { font-size: 11px; padding: 4px 9px; gap: 4px; }
  .chip svg { width: 12px; height: 12px; }
  
  .chat-msg-content { max-width: 88%; }
  .chat-bubble { font-size: 15px; padding: 10px 14px; }
  .input-field { font-size: 15px; min-height: 40px; }
  .input-send-btn { width: 40px; height: 40px; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-panel {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .modal-grip { display: block; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE: TABLET (640–1023px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 640px) and (max-width: 1023px) {
  /* Tablet: sidebar starts collapsed (60px icons), hamburger toggles to full width.
     data-collapsed="false" = expanded, data-collapsed="true" = collapsed.
     Use the same [data-collapsed] selectors as desktop but default to collapsed. */
  .app-shell {
    margin-left: 60px;
  }
  .app-shell[data-collapsed="false"] {
    margin-left: 240px;
  }

  .sidebar { width: 60px; }
  .sidebar[data-collapsed="false"] { width: 240px; }
  .sidebar-item span { display: none; }
  .sidebar[data-collapsed="false"] .sidebar-item span { display: inline; }
  .sidebar-group-label { display: none; }
  .sidebar[data-collapsed="false"] .sidebar-group-label { display: block; }
  .sidebar-spacer { display: none; }
  .sidebar[data-collapsed="false"] .sidebar-spacer { display: block; }
  .sidebar-footer { display: none; }
  .sidebar[data-collapsed="false"] .sidebar-footer { display: flex; }

  .context-panel { display: none; }
  .app-shell.has-context .context-panel { display: none; }

  .input-bar-wrapper {
    left: 60px;
    right: 0;
  }
  .app-shell.has-context + .input-bar-wrapper,
  .app-shell.has-context ~ .input-bar-wrapper,
  .app-shell.has-context ~ * .input-bar-wrapper {
    right: 0;
  }

  #hm-btn { display: flex; }
  .header-hamburger { display: flex; }
  .landing-hamburger { display: flex; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE: DESKTOP (1024px+)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) {
  #hm-btn { display: none !important; }
  .header-hamburger { display: none !important; }
  .landing-hamburger { display: none !important; }
  .mobile-overlay { display: none !important; }
  .mobile-panel { display: none !important; }
  #mobileMenu { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ONBOARDING / EMPTY STATE — persona-select cards
   ═══════════════════════════════════════════════════════════════════════════ */

.onboarding-card {
  max-width: 680px;
  margin: auto;
  padding: 40px 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 30px rgba(123, 77, 255, 0.04);
  text-align: center;
}

.onboarding-jama-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 400;
  margin: 0 auto 16px;
}

.onboarding-title {
  font-size: 22px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.onboarding-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.onboarding-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 12px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  cursor: pointer;
  transition: all var(--motion-fast);
  text-align: center;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.3;
}

.onboarding-btn:hover {
  border-color: var(--accent);
  background: rgba(123, 77, 255, 0.06);
  box-shadow: 0 0 20px rgba(123, 77, 255, 0.08);
}

.onboarding-btn-icon {
  font-size: 28px;
  line-height: 1;
}

.onboarding-btn-desc {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ── QC chips (quick-create modal) ── */
.qc-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all var(--motion-fast);
}

.qc-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(123, 77, 255, 0.06);
}

/* ── QC form elements ── */
.qc-label {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 6px;
}

.qc-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--motion-fast);
  box-sizing: border-box;
}

.qc-input:focus {
  border-color: var(--accent);
}

.qc-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--motion-fast);
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
}

.qc-textarea:focus {
  border-color: var(--accent);
}

.qc-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.qc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.qc-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.qc-header-text {
  flex: 1;
}

.qc-header-title {
  font-size: 18px;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.qc-header-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.qc-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.qc-close:hover {
  color: var(--text-primary);
}

/* ── QC form group ── */
.qc-form-group {
  margin-bottom: 14px;
}

.qc-optional {
  color: var(--text-muted);
  font-weight: 300;
}

.qc-result {
  display: none;
  padding: 20px 0;
  text-align: center;
}

.qc-result.active {
  display: block;
}

/* ── Onboarding text ── */
.onboarding-hint {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.onboarding-skip {
  margin-top: 12px;
  display: inline-block;
}

/* ── Page title ── */
.page-title {
  font-size: 26px;
  font-weight: 200;
  color: var(--text-primary);
}

/* ── Onboarding wrapper (centers empty state) ── */
.onboarding-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 20px;
}

/* ── QC loading ── */
.qc-loading {
  display: none;
  padding: 20px 0;
  text-align: center;
}

.qc-loading.active {
  display: block;
}

.qc-loading-status {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.qc-loading-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Project grid ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 0;
}

.project-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-raised);
  text-decoration: none;
  transition: all var(--motion-fast);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(123, 77, 255, 0.06);
}

.project-card-name {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.project-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}


/* ════════════════════════════════════════════════ */
/* CONSOLIDATED FROM: clajama.css */
/* 231 new rules + 16 duplicates skipped */
/* ════════════════════════════════════════════════ */


/* CONSOLIDATED FROM: jama-ux-redesign.css */
/* 37 new rules + 0 duplicates skipped */
/* ════════════════════════════════════════════════ */

/* CONSOLIDATED from jama-ux-redesign.css */
.edit-toggle-btn {
    bottom: 100px; right: 12px; width: 38px; height: 38px;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-toggle-btn:hover {
    background: rgba(123, 77, 255,0.15);
  transform: scale(1.05);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-toggle-btn.is-active {
    background: var(--accent);
  color: var(--bg-deep);
  box-shadow: 0 0 20px rgba(123, 77, 255,0.3);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-toggle-btn svg {
    width: 16px; height: 16px;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-mode-bar {
    display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10000;
  height: 4px;
  background: linear-gradient(90deg, #7B4DFF, #B38CFF, #7B4DFF);
  background-size: 200% 100%;
  animation: edit-bar-shimmer 2s infinite linear;
}
/* CONSOLIDATED from jama-ux-redesign.css */
body.edit-mode .edit-mode-bar {
    display: block;
}
/* CONSOLIDATED from jama-ux-redesign.css */
@keyframes edit-bar-shimmer {
    0% { background-position: 200% 0;
}
/* CONSOLIDATED from jama-ux-redesign.css */
100% {
    background-position: -200% 0;
}
/* CONSOLIDATED from jama-ux-redesign.css */
}


body.edit-mode [data-edit] {
    outline: 2px dashed rgba(123, 77, 255,0.5);
  outline-offset: 2px;
  border-radius: 4px;
  cursor: text;
  transition: outline 0.2s ease, background 0.2s ease;
  padding: 2px 4px;
}
/* CONSOLIDATED from jama-ux-redesign.css */
body.edit-mode [data-edit]:hover {
    outline-color: var(--accent);
  background: rgba(123, 77, 255,0.05);
}
/* CONSOLIDATED from jama-ux-redesign.css */
body.edit-mode [data-edit]:focus {
    outline-color: var(--accent);
  background: rgba(123, 77, 255,0.08);
  box-shadow: 0 0 12px rgba(123, 77, 255,0.15);
}
/* CONSOLIDATED from jama-ux-redesign.css */
body.edit-mode [data-edit-img] {
    outline: 2px dashed rgba(123, 77, 255,0.5);
  outline-offset: 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: outline 0.2s ease;
}
/* CONSOLIDATED from jama-ux-redesign.css */
body.edit-mode [data-edit-img]:hover {
    outline-color: var(--accent);
  filter: brightness(1.1);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions {
    top: 8px; left: 8px; right: 8px; transform: none; width: auto; flex-wrap: wrap; justify-content: center;
}
/* CONSOLIDATED from jama-ux-redesign.css */
body.edit-mode .edit-actions {
    display: flex;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-btn {
    padding: 6px 18px;
  border-radius: 8px;
  border: none;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-btn.save {
    background: var(--accent);
  color: var(--bg-deep);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-btn.save:hover {
    filter: brightness(1.15);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-btn.save:disabled {
    opacity: 0.4; cursor: not-allowed;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-btn.cancel {
    background: transparent;
  color: var(--text-secondary, #999);
  border: 0.5px solid rgba(255,255,255,0.1);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-btn.cancel:hover {
    background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-status {
    font-size: 12px;
  color: var(--text-muted, #666);
  margin-left: 8px;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-status.saving {
    color: var(--accent);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-status.success {
    color: #2ecc71;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.edit-actions-status.error {
    color: #e74c3c;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.welcome-bubble {
    background: linear-gradient(135deg, rgba(123, 77, 255,0.15), rgba(123, 77, 255,0.05)) !important;
  border: 0.5px solid rgba(123, 77, 255,0.2) !important;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.opportunity-strip {
    padding: 8px; gap: 6px;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.opportunity-item {
    font-size: 12px; padding: 5px 10px;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.opportunity-item:hover {
    background: rgba(123, 77, 255,0.12);
  border-color: rgba(123, 77, 255,0.25);
  color: var(--text-primary);
}
/* CONSOLIDATED from jama-ux-redesign.css */
.opportunity-item svg {
    width: 14px; height: 14px;
  color: var(--accent); flex-shrink: 0;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.chat-header {
    padding: 16px 4px 12px; margin-bottom: 0;
}
/* CONSOLIDATED from jama-ux-redesign.css (override) */
.chat-messages {
    padding: 4px 0 12px;
}
/* CONSOLIDATED from jama-ux-redesign.css (override) */
.chat-thinking {
    gap: 10px; padding: 8px 16px; margin: 4px 0;
}
/* CONSOLIDATED from jama-ux-redesign.css (override) */
.chat-thinking-dots span {
    background: var(--accent) !important;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.chat-thinking-text {
    font-size: 13px;
  color: var(--accent) !important;
  font-weight: 400;
}
/* CONSOLIDATED from jama-ux-redesign.css (override) */
.chat-timestamp {
    color: var(--text-muted); font-size: 11px; margin-top: 4px;
}
/* CONSOLIDATED from jama-ux-redesign.css (override) */
@media (max-width: 639px) {
    .chat-header { padding: 10px 0;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.chat-header-name {
    font-size: 15px;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.jama-avatar {
    width: 34px; height: 34px; font-size: 16px;
}
/* CONSOLIDATED from jama-ux-redesign.css (override) */
.chat-bubble {
    font-size: 14px; padding: 10px 14px;
}
/* CONSOLIDATED from jama-ux-redesign.css */
.welcome-bubble p:first-child {
    font-size: 16px !important;
}
/* CONSOLIDATED from jama-ux-redesign.css */
}


@media (min-width: 640px) and (max-width: 1023px) {
    .chat-header { padding: 14px 4px 12px; }
}

/* ════════════════════════════════════════════════ */
/* PERSISTENT USER CONTEXT MEMORY PANEL — backend-only  */

.context-memory-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}
.context-memory-close:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.context-memory-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ctx-tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.ctx-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.ctx-tab:hover:not(.active) {
  color: var(--text-secondary);
}

.context-memory-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  max-height: 40vh;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.ctx-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  color: var(--text-muted);
  font-size: 13px;
}

.context-memory-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 20px 16px;
  border-top: 1px solid var(--border-subtle);
}

.ctx-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.ctx-btn:hover {
  opacity: 0.9;
}

/* ── Tablet/mobile responsive ── */
@media (min-width: 640px) {
  .context-memory-btn {
    right: 24px;
    bottom: 100px;
  }
  .context-memory-panel {
    left: 50%;
    right: auto;
    width: 600px;
    margin-left: -300px;
    max-height: 60vh;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    bottom: 80px;
  }
}

@media (min-width: 1024px) {
  .context-memory-panel {
    left: auto;
    right: 24px;
    width: 480px;
    margin-left: 0;
    bottom: 80px;
  }
}

@supports (-webkit-touch-callout: none) {
    .chat-messages { height: -webkit-fill-available; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROJECT PAGE — Tabs, Tasks, Badges, Jama Welcome, Danger Button
   (Migrated from archived CSS — needed by project.html)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tabs ── */
.tab-content {
    display: none;
    padding: var(--space-md) 0;
    animation: fadeIn 0.2s ease;
}
.tab-content.active {
    display: block;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Section Label ── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ── Layout Helpers ── */
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mb-lg { margin-bottom: 24px; }

/* ── Danger Button ── */
.btn-danger {
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-danger:hover { border-color: rgba(231,76,60,0.4); color: rgba(231,76,60,0.7); }

/* ── Small Button Variant ── */
.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

/* ── Badges / Pills ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}
.badge-accent {
  background: var(--accent-tint);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.badge-muted {
  background: rgba(166,169,184,0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge-green {
  background: rgba(52,211,153,0.1);
  color: var(--status-green);
  border: 1px solid rgba(52,211,153,0.2);
}

/* ── Task Items ── */
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(166,169,184,0.08);
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}
.task-check {
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  background: transparent;
  font-size: 11px;
  transition: all 0.15s;
}
.task-check.completed {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}
.task-check:hover {
  border-color: var(--accent);
}
.task-desc { flex: 1; }
.task-desc.completed { color: var(--accent); text-decoration: line-through; }
.task-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.15s;
}
.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover { color: var(--status-red, #e74c3c); }

/* ── Jama Welcome Card ── */
.jama-welcome-card {
  border: 0.5px solid var(--accent-border);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.jama-welcome-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.jama-welcome-avatar {
  flex-shrink: 0;
}
.jama-avatar-tiny {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.jama-welcome-text {
  flex: 1;
}

/* ── Project Chat Messages ── */
.project-chat-messages {
  margin-bottom: 16px;
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}
.project-chat-messages .chat-msg {
  display: flex;
  gap: 8px;
  animation: msg-slide-in 0.2s ease-out;
}
.project-chat-messages .chat-msg.user {
  flex-direction: row-reverse;
}
.project-chat-messages .chat-msg-avatar {
  align-self: flex-end;
  flex-shrink: 0;
}
.project-chat-messages .chat-msg.user .chat-msg-avatar {
  display: none;
}
.project-chat-messages .chat-msg-content {
  max-width: 85%;
  display: flex;
  flex-direction: column;
}
.project-chat-messages .chat-msg.user .chat-msg-content {
  align-items: flex-end;
}
.project-chat-messages .chat-bubble {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.project-chat-messages .chat-bubble.user {
  background: var(--accent);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}
.project-chat-messages .chat-bubble.jama,
.project-chat-messages .chat-bubble.ai,
.project-chat-messages .chat-bubble.assistant {
  background: var(--raised);
  color: var(--text-primary);
  border: 0.5px solid var(--border);
  border-radius: 4px 16px 16px 16px;
}
.project-chat-messages .chat-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
}

/* ── Build page buttons ── */
/* ── Build version cards (project page) ── */
.build-card {
  border: 0.5px solid var(--text-muted);
  border-radius: 8px;
  margin-bottom: 16px;
  background: var(--surface);
  overflow: hidden;
}
.build-card-body {
  padding: 16px;
}
.build-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.build-card-version {
  font-size: 15px;
  font-weight: 200;
  color: var(--text-primary);
}
.build-card-pages-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}
.build-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.build-card-live-link {
  padding: 8px 16px;
  font-size: 12px;
  text-decoration: none;
  border: 0.5px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  background: rgba(245,158,11,0.08);
}
.build-card-page-btn {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.build-card-page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.build-card-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.build-preview-close-btn {
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
}
.build-page-btn.active {}

/* ── Build preview container ── */
.build-preview-container {
  border-top: 1px solid var(--border);
  background: #fff;
  position: relative;
  min-height: 400px;
}
.build-preview-iframe {
  width: 100%;
  border: none;
  min-height: 400px;
}
.preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: #fff;
  color: #888;
  font-size: 13px;
}

@keyframes msg-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ── Common missing classes from audit ────────────────────────── */
.si-icon,
.si-label { display: inline-flex; align-items: center; }
.si-icon { margin-right: 0.25rem; }
.si-label { gap: 0.25rem; }
.page-breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--text-muted, #999); }
.page-header { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
.page-desc { font-size: 0.875rem; color: var(--text-muted, #999); margin-bottom: 1rem; }
.no-underline { text-decoration: none; }
.no-underline:hover { text-decoration: underline; }
.admin-nav-link { display: block; padding: 0.5rem 0.75rem; color: var(--text-primary, #fff); text-decoration: none; border-radius: 0.375rem; transition: background 0.15s; }
.admin-nav-link:hover { background: rgba(123, 77, 255, 0.1); }
.wc-bad { color: #ef4444; }
.wc-good { color: #22c55e; }
.field-input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); border-radius: 0.375rem; background: var(--bg-input, #1a1a1e); color: var(--text-primary, #fff); }
.field-required::after { content: " *"; color: #ef4444; }
.form-input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); border-radius: 0.375rem; }
.heading-3 { font-size: 1.125rem; font-weight: 600; }
.text-muted { color: var(--text-muted, #999); }
.uppercase { text-transform: uppercase; }

/* ── Layout & structure classes ──────────────────────────────── */
.build-step, .build-step-icon, .build-step-label { display: inline-flex; align-items: center; }
.build-step { gap: 0.5rem; padding: 0.375rem 0; }
.build-step-icon { width: 1.5rem; height: 1.5rem; border-radius: 9999px; background: var(--accent); color: #fff; font-size: 0.75rem; justify-content: center; }
.build-step-label { font-size: 0.875rem; color: var(--text-muted, #999); }
.sidebar-divider { height: 1px; background: var(--border-color); margin: 0.5rem 0; }
.msg-action-btn { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: none; background: transparent; color: var(--text-muted, #999); cursor: pointer; border-radius: 0.375rem; transition: background 0.15s, color 0.15s; }
.msg-action-btn:hover { background: rgba(123, 77, 255, 0.1); color: var(--accent); }
.form-header { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }
.form-title { font-size: 1rem; font-weight: 500; margin-bottom: 0.5rem; }
.field { margin-bottom: 1rem; }
.field-error { font-size: 0.8rem; color: #ef4444; margin-top: 0.25rem; }
.field-required::after { content: " *"; color: #ef4444; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.overflow-hidden { overflow: hidden; }
.tracking-wider { letter-spacing: 0.05em; }
.chat-msg-actions { display: flex; gap: 0.25rem; margin-top: 0.25rem; }
.like-btn { background: none; border: none; cursor: pointer; color: var(--text-muted, #999); padding: 0.25rem; }
.like-btn.liked { color: var(--accent); }
.edi-badge { display: inline-flex; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.edi-badge.success { background: #166534; color: #86efac; }
.edi-badge.pending { background: #713f12; color: #fde68a; }
.edi-badge.error { background: #7f1d1d; color: #fca5a5; }
.quality-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; display: inline-block; }
.quality-dot.good { background: #22c55e; }
.quality-dot.fair { background: #eab308; }
.quality-dot.poor { background: #ef4444; }
.current_status { font-size: 0.875rem; font-weight: 500; padding: 0.125rem 0.5rem; border-radius: 0.25rem; }

/* ── Chat UI ─────────────────────────────────────────────────── */
.chat-inbox-section { padding: 0.5rem 0; }
.chat-inbox-section-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted, #999); padding: 0.25rem 0.75rem; }
.chat-inbox-empty { text-align: center; padding: 2rem; color: var(--text-muted, #999); font-size: 0.875rem; }
.msg-avatar { width: 2rem; height: 2rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.75rem; flex-shrink: 0; }
.msg-avatar-icon { font-size: 1rem; }
.msg-content { flex: 1; min-width: 0; }
.msg-role { font-size: 0.8rem; font-weight: 600; color: var(--text-primary, #fff); }
.msg-bubble { padding: 0.5rem 0.75rem; border-radius: 0.5rem; background: var(--bg-card, #161614); line-height: 1.5; }
.msg-text { font-size: 0.875rem; color: var(--text-primary, #fff); }
.msg-time { font-size: 0.7rem; color: var(--text-muted, #999); margin-top: 0.25rem; }
.user-bubble { background: var(--accent); color: #fff; }
.chat-bubble-content { font-size: 0.875rem; line-height: 1.5; }
.jama-actions { display: flex; gap: 0.25rem; margin-top: 0.25rem; }

/* ── Modals & Popups ─────────────────────────────────────────── */
.modal-loading { display: flex; align-items: center; justify-content: center; padding: 3rem; color: var(--text-muted, #999); }
.popup { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.popup-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.popup-panel { position: relative; background: var(--bg-card, #161614); border-radius: 0.75rem; max-width: 32rem; width: 90%; max-height: 85vh; overflow-y: auto; box-shadow: 0 25px 50px rgba(0,0,0,0.5); }
.popup-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.popup-panel-title { font-size: 1.125rem; font-weight: 600; }
.popup-panel-body { padding: 1.5rem; }

/* ── Notifications ───────────────────────────────────────────── */
.notifications-empty { text-align: center; padding: 2rem; color: var(--text-muted, #999); font-size: 0.875rem; }

/* ── Build Status ────────────────────────────────────────────── */
.build-spinner-ring { display: inline-block; width: 1rem; height: 1rem; border: 2px solid var(--border-color); border-top-color: var(--accent); border-radius: 9999px; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-dots::after { content: '...'; animation: dots 1.5s steps(4, end) infinite; }
@keyframes dots { 0%, 20% { content: ''; } 40% { content: '.'; } 60% { content: '..'; } 80%, 100% { content: '...'; } }

/* ── EDI ─────────────────────────────────────────────────────── */
.edi-table { width: 100%; border-collapse: collapse; }
.edi-table th, .edi-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.875rem; }
.edi-table th { font-weight: 600; color: var(--text-muted, #999); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
.edi-table tr:hover td { background: rgba(123, 77, 255, 0.03); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-subtitle { font-size: 0.875rem; color: var(--text-muted, #999); margin-bottom: 1rem; }
.form-description { font-size: 0.8rem; color: var(--text-muted, #999); margin-top: 0.25rem; }
.field-hint { font-size: 0.75rem; color: var(--text-muted, #999); margin-top: 0.125rem; }

/* ── Stats ───────────────────────────────────────────────────── */
.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat-lbl { font-size: 0.75rem; color: var(--text-muted, #999); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }

/* ── Navigation ──────────────────────────────────────────────── */
.founder-nav-item { display: block; padding: 0.5rem 0.75rem; color: var(--text-muted, #999); text-decoration: none; font-size: 0.875rem; border-radius: 0.375rem; transition: background 0.15s; }
.founder-nav-item:hover { background: rgba(123, 77, 255, 0.08); color: var(--text-primary, #fff); }
.admin-nav-divider { height: 1px; background: var(--border-color); margin: 0.5rem 0.75rem; }

/* ── Quickstart ──────────────────────────────────────────────── */
.qs-platform-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.migration-upload { border: 2px dashed var(--border-color); border-radius: 0.5rem; padding: 2rem; text-align: center; }
.migration-result__errors { font-size: 0.8rem; color: #ef4444; margin-top: 0.5rem; }

/* ── Misc ────────────────────────────────────────────────────── */
.btn--md { padding: 0.5rem 1rem; font-size: 0.875rem; }
.active_filter { background: var(--accent); color: #fff; }

/* ── Block library base classes ─────────────────────────────── */
.block { position: relative; }
.block-contact { }
.block-features { }
.block-nav { }
.block-pricing { }

/* ── Blog ────────────────────────────────────────────────────── */
.blog-container { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }
.blog-header { padding: 2rem 0 1rem; }
.blog-index-subtitle { font-size: 1.125rem; color: var(--text-muted, #999); margin-top: 0.5rem; }
.blog-article-body { font-size: 1rem; line-height: 1.75; color: var(--text-primary, #e8e4df); }
.blog-article-body p { margin-bottom: 1.25rem; }
.blog-excerpt { font-size: 0.9rem; color: var(--text-muted, #999); line-height: 1.5; }
.blog-meta { font-size: 0.8rem; color: var(--text-muted, #666); display: flex; gap: 1rem; }

/* ── CTA section ─────────────────────────────────────────────── */
.bottom-cta { text-align: center; padding: 3rem 1.5rem; }
.bottom-cta-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.bottom-cta-text { font-size: 1rem; color: var(--text-muted, #999); margin-bottom: 1.5rem; }
.bottom-cta-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Button variants ─────────────────────────────────────────── */
.btn--ghost { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary, #fff); }
.btn--ghost:hover { background: rgba(255,255,255,0.05); }
.btn-spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: btn-spin 0.6s linear infinite; vertical-align: middle; margin-right: 0.5rem; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Misc used classes ───────────────────────────────────────── */
.body_class { }

/* ── Build Modal ─────────────────────────────────────────────── */
.build-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9998; }
.build-modal-content { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--bg-card, #161614); border-radius: 0.75rem; padding: 1.5rem; min-width: 320px; max-width: 90vw; z-index: 9999; box-shadow: 0 25px 50px rgba(0,0,0,0.5); }
.build-modal-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }
.build-modal-subtitle { font-size: 0.875rem; color: var(--text-muted, #999); margin-bottom: 1rem; }
.build-modal-steps { display: flex; flex-direction: column; gap: 0.75rem; }
.build-modal-step { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: 0.375rem; }
.build-modal-icon { width: 1.5rem; text-align: center; }
.build-modal-detail { font-size: 0.8rem; color: var(--text-muted, #999); }
.build-modal-eta { font-size: 0.8rem; color: var(--text-muted, #999); text-align: right; margin-top: 0.5rem; }
.build-modal-backdrop { position: fixed; inset: 0; z-index: 9997; }
.build-spinner { display: inline-block; width: 1rem; height: 1rem; border: 2px solid var(--border-color); border-top-color: var(--accent); border-radius: 50%; animation: build-spin 0.6s linear infinite; }
.build-spinner-ring-reverse { display: inline-block; width: 1rem; height: 1rem; border: 2px solid var(--border-color); border-bottom-color: var(--accent); border-radius: 50%; animation: build-spin 0.6s linear infinite reverse; }
@keyframes build-spin { to { transform: rotate(360deg); } }

/* ── Cart / Ecommerce ────────────────────────────────────────── */
.cart-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border-color); }
.cart-item-name { font-weight: 500; flex: 1; }
.cart-item-price { font-size: 0.875rem; color: var(--text-muted, #999); }
.cart-item-qty { display: flex; align-items: center; gap: 0.5rem; }
.cart-item-remove { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 0.875rem; }
.catalog-item { padding: 1rem; border: 1px solid var(--border-color); border-radius: 0.5rem; transition: border-color 0.15s; }
.catalog-item:hover { border-color: var(--accent); }

/* ── Chat Inbox ──────────────────────────────────────────────── */
.chat-inbox { flex: 1; overflow-y: auto; padding: 0.5rem; }
.chat-inbox-active { background: rgba(123, 77, 255, 0.08); border-radius: 0.375rem; }

/* Chat Inbox Extended */
.chat-inbox-body { flex: 1; overflow-y: auto; }
.chat-inbox-header { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.chat-inbox-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border-color); }
.chat-inbox-threads { list-style: none; padding: 0; margin: 0; }
.chat-inbox-thread { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem; cursor: pointer; }
.chat-inbox-count { font-size: 0.75rem; color: var(--accent); font-weight: 600; margin-left: auto; }
.chat-inbox-title-row { display: flex; align-items: center; gap: 0.5rem; }
.chat-inbox-project-name { font-size: 0.7rem; color: var(--text-muted, #999); }
.chat-inbox-last-msg { font-size: 0.8rem; color: var(--text-muted, #999); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-inbox-toggle { background: none; border: none; color: var(--text-muted, #999); cursor: pointer; font-size: 0.875rem; padding: 0.25rem; }
.chat-inbox-view-all { display: block; text-align: center; padding: 0.5rem; font-size: 0.8rem; color: var(--accent); text-decoration: none; }
.checklist { display: flex; flex-direction: column; gap: 0.5rem; }
.check-input { margin-right: 0.5rem; }
.check-label { font-size: 0.875rem; cursor: pointer; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.compliance_trend { font-size: 0.8rem; padding: 0.125rem 0.375rem; border-radius: 0.25rem; }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }
.confirm-message { font-size: 0.9rem; line-height: 1.5; margin-bottom: 0.5rem; }
.confirm_variant { font-weight: 500; }

/* Misc end-of-audit classes */
.count { font-variant-numeric: tabular-nums; }
.dot { width: 0.375rem; height: 0.375rem; border-radius: 9999px; display: inline-block; }
.dots { display: flex; gap: 0.25rem; }
.field-group { margin-bottom: 1rem; }
.field-group-legend { font-weight: 500; font-size: 0.875rem; margin-bottom: 0.5rem; }
.field--check { display: flex; align-items: center; gap: 0.5rem; }
.field-input--textarea { min-height: 6rem; resize: vertical; }
.form-error { font-size: 0.8rem; color: #ef4444; margin-top: 0.125rem; }
.form-link { color: var(--accent); text-decoration: none; }
.form-links { display: flex; gap: 0.5rem; justify-content: flex-end; }
.form-wrapper { max-width: 24rem; margin: 0 auto; padding: 1rem; }
.footer-copy { font-size: 0.8rem; color: var(--text-muted, #999); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.footer-social { display: flex; gap: 0.5rem; }
.founder-footer { text-align: center; padding: 2rem; font-size: 0.875rem; }
.founder-hero { padding: 4rem 1.5rem; text-align: center; }
.founder-mission { max-width: 36rem; margin: 0 auto; font-size: 1rem; line-height: 1.75; }

.founder-nav { display: flex; align-items: center; gap: 1.5rem; padding: 1rem 1.5rem; }
.founder-nav-logo { font-weight: 700; font-size: 1.125rem; }
.founder-nav-mark { display: inline-flex; align-items: center; gap: 0.375rem; }
.founder-nav-text { font-size: 0.875rem; color: var(--text-muted, #999); }
.founder-page { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }
.founder-quote { font-style: italic; font-size: 1.125rem; line-height: 1.75; color: var(--text-muted); border-left: 3px solid var(--accent); padding-left: 1rem; margin: 1.5rem 0; }
.hero-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; max-width: 48rem; margin: 0 auto; }
.hero-text { font-size: 1.125rem; color: var(--text-muted, #999); line-height: 1.6; max-width: 32rem; }
.hero-visual { width: 100%; max-width: 48rem; border-radius: 0.75rem; overflow: hidden; }
.hm-item-wrapper { padding: 0.5rem 0; }
.heading-aeon { font-family: monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
