/* ============================================
   BeLive Microdrama Engine — Design System
   ============================================ */

:root {
  /* Core Palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-input: #1a1a26;
  --bg-sidebar: #0e0e16;
  --bg-topbar: #0e0e16;
  --bg-overlay: rgba(0,0,0,0.6);
  --bg-modal: #16161f;
  --bg-toast: #1e1e2e;

  /* Accent Colors */
  --gold: #d4a853;
  --gold-light: #e8c77b;
  --gold-dark: #b8913a;
  --purple: #7c3aed;
  --purple-light: #9561f5;
  --purple-dark: #5b21b6;

  /* Text */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #d4a853;

  /* Semantic */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --info-bg: rgba(59,130,246,0.12);
  --warning-bg: rgba(245,158,11,0.12);
  --error-bg: rgba(239,68,68,0.12);
  --success-bg: rgba(34,197,94,0.12);

  /* Borders */
  --border: #2a2a3a;
  --border-gold: rgba(212,168,83,0.3);
  --border-purple: rgba(124,58,237,0.3);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-gold: 0 4px 24px rgba(212,168,83,0.15);
  --shadow-purple: 0 4px 24px rgba(124,58,237,0.15);

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

  /* Radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed: 0px;
  --topbar-height: 56px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

img { max-width: 100%; }

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================
   Layout
   ============================================ */
#app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-logo {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--bg-primary);
}

.sidebar-logo .logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo .logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: -2px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--sp-4) 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(212,168,83,0.05);
}

.nav-item.active {
  color: var(--gold);
  background: rgba(212,168,83,0.08);
  border-left-color: var(--gold);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--purple);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: var(--sp-2);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
}

/* Page Container */
.page {
  flex: 1;
  padding: var(--sp-8);
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  margin-bottom: var(--sp-8);
}

.page-header h1 {
  margin-bottom: var(--sp-2);
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
}

.card-gold {
  border-color: var(--border-gold);
}

.card-purple {
  border-color: var(--border-purple);
}

/* ============================================
   Home Screen
   ============================================ */
.home-hero {
  text-align: center;
  padding: var(--sp-12) 0 var(--sp-8);
}

.home-hero .brand {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--sp-2);
}

.home-hero .tagline {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 520px;
  margin: 0 auto;
}

.home-hero .tagline em {
  color: var(--gold);
  font-style: normal;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  max-width: 800px;
  margin: var(--sp-8) auto 0;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-md);
}

.action-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.action-card .action-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-4);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.action-card.gold .action-icon {
  background: rgba(212,168,83,0.12);
  color: var(--gold);
}

.action-card.purple .action-icon {
  background: rgba(124,58,237,0.12);
  color: var(--purple-light);
}

.action-card h3 {
  font-size: 1.2rem;
  margin-bottom: var(--sp-2);
}

.action-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--sp-5);
  line-height: 1.5;
}

.home-features {
  display: flex;
  justify-content: center;
  gap: var(--sp-8);
  margin-top: var(--sp-12);
  flex-wrap: wrap;
}

.feature-item {
  text-align: center;
  max-width: 200px;
}

.feature-item .feature-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}

.feature-item .feature-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--bg-primary);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
}

.btn-purple {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: white;
  border-color: var(--purple);
}

.btn-purple:hover {
  background: linear-gradient(135deg, var(--purple-light), var(--purple));
  box-shadow: var(--shadow-purple);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn-outline:hover {
  background: rgba(212,168,83,0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.btn-sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: 0.8rem;
}

.btn-lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================
   Wizard / Steps
   ============================================ */
.wizard-container {
  max-width: 900px;
  margin: 0 auto;
}

.wizard-steps {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-8);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
}

.wizard-step-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.wizard-step-indicator:hover {
  color: var(--text-primary);
}

.wizard-step-indicator.active {
  color: var(--gold);
  background: rgba(212,168,83,0.1);
  border-color: var(--gold);
}

.wizard-step-indicator.completed {
  color: var(--success);
  background: var(--success-bg);
  border-color: rgba(34,197,94,0.3);
}

.wizard-step-indicator .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-input);
}

