/* ─── JobMatch AI – Core Styles ─────────────────────────────────────────────── */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #10b981;
  --secondary-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  --score-high: #10b981;
  --score-mid: #f59e0b;
  --score-low: #ef4444;
  --sidebar-w: 240px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Layout ─────────────────────────────────────────────────────────────────── */

#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* When sidebar is hidden (auth / onboarding), remove the left margin */
.sidebar.hidden ~ .main-content {
  margin-left: 0;
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────────── */

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-brand .logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px; font-weight: 700;
}
.sidebar-brand .brand-name { font-size: 15px; font-weight: 700; color: var(--text); }
.sidebar-brand .brand-sub { font-size: 11px; color: var(--text-3); }

.sidebar-nav { padding: 12px 8px; flex: 1; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  padding: 8px 8px 4px; margin-top: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  cursor: pointer; text-decoration: none;
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item .nav-icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: var(--primary); color: white;
  font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: 20px; min-width: 18px; text-align: center;
}
.nav-badge.green { background: var(--secondary); }

.sidebar-footer {
  padding: 12px 8px; border-top: 1px solid var(--border);
}
.profile-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s;
}
.profile-chip:hover { background: var(--surface-2); }
.profile-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 12.5px; font-weight: 600; truncate; }
.profile-title { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Top Bar ──────────────────────────────────────────────────────────────────── */

.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 24px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 700; flex: 1; }
.topbar-sub { font-size: 12px; color: var(--text-3); }

/* ─── Content Area ─────────────────────────────────────────────────────────────── */

.content-area { flex: 1; padding: 24px; max-width: 960px; width: 100%; margin: 0 auto; }

/* ─── Screens ─────────────────────────────────────────────────────────────────── */

.screen { display: none; }
.screen.active { display: block; }

/* ─── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 16px; }

/* ─── Match Score Badge ────────────────────────────────────────────────────────── */