.wizard-step-indicator.active .step-num {
  background: var(--gold);
  color: var(--bg-primary);
}

.wizard-step-indicator.completed .step-num {
  background: var(--success);
  color: white;
}

.wizard-panel {
  display: none;
}

.wizard-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
  margin-bottom: var(--sp-5);
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.form-group .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,83,0.15);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

/* Radio / Checkbox */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.radio-item:hover,
.checkbox-item:hover {
  border-color: var(--gold);
  background: rgba(212,168,83,0.04);
}

.radio-item.selected,
.checkbox-item.selected {
  border-color: var(--gold);
  background: rgba(212,168,83,0.08);
}

.radio-item input,
.checkbox-item input {
  margin-top: 3px;
  accent-color: var(--gold);
}

/* Checkbox grid for multi-select fields */
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  user-select: none;
}
.checkbox-chip:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}
.checkbox-chip input {
  display: none;
}
.checkbox-chip input:checked + span {
  color: var(--gold);
  font-weight: 600;
}
.checkbox-chip:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201,168,76,0.12);
  color: var(--gold);
}

.radio-item .radio-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.radio-item .radio-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================
   File Upload
   ============================================ */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: var(--sp-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.file-upload-zone:hover,
.file-upload-zone.dragover {
  border-color: var(--gold);
  background: rgba(212,168,83,0.04);
}

.file-upload-zone .upload-icon {
  font-size: 2rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.file-upload-zone .upload-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.file-upload-zone .upload-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: var(--sp-2);
}

.file-upload-zone input[type="file"] {
  display: none;
}

/* ============================================
   Engine Cards
   ============================================ */
.engine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}

.engine-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  cursor: pointer;
  transition: all var(--transition-slow);
  position: relative;
}

.engine-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-purple);
}

.engine-card.selected {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  background: rgba(212,168,83,0.05);
}

.engine-card .engine-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: var(--sp-3);
  background: rgba(124,58,237,0.12);
  color: var(--purple-light);
}

.engine-card.selected .engine-icon {
  background: rgba(212,168,83,0.12);
  color: var(--gold);
}

.engine-card .engine-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--sp-1);
}

.engine-card .engine-full-name {
  font-size: 0.75rem;
  color: var(--purple-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}

.engine-card.selected .engine-full-name {
  color: var(--gold);
}

.engine-card .engine-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.engine-card .engine-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-3);
}

.engine-card .engine-keywords span {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(124,58,237,0.1);
  color: var(--purple-light);
}

.engine-card.selected .engine-keywords span {
  background: rgba(212,168,83,0.1);
  color: var(--gold);
}

.engine-card .check-badge {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg-primary);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.engine-card.selected .check-badge {
  display: flex;
}

/* Tooltip */
.tooltip-trigger {
  position: relative;
  cursor: help;
}

.tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  white-space: normal;
  width: 240px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  box-shadow: var(--shadow-lg);
  line-height: 1.4;
}

.tooltip-trigger:hover::after {
  opacity: 1;
}

/* ============================================
   Review Summary
   ============================================ */
.review-section {
  margin-bottom: var(--sp-5);
}

.review-section h4 {
  color: var(--gold);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.review-item {
  padding: var(--sp-3);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.review-item .review-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.review-item .review-value {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ============================================
   Draft Viewer
   ============================================ */
.draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.draft-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  background: var(--purple);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.draft-type-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  background: rgba(212,168,83,0.12);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
}

.draft-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* Pipeline Stage Indicator */
.pipeline-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--sp-4) var(--sp-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}

.pipeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  position: relative;
}

.pipeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.pipeline-stage.completed .pipeline-dot {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.pipeline-stage.current .pipeline-dot {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0a0f;
  box-shadow: 0 0 0 4px rgba(212, 168, 83, 0.25), var(--shadow-gold);
}

.pipeline-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pipeline-stage.completed .pipeline-label {
  color: var(--success);
}

.pipeline-stage.current .pipeline-label {
  color: var(--gold);
}

.pipeline-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  min-width: 40px;
  max-width: 100px;
  margin: 0 var(--sp-1);
  margin-bottom: 18px; /* Align with dot center */
}

.pipeline-connector.active {
  background: var(--gold);
}

.pipeline-connector.completed {
  background: var(--success);
}

.draft-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-8);
  line-height: 1.8;
  font-size: 0.95rem;
}

.draft-content h1 {
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: var(--sp-4);
}

.draft-content h2 {
  font-size: 1.25rem;
  color: var(--gold-light);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.draft-content h3 {
  font-size: 1.1rem;
  color: var(--purple-light);
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-2);
}

.draft-content p {
  margin-bottom: var(--sp-3);
  color: var(--text-primary);
}

.draft-content ul,
.draft-content ol {
  margin-left: var(--sp-5);
  margin-bottom: var(--sp-3);
}

.draft-content li {
  margin-bottom: var(--sp-2);
}

.draft-content strong {
  color: var(--gold);
}

.draft-content blockquote {
  border-left: 3px solid var(--purple);
  padding-left: var(--sp-4);
  margin: var(--sp-4) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* ============================================
   Evaluation / Scorecard
   ============================================ */
.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.scorecard-dim {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
}

.scorecard-dim .dim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.scorecard-dim .dim-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.scorecard-dim .dim-score {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold);
}

.score-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--sp-3);
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

.score-bar-fill.high { background: var(--success); }
.score-bar-fill.medium { background: var(--warning); }
.score-bar-fill.low { background: var(--error); }

.scorecard-dim .dim-rationale {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--sp-2);
}

.scorecard-dim .dim-risk {
  font-size: 0.78rem;
  color: var(--error);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.scorecard-dim .dim-fix {
  font-size: 0.78rem;
  color: var(--success);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

/* Benchmark context styles */
.scorecard-dim .dim-benchmarks {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.scorecard-dim .bm-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.scorecard-dim .bm-min { color: #f87171; }
.scorecard-dim .bm-avg { color: #fbbf24; }
.scorecard-dim .bm-top { color: #34d399; }

.scorecard-dim .bm-position {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
}

.scorecard-dim .bm-below { color: #f87171; background: rgba(248,113,113,0.12); }
.scorecard-dim .bm-near { color: #fbbf24; background: rgba(251,191,36,0.12); }
.scorecard-dim .bm-above { color: #34d399; background: rgba(52,211,153,0.12); }
.scorecard-dim .bm-top { color: #a78bfa; background: rgba(167,139,250,0.12); }

.scorecard-dim .dim-bm-context {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--sp-2);
  padding-left: var(--sp-2);
  border-left: 2px solid var(--border);
}

.total-score-card {
  text-align: center;
  padding: var(--sp-8);
  background: linear-gradient(135deg, rgba(212,168,83,0.08), rgba(124,58,237,0.08));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-8);
}

.total-score-card .total-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-2);
}

.total-score-card .total-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.total-score-card .total-max {
  font-size: 1rem;
  color: var(--text-muted);
}

.verdict-badge {
  display: inline-flex;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: var(--sp-3);
}

.verdict-badge.green {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.3);
}

.verdict-badge.yellow {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.3);
}

.verdict-badge.red {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(239,68,68,0.3);
}

.strengths-list,
.issues-list {
  margin-bottom: var(--sp-6);
}

.strengths-list h3 {
  color: var(--success);
  font-size: 1rem;
  margin-bottom: var(--sp-3);
}

.issues-list h3 {
  color: var(--error);
  font-size: 1rem;
  margin-bottom: var(--sp-3);
}

.strength-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--success-bg);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-2);
  font-size: 0.9rem;
}

.issue-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-2);
  font-size: 0.9rem;
}

.issue-item.critical {
  background: var(--error-bg);
  border: 1px solid rgba(239,68,68,0.2);
}

.issue-item.warning {
  background: var(--warning-bg);
  border: 1px solid rgba(245,158,11,0.2);
}