.score-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; border: 2px solid;
}
.score-badge.score-high { color: var(--score-high); border-color: var(--score-high); background: #ecfdf5; }
.score-badge.score-mid { color: var(--warning); border-color: var(--warning); background: var(--warning-light); }
.score-badge.score-low { color: var(--score-low); border-color: var(--score-low); background: var(--danger-light); }

.score-large {
  font-size: 40px; font-weight: 800; line-height: 1;
}
.score-large.score-high { color: var(--score-high); }
.score-large.score-mid { color: var(--warning); }
.score-large.score-low { color: var(--score-low); }

/* ─── Job Card ────────────────────────────────────────────────────────────────── */

.job-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 16px 20px; cursor: pointer;
  transition: all 0.2s ease; position: relative;
  display: flex; flex-direction: column; gap: 10px;
}
.job-card:hover { box-shadow: var(--shadow-md); border-color: #c7d2fe; transform: translateY(-1px); }
.job-card.swiped-interested { border-color: var(--secondary); background: #f0fdf4; }
.job-card.swiped-not-interested { opacity: 0.45; }
.job-card.swiped-maybe { border-color: var(--warning); }

.job-card-header { display: flex; align-items: flex-start; gap: 12px; }
.company-logo {
  width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--primary); flex-shrink: 0;
  font-family: 'Georgia', serif;
}
.job-meta { flex: 1; min-width: 0; }
.job-title { font-size: 15px; font-weight: 700; color: var(--text); }
.job-company { font-size: 13px; color: var(--text-2); }
.job-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; padding: 3px 8px;
  border-radius: 6px; background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.tag.remote { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }
.tag.hybrid { background: #faf5ff; color: #7c3aed; border-color: #ddd6fe; }
.tag.onsite { background: var(--surface-2); }
.tag.comp { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.tag.comp-missing { background: var(--warning-light); color: #92400e; border-color: #fcd34d; }
.tag.new { background: var(--primary-light); color: var(--primary); border-color: #a5b4fc; }
.tag.explore { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }

.job-summary {
  font-size: 12.5px; color: var(--text-2); line-height: 1.45;
  padding: 8px 10px; background: var(--surface-2); border-radius: 8px;
  border-left: 3px solid var(--primary-light);
}
.job-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.job-source { font-size: 11px; color: var(--text-3); }
.job-date { font-size: 11px; color: var(--text-3); }

/* ─── Swipe Actions ───────────────────────────────────────────────────────────── */

.swipe-actions {
  display: flex; gap: 8px; margin-top: 12px;
}
.btn-swipe {
  flex: 1; padding: 10px 8px; border-radius: 10px; border: 2px solid;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-swipe.interested {
  border-color: var(--secondary); color: var(--secondary); background: white;
}
.btn-swipe.interested:hover { background: var(--secondary); color: white; }
.btn-swipe.not-interested {
  border-color: var(--danger); color: var(--danger); background: white;
}
.btn-swipe.not-interested:hover { background: var(--danger); color: white; }
.btn-swipe.maybe {
  border-color: var(--warning); color: var(--warning); background: white;
}
.btn-swipe.maybe:hover { background: var(--warning); color: white; }

/* ─── Feedback Tags ────────────────────────────────────────────────────────────── */

.feedback-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px; background: var(--surface-2); border-radius: 10px;
  margin-top: 8px;
}
.feedback-tag {
  padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border);
  background: white; font-size: 12px; cursor: pointer;
  transition: all 0.15s; color: var(--text-2);
}
.feedback-tag:hover, .feedback-tag.selected {
  background: var(--primary); color: white; border-color: var(--primary);
}

/* ─── Digest Bands ────────────────────────────────────────────────────────────── */

.digest-header {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: var(--radius); padding: 24px; color: white; margin-bottom: 24px;
}
.digest-header h1 { font-size: 22px; font-weight: 800; }
.digest-header .date { font-size: 13px; opacity: 0.8; margin-bottom: 12px; }
.digest-bands-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.digest-band-chip {
  background: rgba(255,255,255,0.15); border-radius: 10px;
  padding: 10px 16px; cursor: pointer; transition: background 0.15s;
  backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.2);
}
.digest-band-chip:hover { background: rgba(255,255,255,0.25); }
.digest-band-chip .band-count { font-size: 26px; font-weight: 800; }
.digest-band-chip .band-label { font-size: 11px; opacity: 0.85; }
.digest-band-chip .band-range { font-size: 10px; opacity: 0.65; }

/* ─── Band Section ─────────────────────────────────────────────────────────────── */

.band-section { margin-bottom: 32px; }
.band-section-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.band-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.band-dot.high { background: var(--score-high); }
.band-dot.mid { background: var(--warning); }
.band-dot.low { background: #a78bfa; }
.band-dot.explore { background: #f97316; }
.band-title { font-size: 15px; font-weight: 700; }
.band-subtitle { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* ─── Job Detail ─────────────────────────────────────────────────────────────── */

.job-detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary); font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 6px 0; margin-bottom: 16px;
  border: none; background: none;
}
.job-detail-back:hover { text-decoration: underline; }

.job-detail-hero {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 16px;
}
.job-detail-hero .job-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.job-detail-hero .job-company { font-size: 14px; color: var(--text-2); margin-bottom: 12px; }

.score-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; background: var(--surface-2); border-radius: 10px;
  margin: 16px 0;
}
.subscore-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
  margin-top: 12px;
}
.subscore-item {
  background: var(--surface-2); border-radius: 8px; padding: 8px;
  text-align: center;
}
.subscore-item .subscore-val { font-size: 18px; font-weight: 700; }
.subscore-item .subscore-label { font-size: 10px; color: var(--text-3); margin-top: 2px; }

.description-block {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px; margin-bottom: 16px;
}
.description-block h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.description-block p, .description-block .body-text {
  font-size: 13.5px; color: var(--text-2); line-height: 1.65; white-space: pre-line;
}

.req-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: var(--primary-light); color: var(--primary); margin: 3px;
}

.action-bar {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px 20px;
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s ease; text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #059669; }
.btn-outline {
  background: white; border: 1.5px solid var(--border); color: var(--text-2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-loading::after { content: ''; width: 12px; height: 12px; border: 2px solid white; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; margin-left: 4px; }

/* ─── Onboarding ─────────────────────────────────────────────────────────────── */

.onboarding-container {
  max-width: 680px; margin: 0 auto; padding: 32px 24px;
}
.onboarding-progress {
  display: flex; gap: 6px; margin-bottom: 32px;
}
.progress-step {
  height: 4px; flex: 1; border-radius: 4px; background: var(--border);
  transition: background 0.3s;
}
.progress-step.done { background: var(--primary); }
.progress-step.active { background: var(--primary-light); }

.step-card {
  background: var(--surface); border-radius: 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  padding: 32px;
}
.step-icon { font-size: 36px; margin-bottom: 12px; }
.step-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.step-desc { color: var(--text-2); font-size: 14px; margin-bottom: 24px; line-height: 1.55; }

/* ─── Form Elements ──────────────────────────────────────────────────────────── */

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 13px; border-radius: 9px;
  border: 1.5px solid var(--border); font-size: 13.5px;
  background: var(--surface); color: var(--text);
  transition: border-color 0.15s; outline: none; font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { min-height: 100px; resize: vertical; line-height: 1.55; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: 12px;
  padding: 40px 24px; text-align: center; cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary); background: var(--primary-light);
}
.upload-zone .upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-zone .upload-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.upload-zone .upload-sub { font-size: 12px; color: var(--text-3); }

/* ─── Tag Pills Input ─────────────────────────────────────────────────────────── */

.pill-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: var(--primary-light); color: var(--primary);
  cursor: pointer; border: 1px solid #a5b4fc;
}
.pill.selected { background: var(--primary); color: white; border-color: var(--primary); }
.pill.removable { padding-right: 6px; }
.pill-remove { font-size: 14px; line-height: 1; margin-left: 2px; opacity: 0.7; }

/* ─── Job Bank ────────────────────────────────────────────────────────────────── */

.bank-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
  align-items: center;
}
.filter-btn {
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: white; font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; color: var(--text-2);
}
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.filter-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

.status-select {
  padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1.5px solid; cursor: pointer; outline: none; background: white;
}
.status-saved { border-color: #c7d2fe; color: var(--primary); }
.status-applied { border-color: #a7f3d0; color: #059669; }
.status-interviewing { border-color: #fcd34d; color: #d97706; }
.status-offer { border-color: #6ee7b7; color: #047857; }
.status-archived { border-color: var(--border); color: var(--text-3); }
.status-rejected { border-color: #fca5a5; color: var(--danger); }

.bank-job-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px 20px;
  cursor: pointer; transition: all 0.2s;
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  align-items: center; margin-bottom: 10px;
}
.bank-job-card:hover { box-shadow: var(--shadow-md); border-color: #c7d2fe; }

/* ─── AI Feature Cards ────────────────────────────────────────────────────────── */

.ai-card {
  background: linear-gradient(135deg, #f0f4ff, #faf5ff);
  border: 1px solid #c7d2fe; border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 14px;
}
.ai-card .ai-icon { font-size: 28px; flex-shrink: 0; }
.ai-card .ai-title { font-size: 14px; font-weight: 700; }
.ai-card .ai-desc { font-size: 12.5px; color: var(--text-2); }
.ai-card .ai-actions { margin-left: auto; display: flex; gap: 8px; }

.ai-output {
  background: var(--surface-2); border-radius: 10px;
  padding: 16px; font-size: 13px; line-height: 1.65; white-space: pre-line;
  border: 1px solid var(--border); margin-top: 12px; color: var(--text);
  max-height: 400px; overflow-y: auto;
}

/* ─── Pipeline status row ─────────────────────────────────────────────────────── */

.pipeline-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 12px; background: var(--surface-2); border-radius: 10px;
  margin-bottom: 16px; align-items: center;
}
.pipeline-step {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-3);
}
.pipeline-step.active { color: var(--primary); font-weight: 600; }
.pipeline-step.done { color: var(--secondary); }
.pipeline-arrow { color: var(--text-3); font-size: 12px; }

/* ─── Stats Dashboard ─────────────────────────────────────────────────────────── */

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  text-align: center;
}
.stat-card .stat-val { font-size: 30px; font-weight: 800; color: var(--primary); }
.stat-card .stat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ─── Notification Banner ──────────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--text); color: white; padding: 12px 18px;
  border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); z-index: 9999;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(0); opacity: 1;
  transition: all 0.3s ease;
  max-width: 360px;
}
.toast.hide { transform: translateY(20px); opacity: 0; }
.toast.success { background: var(--secondary); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* ─── Modal ────────────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.25s ease;
}
.modal-header {
  padding: 20px 24px 0; display: flex; align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--surface-2); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 16px 24px 24px; }