.issue-item.info {
  background: var(--info-bg);
  border: 1px solid rgba(59,130,246,0.2);
}

.issue-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* Radar Chart */
.radar-container {
  display: flex;
  justify-content: center;
  margin: var(--sp-6) 0;
}

.radar-container svg {
  max-width: 400px;
  width: 100%;
}

/* ============================================
   Issue Resolver
   ============================================ */
.issue-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.issue-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.issue-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.issue-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.issue-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: top;
}

.issue-table tr {
  cursor: pointer;
  transition: background var(--transition);
}

.issue-table tbody tr:hover {
  background: rgba(212,168,83,0.04);
}

.issue-expanded {
  display: none;
  background: var(--bg-input);
}

.issue-expanded.open {
  display: table-row;
}

.issue-expanded td {
  padding: var(--sp-5);
  border-bottom: 2px solid var(--gold);
}

.severity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: var(--sp-2);
}

.severity-dot.critical { background: var(--error); }
.severity-dot.warning { background: var(--warning); }
.severity-dot.info { background: var(--info); }

.resolve-mode-select {
  margin: var(--sp-4) 0;
}

.comparison-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.comparison-pane {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.comparison-pane.before {
  border-color: rgba(239,68,68,0.3);
}

.comparison-pane.after {
  border-color: rgba(34,197,94,0.3);
}

.comparison-pane .pane-header {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.comparison-pane.before .pane-header { color: var(--error); }
.comparison-pane.after .pane-header { color: var(--success); }

/* ─── Issue Resolution Diff View ─────────────────────────────────────────── */

.diff-context {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.diff-context-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: var(--sp-3);
}

.diff-context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-3);
}

.diff-ctx-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.diff-ctx-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.diff-ctx-value {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.diff-context-explanation {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

.diff-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.diff-legend {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.diff-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.diff-legend-old { background: var(--error); opacity: 0.55; }
.diff-legend-new { background: var(--success); opacity: 0.55; }
.diff-legend-same { background: var(--text-muted); opacity: 0.25; }

.diff-body {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
}

.diff-row {
  display: flex;
  align-items: flex-start;
  padding: 2px 0;
  min-height: 1.6em;
}

.diff-row .diff-ln {
  display: inline-block;
  min-width: 36px;
  text-align: right;
  padding: 0 var(--sp-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  user-select: none;
  flex-shrink: 0;
}

.diff-row .diff-old,
.diff-row .diff-new {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  font-weight: 700;
  flex-shrink: 0;
}

.diff-row .diff-text {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.diff-row.diff-unchanged .diff-text {
  color: var(--text-secondary);
}

.diff-row.diff-removed {
  background: rgba(239,68,68,0.10);
}
.diff-row.diff-removed .diff-old {
  color: var(--error);
}
.diff-row.diff-removed .diff-text {
  color: var(--error);
  text-decoration: line-through;
  text-decoration-color: rgba(239,68,68,0.35);
}

.diff-row.diff-added {
  background: rgba(34,197,94,0.10);
}
.diff-row.diff-added .diff-new {
  color: var(--success);
}
.diff-row.diff-added .diff-text {
  color: var(--success);
}

/* ============================================
   Draft Comparison
   ============================================ */
.compare-selector {
  display: flex;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.compare-selector .form-select {
  flex: 1;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.compare-version {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
}

.compare-version.changed {
  border-color: var(--gold);
}

.score-change {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-6);
  justify-content: center;
}

.score-change .score-arrow {
  font-size: 1.2rem;
}

.score-change .score-up { color: var(--success); }
.score-change .score-down { color: var(--error); }
.score-change .score-same { color: var(--text-muted); }

/* ============================================
   Export View
   ============================================ */
.export-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.export-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.export-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.export-card .export-icon {
  font-size: 2rem;
  margin-bottom: var(--sp-3);
}

.export-card .export-label {
  font-weight: 600;
  margin-bottom: var(--sp-1);
}

.export-card .export-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.export-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-6);
}

.export-preview h3 {
  margin-bottom: var(--sp-4);
}

.doc-structure {
  font-size: 0.85rem;
}

.doc-structure .doc-section {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.doc-structure .doc-section:last-child {
  border-bottom: none;
}

/* ============================================
   Project Dashboard
   ============================================ */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  text-align: center;
}

.stat-card .stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.project-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.project-row:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.project-row .project-info {
  flex: 1;
}

.project-row .project-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.project-row .project-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-row .project-actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.btn-danger {
  background: var(--error, #ef4444);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.status-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.idea { background: rgba(59,130,246,0.12); color: var(--info); }
.status-badge.draft { background: var(--warning-bg); color: var(--warning); }
.status-badge.review { background: rgba(124,58,237,0.12); color: var(--purple-light); }
.status-badge.approved { background: var(--success-bg); color: var(--success); }
.status-badge.hold { background: var(--error-bg); color: var(--error); }

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + var(--sp-4));
  right: var(--sp-4);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-toast);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  max-width: 400px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--info); }

.toast .toast-icon {
  font-size: 1.1rem;
}

.toast .toast-msg {
  flex: 1;
}

.toast .toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 100%;
  animation: fadeIn 0.2s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.modal-body {
  padding: var(--sp-6);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--border);
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--sp-4);
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--sp-4);
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto var(--sp-5);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: block;
  }

  .page {
    padding: var(--sp-4);
  }

  .home-actions {
    grid-template-columns: 1fr;
  }

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

  .engine-grid {
    grid-template-columns: 1fr;
  }

  .scorecard-grid {
    grid-template-columns: 1fr;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .comparison-view,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .export-options {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }

  .draft-actions {
    width: 100%;
  }

  .draft-actions .btn {
    flex: 1;
  }

  .wizard-steps {
    flex-wrap: nowrap;
  }

  .compare-selector {
    flex-direction: column;
  }

  .home-features {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .home-hero .brand {
    font-size: 1.8rem;
  }

  .export-options {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Sidebar Overlay (Mobile)
   ============================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================
   Knowledge Base placeholder
   ============================================ */
.kb-placeholder {
  text-align: center;
  padding: var(--sp-12);
  color: var(--text-muted);
}

.kb-placeholder .kb-icon {
  font-size: 3rem;
  margin-bottom: var(--sp-4);
  opacity: 0.4;
}

/* ============================================
   Settings placeholder
   ============================================ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.setting-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
}

.setting-card h4 {
  margin-bottom: var(--sp-3);
  color: var(--gold);
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Badge / Tag system
   ============================================ */
.tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag-gold {
  background: rgba(212,168,83,0.12);
  color: var(--gold);
  border: 1px solid rgba(212,168,83,0.2);
}

.tag-purple {
  background: rgba(124,58,237,0.12);
  color: var(--purple-light);
  border: 1px solid rgba(124,58,237,0.2);
}

/* ============================================
   Evaluate Flow
   ============================================ */
.eval-upload-zone {
  margin-bottom: var(--sp-6);
}

.eval-step-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.eval-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.eval-step-header h3 {
  font-size: 1rem;
}

/* ============================================
   Welcome Banner (Onboarding)
   ============================================ */
.welcome-banner {
  margin-bottom: var(--sp-8);
}

.welcome-banner-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: var(--sp-10) var(--sp-8);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.welcome-banner-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light), var(--gold), var(--gold-dark));
}

.welcome-badge {
  display: inline-block;
  background: rgba(212,168,83,0.12);
  color: var(--gold);
  border: 1px solid rgba(212,168,83,0.25);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--sp-3);
  letter-spacing: -0.02em;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto var(--sp-8);
  line-height: 1.6;
}

.welcome-steps {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 560px;
  margin: 0 auto var(--sp-8);
  text-align: left;
}

.welcome-step {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color var(--transition);
}

.welcome-step:hover {
  border-color: var(--border-gold);
}

.welcome-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.welcome-step-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.welcome-step-text strong {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.welcome-step-text span {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.welcome-actions {
  display: flex;
  gap: var(--sp-4);
  justify-content: center;
  flex-wrap: wrap;
}