/* ─── Preference Weights Viz ───────────────────────────────────────────────────── */

.weight-bar-item { margin-bottom: 10px; }
.weight-bar-label {
  display: flex; justify-content: space-between;
  font-size: 12px; margin-bottom: 4px;
}
.weight-bar-track {
  height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden;
}
.weight-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), #8b5cf6);
  border-radius: 4px; transition: width 0.5s ease;
}

/* ─── AB Question Card ─────────────────────────────────────────────────────────── */

.ab-card {
  background: linear-gradient(135deg, #fff, #f8f4ff);
  border: 1px solid #e0d9ff; border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
.ab-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.ab-option {
  padding: 12px; border: 2px solid var(--border); border-radius: 10px;
  cursor: pointer; text-align: center; font-size: 13px; font-weight: 600;
  transition: all 0.2s; background: white;
}
.ab-option:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.ab-option.selected { border-color: var(--primary); background: var(--primary); color: white; }

/* ─── Empty States ─────────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center; padding: 60px 20px;
}
.empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-desc { font-size: 13px; color: var(--text-3); max-width: 320px; margin: 0 auto 20px; }

/* ─── Loading ──────────────────────────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #e8edf2 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px;
}
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 40px auto;
}

/* ─── Comp Display ─────────────────────────────────────────────────────────────── */

.comp-display {
  background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px;
  padding: 10px 14px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #065f46;
}
.comp-unknown {
  background: var(--warning-light); border-color: #fcd34d; color: #92400e;
}

/* ─── Reminder Badge ───────────────────────────────────────────────────────────── */

.reminder-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d;
  border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 600;
}

/* ─── Responsive ────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .mobile-menu-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--border);
    background: white; cursor: pointer; font-size: 16px;
  }
  .form-row { grid-template-columns: 1fr; }
  .digest-bands-row { gap: 8px; }
  .ab-options { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 769px) { .mobile-menu-btn { display: none; } }

/* ─── Animations ─────────────────────────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn 0.3s ease both; }
.slide-in { animation: slideIn 0.3s ease both; }

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c1c9d4; }

/* ─── Misc ──────────────────────────────────────────────────────────────────── */

.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.text-muted { color: var(--text-3); }
.text-small { font-size: 12px; }
.bold { font-weight: 700; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

.source-link {
  color: var(--primary); text-decoration: none; font-weight: 500;
}
.source-link:hover { text-decoration: underline; }

.outreach-entry {
  background: var(--surface-2); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; border-left: 3px solid var(--primary-light);
}
.outreach-entry .entry-meta { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.outreach-entry .entry-content { font-size: 13px; white-space: pre-line; }

.change-item {
  display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border);
}
.change-badge {
  padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; flex-shrink: 0; height: fit-content; margin-top: 2px;
}
.change-badge.reorder { background: #dbeafe; color: #1d4ed8; }
.change-badge.keyword_add { background: var(--secondary-light); color: #065f46; }
.change-badge.rephrase { background: #faf5ff; color: #6d28d9; }
.change-badge.highlight { background: #fef3c7; color: #92400e; }

.profile-section { margin-bottom: 24px; }
.profile-section h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

.comp-table { width: 100%; border-collapse: collapse; }
.comp-table td { padding: 7px 0; font-size: 13px; }
.comp-table td:first-child { color: var(--text-2); width: 45%; }
.comp-table td:last-child { font-weight: 600; }

/* ─── Auth Screen ──────────────────────────────────────────────────────────── */

.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.auth-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  min-height: 0;
}

.auth-error:empty { display: none; }

/* ─── AI Summary Box (profile review step) ──────────────────────────────── */

.ai-summary-box {
  background: linear-gradient(135deg, #eef2ff, #f0fdf4);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.ai-summary-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 6px;
}

.ai-summary-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* ─── Detected Badge ────────────────────────────────────────────────────── */

.detected-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}
