
/* ==========================================================================
   DESIGN SYSTEM VARIABLES
   ========================================================================== */
:root {
  /* Colors */
  --bg-app: #F7F6F3;          /* Very warm, elegant, off-white background */
  --bg-card: #FFFFFF;         /* Crisp white card background */
  --bg-sidebar: #ECEBE6;      /* Muted, warm clay/sage off-white */
  --bg-sidebar-hover: rgba(85, 107, 47, 0.06);
  --bg-sidebar-active: rgba(85, 107, 47, 0.1);
  
  --color-primary: hsl(80, 25%, 32%);        /* Rich Olive Green */
  --color-primary-hover: hsl(80, 28%, 25%);  /* Darker Olive for interaction */
  --color-primary-light: hsl(80, 18%, 93%);  /* Soft Sage/Cream tint */
  --color-primary-glow: rgba(85, 107, 47, 0.15);
  
  --text-main: #222222;        /* Soft Charcoal for primary body */
  --text-headers: #1E2824;     /* Deep Olive-Charcoal for high contrast titles */
  --text-muted: #6B7280;       /* Cool gray for subtitles and captions */
  --text-inverse: #FFFFFF;
  
  /* Status Colors */
  --color-success: hsl(120, 20%, 40%);     /* Trustworthy Emerald/Olive green */
  --color-success-light: hsl(120, 25%, 95%);
  --color-warning: hsl(38, 55%, 45%);      /* Warm Amber */
  --color-warning-light: hsl(38, 60%, 96%);
  --color-danger: hsl(4, 55%, 45%);        /* Deep Crimson */
  --color-danger-light: hsl(4, 60%, 97%);
  
  /* Borders & Shadows */
  --border-color: rgba(85, 107, 47, 0.08);
  --border-focus: hsl(80, 25%, 45%);
  --border-light: rgba(0, 0, 0, 0.04);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 20px rgba(44, 62, 53, 0.02), 0 2px 6px rgba(44, 62, 53, 0.03);
  --shadow-lg: 0 10px 30px rgba(44, 62, 53, 0.04), 0 4px 12px rgba(44, 62, 53, 0.04);
  --shadow-overlay: 0 20px 50px rgba(0, 0, 0, 0.08);
  
  /* Typography scales */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-md: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASICS
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-headers);
  font-weight: 600;
  letter-spacing: -0.01em;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(85, 107, 47, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(85, 107, 47, 0.3);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* Impersonation Banner */
.impersonation-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-warning);
  color: var(--text-inverse);
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.impersonation-banner button {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.impersonation-banner button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.impersonation-active {
  padding-top: 36px; /* Offset for the banner */
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  padding: 20px 16px;
  z-index: 10;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid rgba(85, 107, 47, 0.08);
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-card);
  font-weight: 700;
  font-size: 14px;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-headers);
}

/* User profile details in sidebar */
.user-profile-section {
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-selector-container {
  position: relative;
}

.user-dropdown-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.user-dropdown-btn:hover {
  border-color: rgba(85, 107, 47, 0.2);
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-primary);
  flex-shrink: 0;
}

.user-dropdown-btn.Admin .user-dot { background-color: var(--color-primary); }
.user-dropdown-btn.Beta .user-dot { background-color: var(--color-success); }
.user-dropdown-btn.Public .user-dot { background-color: var(--color-warning); }

.user-info-text {
  flex-grow: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 9px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-top: 4px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 100;
  overflow: hidden;
}

.user-dropdown-menu.show {
  display: block;
}

.user-option {
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition-fast);
}

.user-option:hover {
  background: var(--color-primary-light);
}

/* Credits remaining indicator */
.credits-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Navigation items */
.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-headers);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  background: var(--bg-sidebar-hover);
}

.nav-link.active {
  background: var(--bg-sidebar-active);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-link {
  text-decoration: none;
  outline: none;
}

.nav-link:focus-visible {
  box-shadow: 0 0 0 2px var(--color-primary);
}

/* Search profiles section */
.search-profiles-section {
  margin-top: 24px;
  border-top: 1px solid rgba(85, 107, 47, 0.08);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.section-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.add-profile-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-primary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.add-profile-btn:hover {
  background: rgba(85, 107, 47, 0.1);
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: none;
  border: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
  outline: none;
}
.profile-item:focus-visible {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.profile-item:hover {
  background: var(--bg-sidebar-hover);
}

.profile-item.active {
  background: var(--bg-sidebar-active);
  color: var(--color-primary);
  font-weight: 600;
}

.profile-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 8px;
  display: inline-block;
  vertical-align: middle;
}

.profile-item.active .profile-dot {
  background: var(--color-primary);
}

/* Footer section */
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(85, 107, 47, 0.08);
  padding-top: 12px;
}

.sidebar-profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-profile-link:hover {
  background: var(--bg-sidebar-hover);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.profile-meta-text {
  display: flex;
  flex-direction: column;
}

.profile-meta-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-headers);
}

.profile-meta-view {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   MAIN APP BODY
   ========================================================================== */
.main-content {
  flex-grow: 1;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: none;
  padding: 30px 40px;
  flex-grow: 1;
}

.view-panel.active {
  display: block;
}

/* View Header */
.view-header {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.view-title-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.view-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-headers);
}

.view-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.view-actions {
  display: flex;
  gap: 12px;
}

/* Common Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

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

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

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

.btn-secondary:hover {
  background-color: var(--color-primary-light);
  border-color: rgba(85, 107, 47, 0.2);
}

.btn-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
  border-color: rgba(186, 45, 37, 0.2);
}

.btn-danger:hover {
  background-color: var(--color-danger);
  color: white;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* ==========================================================================
   DASHBOARD VIEW
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Clickable stat tiles (e.g. Jobs Found -> Job Discovery) */
.stat-card-clickable {
  cursor: pointer;
}

.stat-card-clickable:hover {
  border-color: var(--border-focus);
}

.stat-card-clickable:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-headers);
  line-height: 1.1;
}

.stat-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dashboard-details-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 30px;
}

.dashboard-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-card-title {
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Action Items List */
.action-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all var(--transition-fast);
}

.action-item-card:hover {
  background-color: var(--color-primary-light);
  border-color: rgba(85, 107, 47, 0.2);
}

.action-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.action-item-info {
  display: flex;
  flex-direction: column;
}

.action-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-headers);
}

.action-item-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Log Activity feed */
.log-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  border-left: 2px solid var(--color-primary);
  padding-left: 10px;
}

.log-time {
  font-size: 10px;
  color: var(--text-muted);
}

.log-msg {
  font-weight: 500;
  color: var(--text-headers);
}

/* ==========================================================================
   JOB DISCOVERY & WORKSPACE VIEW (SPLIT PANEL)
   ========================================================================== */
.discovery-split-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
  height: calc(100vh - 120px);
  overflow: hidden;
  margin-top: -10px;
}

/* Left: Job List Column */
.job-list-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  height: 100%;
}

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(85, 107, 47, 0.2);
}

.job-card.active {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.job-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.job-company-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.company-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.job-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-headers);
}

.match-score-badge {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.match-score-badge.high {
  background-color: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid rgba(46, 117, 89, 0.2);
}

.match-score-badge.mid {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid rgba(184, 115, 51, 0.2);
}

.job-card-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.job-card-tag {
  background: rgba(0, 0, 0, 0.03);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Right: Workspace Details Panel */
.job-workspace-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.workspace-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #FAFBF9;
}

.workspace-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.workspace-company {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workspace-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-headers);
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Tab Navigation inside Workspace */
.workspace-tabs {
  display: flex;
  gap: 6px;
  background: #FAFBF9;
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--color-primary);
}

.tab-btn.active {
  color: var(--color-primary);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-primary);
}

.workspace-tab-content {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  background: #FFFFFF;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Tab Pane: Overview */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

.overview-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.overview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.markdown-text {
  font-size: 14px;
  color: var(--text-main);
  white-space: pre-wrap;
}

.info-bullet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Explainable Match Scoring Component */
.match-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.match-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.match-list-item {
  font-size: 13px;
  padding-left: 20px;
  position: relative;
}

.match-list-item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.match-section.strong {
  background-color: var(--color-success-light);
  border-color: rgba(46, 117, 89, 0.15);
}
.match-section.strong .match-section-title { color: var(--color-success); }
.match-section.strong .match-list-item::before { background-color: var(--color-success); }

.match-section.partial {
  background-color: var(--color-warning-light);
  border-color: rgba(184, 115, 51, 0.15);
}
.match-section.partial .match-section-title { color: var(--color-warning); }
.match-section.partial .match-list-item::before { background-color: var(--color-warning); }

.match-section.concern {
  background-color: var(--color-danger-light);
  border-color: rgba(186, 45, 37, 0.15);
}
.match-section.concern .match-section-title { color: var(--color-danger); }
.match-section.concern .match-list-item::before { background-color: var(--color-danger); }

/* Tab Pane: CV Diff View */
.cv-diff-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.diff-banner-alert {
  padding: 10px 16px;
  border-radius: 8px;
  background-color: var(--color-primary-light);
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.diff-viewer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.diff-header-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #FAFBF9;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.diff-header-col {
  padding: 10px 16px;
}

.diff-header-col:first-child {
  border-right: 1px solid var(--border-color);
}

.diff-body {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
}

.diff-item-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border-light);
}

.diff-item-row:last-child {
  border-bottom: none;
}

.diff-col {
  padding: 16px;
  font-size: 13px;
  position: relative;
}

.diff-col:first-child {
  border-right: 1px solid var(--border-color);
}

/* Diff modifications colors */
.diff-removed {
  background-color: rgba(186, 45, 37, 0.08);
  text-decoration: line-through;
  color: #8C2A20;
}

.diff-added {
  background-color: rgba(46, 117, 89, 0.08);
  color: #1F5C3F;
  font-weight: 500;
}

.diff-tag {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
}

.diff-removed .diff-tag {
  background-color: rgba(186, 45, 37, 0.15);
  color: var(--color-danger);
}

.diff-added .diff-tag {
  background-color: rgba(46, 117, 89, 0.15);
  color: var(--color-success);
}

.diff-assurance {
  margin-top: 4px;
  font-size: 10px;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* Tab Pane: Contacts & Outreach */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.contact-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-fast);
}

.contact-card:hover {
  border-color: rgba(85, 107, 47, 0.2);
  box-shadow: var(--shadow-sm);
}

.contact-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.contact-name-title {
  display: flex;
  flex-direction: column;
}

.contact-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-headers);
}

.contact-title {
  font-size: 12px;
  color: var(--text-muted);
}

.contact-relevance-pill {
  font-size: 11px;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  padding: 8px;
  border-radius: 8px;
  font-weight: 500;
}

.outreach-box-container {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.outreach-box-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-headers);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.outreach-box-textarea {
  width: 100%;
  height: 120px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  resize: vertical;
  background: var(--bg-app);
}

/* ==========================================================================
   TRACKER VIEW
   ========================================================================== */
.tracker-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  height: calc(100vh - 160px);
  overflow-x: auto;
  align-items: flex-start;
}

.tracker-column {
  background: rgba(85, 107, 47, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 100%;
  overflow-y: auto;
}

.tracker-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 8px 4px;
  border-bottom: 1px solid var(--border-color);
}

.tracker-column-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-headers);
}

.tracker-column-count {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}

.tracker-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tracker-item-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.tracker-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-headers);
}

.tracker-item-company {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   ADMIN DASHBOARD VIEW
   ========================================================================== */
.admin-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 30px;
}

.admin-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  background-color: var(--bg-card);
}

.admin-table th {
  background-color: #FAFBF9;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-headers);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}

.status-badge.active {
  background-color: var(--color-success-light);
  color: var(--color-success);
}

.status-badge.disabled {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
}

/* Logs and Debug sections in Admin */
.admin-card-header-actions {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   PROFILE VIEW
   ========================================================================== */
.profile-view-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
  height: calc(100vh - 160px);
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-nav-link {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-headers);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.profile-nav-link:hover {
  background: var(--bg-sidebar-hover);
}

.profile-nav-link.active {
  background: var(--bg-sidebar-active);
  color: var(--color-primary);
  font-weight: 600;
}

.profile-details-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-section-title {
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-headers);
}

.form-control {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  background-color: var(--bg-app);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: white;
}

/* ==========================================================================
   ONBOARDING MODAL OVERLAY
   ========================================================================== */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(44, 62, 53, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  /* Above the auth overlay (3000): the same dialog is used before account
     creation and later from the profile, so it is not an auth-only surface. */
  z-index: 3200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.30s ease;
}

.onboarding-overlay.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.onboarding-modal {
  background: var(--bg-card);
  width: 580px;
  border-radius: 20px;
  box-shadow: var(--shadow-overlay);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-overlay.show .onboarding-modal {
  transform: scale(1);
}

.onboarding-progress-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 4px;
  background-color: var(--border-color);
}

.progress-step {
  height: 100%;
  background-color: transparent;
  transition: background-color var(--transition-md);
}

.progress-step.active {
  background-color: var(--color-primary);
}

.progress-step.completed {
  background-color: var(--color-primary-hover);
}

.onboarding-body {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 380px;
  justify-content: center;
}

.onboarding-step-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.onboarding-step-pane.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.onboarding-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-headers);
  text-align: center;
  margin-bottom: 6px;
}

.onboarding-desc {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}

/* Onboarding Step Forms */
.role-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.role-card-choice {
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background-color: var(--color-bg-card, #FFFFFF);
  font-family: inherit;
  outline: none;
}
.role-card-choice:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(85, 107, 47, 0.25);
}

.role-card-choice:hover {
  border-color: rgba(85, 107, 47, 0.3);
  background-color: var(--color-primary-light);
}

.role-card-choice.selected {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.role-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-headers);
}

.role-card-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Upload resume area */
.upload-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
}

.upload-dropzone:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.upload-icon {
  font-size: 24px;
  color: var(--color-primary);
}

/* Simulated AI parsing loader */
.parsing-loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.scanning-animation {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.scanning-bar {
  height: 100%;
  width: 30%;
  background: var(--color-primary);
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 3px;
  animation: scan 2s linear infinite;
}

.parser-log-text {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-headers);
  background: var(--bg-app);
  padding: 12px;
  border-radius: 6px;
  width: 100%;
  height: 100px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

/* Form inputs for onboarding editing */
.onboarding-form-scrollable {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 8px;
}

.onboarding-footer {
  padding: 16px 40px 30px 40px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

/* Modal layout components */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

body.modal-open .main-content,
body.modal-open .job-list-panel,
body.modal-open .workspace-tab-content {
  overflow-y: hidden !important;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 16px;
  width: 500px;
  max-height: 90vh;
  box-shadow: var(--shadow-overlay);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  padding: 24px 24px 12px 24px;
  margin: 0;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 24px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes scan {
  0% { left: -30%; }
  100% { left: 100%; }
}

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

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

/* ==========================================================================
   AUTHENTICATION OVERLAY
   ========================================================================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(44, 62, 53, 0.45);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.auth-overlay.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.auth-card {
  background: var(--bg-card);
  width: 440px;
  border-radius: 18px;
  box-shadow: var(--shadow-overlay);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--border-color);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-overlay.show .auth-card {
  transform: scale(1);
}

.auth-title {
  font-family: var(--font-header);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-headers);
  text-align: center;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: -8px;
  margin-bottom: 8px;
}

.auth-switch-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.auth-switch-link {
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.auth-error {
  background-color: #fdf2f2;
  color: #c81e1e;
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid #f8b4b4;
  display: none;
}

/* Get started CTA and divider on the sign-in card */
.auth-cta {
  width: 100%;
  margin-top: 4px;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.auth-link {
  border: none;
  background: none;
  color: var(--color-primary);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.auth-link:hover {
  color: var(--color-primary-hover);
}

.auth-success {
  background-color: var(--color-success-light);
  color: var(--color-success);
  padding: 10px;
  border-radius: 8px;
  font-size: 12.5px;
  border: 1px solid rgba(85, 107, 47, 0.18);
  display: none;
}

.auth-success-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ==========================================================================
   JOB-SEEKER ONBOARDING (frontend/js/onboarding.js)
   ========================================================================== */
/* The modal is the scroll container, so the footer below can stay stuck to its
   bottom on small screens instead of being clipped off the card. */
.onb-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(88vh, 860px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.onb-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.onb-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 8px;
  background: var(--bg-card);
}

.onb-brand {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-headers);
}

.onb-close {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.onb-close:hover {
  background: var(--bg-app);
  color: var(--text-headers);
}

.onb-progress {
  display: flex;
  gap: 6px;
  padding: 14px 24px 0;
}

.onb-progress-seg {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border-color);
  transition: background var(--transition-md);
}

.onb-progress-seg.active {
  background: var(--color-primary);
}

.onb-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 24px 8px;
}

.onb-title {
  font-size: 20px;
  text-align: left;
  outline: none;
  margin-bottom: 6px;
}

.onb-helper {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.onb-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-headers);
  margin: 10px 0 6px;
}

.onb-search {
  width: 100%;
}

.onb-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding: 2px;
}

.onb-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 13.5px;
  transition: all var(--transition-fast);
}

.onb-option:hover {
  border-color: rgba(85, 107, 47, 0.25);
  background: var(--color-primary-light);
}

.onb-option.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.onb-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.onb-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: inherit;
}

.onb-option-standalone {
  margin-top: 4px;
}

.onb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 26px;
  margin-bottom: 12px;
}

.onb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(85, 107, 47, 0.18);
  background: var(--color-primary-light);
  color: var(--text-headers);
  font-size: 12px;
  font-weight: 500;
}

.onb-chip button {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.onb-chip button:hover {
  color: var(--color-danger);
}

.onb-muted {
  color: var(--text-muted);
  font-size: 12.5px;
}

.onb-empty {
  padding: 8px 2px;
}

.onb-inline {
  display: flex;
  gap: 8px;
}

.onb-inline .form-control {
  flex: 1;
}

.onb-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.onb-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 10px;
}

.onb-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}

.onb-suggestion {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.onb-suggestion:hover:not(:disabled) {
  border-color: rgba(85, 107, 47, 0.3);
  background: var(--color-primary-light);
}

.onb-suggestion.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
}

.onb-suggestion:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.onb-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.onb-error {
  display: block;
  margin-bottom: 12px;
}

.onb-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.onb-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-app);
  font-size: 13px;
}

.onb-summary-label {
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 600;
}

.onb-summary-value {
  color: var(--text-headers);
  text-align: right;
}

.onb-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 8px 8px;
  text-align: center;
}

.onb-welcome .onb-title {
  text-align: center;
}

.onb-welcome-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 26px;
}

.onb-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.onb-link {
  border: none;
  background: none;
  color: var(--color-primary);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.onb-switch {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .onb-head { padding: 14px 16px 0; }
  .onb-progress { padding: 12px 16px 0; }
  .onb-body { padding: 14px 16px 6px; }
  .onb-footer { padding: 12px 16px 16px; }
  .onb-summary-row { flex-direction: column; gap: 4px; }
  .onb-summary-value { text-align: left; }
}

/* Custom Table Inline Editing & Badges */
.admin-table td input.inline-edit-input,
.admin-table td select.inline-edit-input {
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #FFF;
  color: var(--text-main);
  box-sizing: border-box;
}

.badge-confidence {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge-confidence.verified {
  background: var(--color-success-light);
  color: var(--color-success);
}
.badge-confidence.detected {
  background: #E3F2FD;
  color: #0D47A1;
}
.badge-confidence.manual {
  background: #FFF3E0;
  color: #E65100;
}
.badge-confidence.unknown {
  background: var(--border-color);
  color: var(--text-muted);
}

/* ==========================================================================
   ATS CV PREVIEW — SCROLLABLE WRAPPER
   ========================================================================== */

/* Outer scroll wrapper: lets the CV preview grow to full height without
   being clipped by the workspace panel's overflow:hidden constraint */
.ats-cv-preview-wrapper {
  margin-top: 0;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  background: #ffffff;
}

/* The printable CV document itself */
.ats-cv-document {
  font-family: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: #111827;
  background: #ffffff;
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 36px;
}

.ats-cv-document h1 {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #111827;
  margin: 0 0 3px 0;
}

.ats-cv-document .cv-tagline {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin: 0 0 4px 0;
}

.ats-cv-document .cv-contact {
  font-size: 11.5px;
  color: #4B5563;
  margin: 0;
}

.ats-cv-document .cv-header-block {
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1.5px solid #111827;
}

.ats-cv-document .cv-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111827;
  border-bottom: 1px solid #9CA3AF;
  padding-bottom: 3px;
  margin: 18px 0 8px 0;
}

.ats-cv-document .cv-skills-block {
  font-size: 12.5px;
  color: #1F2937;
  line-height: 1.6;
  margin-bottom: 4px;
}

.ats-cv-document .cv-role-block {
  margin-bottom: 14px;
}

.ats-cv-document .cv-company-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1px;
}

.ats-cv-document .cv-company-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.ats-cv-document .cv-company-location {
  font-size: 11.5px;
  color: #6B7280;
  text-align: right;
}

.ats-cv-document .cv-role-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.ats-cv-document .cv-role-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #1F2937;
  font-style: italic;
}

.ats-cv-document .cv-role-dates {
  font-size: 11.5px;
  color: #6B7280;
  text-align: right;
  white-space: nowrap;
}

.ats-cv-document .cv-role-description {
  font-size: 12px;
  color: #4B5563;
  margin: 2px 0 4px 0;
  line-height: 1.5;
}

.ats-cv-document ul.cv-bullets {
  margin: 4px 0 8px 0;
  padding-left: 16px;
  list-style-type: disc;
}

.ats-cv-document ul.cv-bullets li {
  font-size: 12.5px;
  color: #1F2937;
  line-height: 1.55;
  margin-bottom: 4px;
  padding-left: 2px;
}

.ats-cv-document .cv-subsection-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin: 8px 0 3px 0;
}

.ats-cv-document .cv-plain-line {
  font-size: 12.5px;
  color: #374151;
  margin-bottom: 4px;
  line-height: 1.55;
}

.ats-cv-document .cv-edu-block {
  margin-bottom: 8px;
}

.ats-cv-document .cv-edu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
}

.ats-cv-document .cv-edu-row:first-child {
  margin-top: 0;
}

.ats-cv-document .cv-edu-institution {
  font-size: 12.5px;
  font-weight: 700;
  color: #111827;
}

.ats-cv-document .cv-edu-location {
  font-size: 11.5px;
  color: #6B7280;
}

.ats-cv-document .cv-edu-degree {
  font-size: 12px;
  color: #374151;
  margin-top: 2px;
  font-style: italic;
}

.ats-cv-document .cv-cert-line {
  font-size: 12px;
  color: #374151;
  margin-bottom: 3px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Tailored CV toolbar (not printed): ONE row at desktop widths — title,
   live metadata, Ready pill on the left; Edit / Template / Download right.
   The row never wraps at desktop: its non-shrinkable parts size the panel.
   Only small screens (< 720px) wrap, and then the height grows naturally so
   the preview always sits below the buttons.
   -------------------------------------------------------------------------- */
.cv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
  min-height: 50px;
  padding: 0 12px;
  margin: 0 0 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-sizing: border-box;
}

.cv-toolbar__left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 1 auto;
  min-width: 0;
}

.cv-toolbar__title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-headers);
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex: 0 0 auto;
}

.cv-toolbar__meta {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}

.cv-ready-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3f6212;
  background: #f3f7ec;
  border: 1px solid #d7e6c4;
  border-radius: 999px;
  padding: 3px 7px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.cv-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

.cv-toolbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 35px;
  padding: 0 9px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-headers);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease;
}

.cv-toolbar__btn:hover {
  background: var(--bg-app);
}

.cv-toolbar__btn--primary {
  background: #14384C;
  border-color: #14384C;
  color: #ffffff;
}

.cv-toolbar__btn--primary:hover {
  background: #0f2c3b;
  border-color: #0f2c3b;
}

.cv-download-wrap {
  position: relative;
}

.cv-download-caret {
  font-size: 10px;
  line-height: 1;
  margin-top: 1px;
}

.cv-download-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 172px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 60;
}

.cv-download-menu.show {
  display: block;
}

.cv-download-item {
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-headers);
  cursor: pointer;
}

.cv-download-item:hover {
  background: var(--bg-app);
}

/* The toolbar's own container: it wraps only when ITS width cannot hold the
   row — a small viewport, or a workspace squeezed by a neighbouring column.
   (The app's discovery split gives the list a fixed 460px, so the workspace
   can be narrower than the window; the toolbar must react to the box it is
   actually in, not only to the viewport.) */
#tailored-cv-preview-section {
  container-type: inline-size;
  /* The workspace's default seat below the sub-tabs is ~53px (bar margin +
     pane padding). The toolbar sits ~22px below them instead — no big empty
     space above the CV. The side bleed reclaims the pane's 24px padding so
     the toolbar (and the preview under it) span the panel, as in the mockup.
     Both the CV pane and the AI pane render this section; nothing else does. */
  margin: -31px -24px 0;
}

/* Below this the row cannot hold a readable metadata line: wrap instead of
   hiding it. 1280px desktops stay comfortably above it. */
@container (max-width: 360px) {
  .cv-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
    min-height: 0;
    height: auto;
    padding: 10px 12px;
  }

  .cv-toolbar__left {
    flex-wrap: wrap;
    width: 100%;
  }

  .cv-toolbar__meta {
    flex: 1 1 100%;
    white-space: normal;
  }

  .cv-toolbar__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
}

/* Small screens: same treatment, for browsers without container queries. */
@media (max-width: 720px) {
  .cv-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
    min-height: 0;
    height: auto;
    padding: 10px 12px;
  }

  .cv-toolbar__left {
    flex-wrap: wrap;
    width: 100%;
  }

  .cv-toolbar__meta {
    flex: 1 1 100%;
    white-space: normal;
  }

  .cv-toolbar__actions {
    margin-left: 0;
    width: 100%;
  }
}

/* ==========================================================================
   @MEDIA PRINT — CV-only output for Save as PDF
   ========================================================================== */
@media print {
  /* Hide everything except the CV print root */
  body > *:not(#cv-print-root) {
    display: none !important;
  }

  #cv-print-root {
    display: block !important;
    margin: 0;
    padding: 0;
  }

  #cv-print-root .ats-cv-document {
    max-width: 100%;
    padding: 0;
    margin: 0;
    font-size: 11pt;
    line-height: 1.45;
    color: #000000;
    font-family: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
    box-shadow: none;
  }

  #cv-print-root .ats-cv-document h1 {
    font-size: 16pt;
    color: #000000;
  }

  #cv-print-root .ats-cv-document .cv-section-title {
    font-size: 9pt;
    color: #000000;
    border-bottom-color: #666666;
  }

  #cv-print-root .ats-cv-document .cv-header-block {
    border-bottom-color: #000000;
  }

  #cv-print-root .ats-cv-document .cv-company-name,
  #cv-print-root .ats-cv-document .cv-role-title {
    color: #000000;
  }

  #cv-print-root .ats-cv-document ul.cv-bullets li,
  #cv-print-root .ats-cv-document .cv-plain-line,
  #cv-print-root .ats-cv-document .cv-skills-block {
    color: #111111;
  }

  /* Prevent section headers from orphaning at page bottom */
  .cv-section-title {
    page-break-after: avoid;
  }

  .cv-role-block {
    page-break-inside: avoid;
  }

  @page {
    margin: 18mm 16mm 18mm 16mm;
    size: A4 portrait;
  }
}

/* ==========================================================================
   JOB DISCOVERY MODERN REDESIGN (REF DESIGN ACCURATE)
   ========================================================================== */

/* Theme Variables Override */
:root {
  --bg-app: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --color-primary: #047857;
  --color-primary-hover: #065F46;
  --color-primary-light: #ECFDF5;
  --border-color: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-headers: #0F172A;
}

body {
  background-color: #FFFFFF;
  color: #0F172A;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: #FFFFFF;
  overflow: hidden;
}

/* Top Header Bar */
.top-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  border-bottom: 1px solid #E2E8F0;
  background: #FFFFFF;
  z-index: 10;
  flex-shrink: 0;
}

.top-header-search {
  flex: 1;
  max-width: 440px;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F1F5F9;
  border-radius: 20px;
  padding: 8px 16px;
  color: #64748B;
  transition: all 0.2s ease;
}

.search-input-box:focus-within {
  background: #FFFFFF;
  box-shadow: 0 0 0 2px #047857;
}

.search-input-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #0F172A;
  width: 100%;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.location-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.notification-bell-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
}

.notification-badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: #EF4444;
  border-radius: 50%;
}

.user-profile-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F1F5F9;
  border-radius: 20px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
}

.user-avatar-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #CBD5E1;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-pill-text {
  font-size: 12.5px;
  font-weight: 600;
  color: #1E293B;
}

/* Layout below Top Header */
.main-app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 64px);
}

.sidebar {
  width: 240px;
  background: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: #047857;
  color: #FFFFFF;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin: 0;
}

.brand-subtext {
  font-size: 11px;
  color: #64748B;
}

.sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #475569;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-nav-item:hover {
  background: #F8FAFC;
  color: #0F172A;
}

.sidebar-nav-item.active {
  background: #ECFDF5;
  color: #047857;
  font-weight: 600;
}

.main-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
}

.view-panel {
  display: none;
  height: 100%;
  width: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 24px 32px;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

/* Job Discovery specific layout */
#view-discovery.view-panel {
  overflow: hidden;
  padding: 0;
  position: relative;
}

#view-discovery > .view-header {
  display: none;
}

/* Job Discovery Layout Split */
.discovery-split-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #FFFFFF;
}

/* On narrower desktops the fixed 460px job list squeezed the workspace so hard
   that the connectors inside it (the Tailored CV toolbar in particular) had no
   room. Give the list a flexible column instead; the workspace keeps a usable
   width and the toolbar stays on one row. */
@media (max-width: 1180px) {
  .discovery-split-layout {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }
}

.job-list-panel {
  border-right: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  background: #FFFFFF;
}

.job-workspace-panel {
  padding: 28px 36px;
  overflow-y: auto;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Center Header in Job Discovery */
.discovery-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.discovery-main-title {
  font-size: 26px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.matches-today-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ECFDF5;
  color: #059669;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.discovery-subtitle {
  font-size: 13.5px;
  color: #64748B;
  margin-top: 4px;
}

/* Search + Filters toolbar (Job Discovery) */
.discovery-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.discovery-search-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.discovery-search-icon {
  position: absolute;
  left: 12px;
  color: #94A3B8;
  pointer-events: none;
}

.discovery-search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  color: #0F172A;
  background: #FFFFFF;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.discovery-search-input::placeholder {
  color: #94A3B8;
}

.discovery-search-input:focus {
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10);
}

.discovery-filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #FFFFFF;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.discovery-filters-btn:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.discovery-filters-btn.has-active {
  border-color: #10B981;
  color: #047857;
}

.discovery-filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #10B981;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
}

/* Removable active-filter chips, shown under the search bar only when set */
.discovery-active-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.discovery-active-chips .filter-chip {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
  font-weight: 600;
}

.discovery-active-chips .filter-chip:hover {
  background: #D1FAE5;
}

.discovery-active-chips .chip-x {
  color: #34D399;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 12.5px;
  color: #334155;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-x {
  font-size: 10px;
  color: #94A3B8;
}

/* Right-side filter drawer */
.discovery-drawer {
  position: absolute;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.discovery-drawer.open {
  pointer-events: auto;
}

.discovery-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.16);
  opacity: 0;
  transition: opacity var(--transition-md);
}

.discovery-drawer.open .discovery-drawer-backdrop {
  opacity: 1;
}

.discovery-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 340px;
  background: #FFFFFF;
  border-left: 1px solid #E2E8F0;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-md);
}

.discovery-drawer.open .discovery-drawer-panel {
  transform: translateX(0);
}

/* The filter section is placed inline at the top of the job list (directly
   below the search bar, above the Matches/Saved/Applied tabs) rather than as a
   floating right-side drawer. The drawer child styles (header/body/footer,
   groups, selects) are reused, so the controls keep their look. */
.discovery-filter-section {
  display: none;
  margin-bottom: 12px;
}

.discovery-filter-section.open {
  display: block;
}

.discovery-filter-section .discovery-drawer-panel {
  position: static;
  top: auto;
  right: auto;
  width: auto;
  height: auto;
  transform: none;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: none;
}

.discovery-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #F1F5F9;
}

.discovery-drawer-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
}

.discovery-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748B;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.discovery-drawer-close:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.discovery-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.drawer-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-group-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748B;
}

.drawer-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #334155;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.drawer-check:hover {
  background: #F8FAFC;
}

.drawer-check input {
  width: 15px;
  height: 15px;
  accent-color: #10B981;
  cursor: pointer;
}

.drawer-select {
  width: 100%;
  background-color: #FFFFFF;
  border-color: #E2E8F0;
  cursor: pointer;
}

.discovery-drawer-footer {
  display: flex;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid #F1F5F9;
}

.drawer-btn {
  flex: 1;
  font-size: 13px;
}

.discovery-drawer-footer .drawer-show-btn {
  background-color: #10B981;
}

.discovery-drawer-footer .drawer-show-btn:hover {
  background-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Tabs & Sort Bar */
.discovery-tabs-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 20px;
  padding-bottom: 2px;
}

.discovery-tabs {
  display: flex;
  gap: 20px;
}

.disc-tab {
  background: none;
  border: none;
  padding: 8px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748B;
  cursor: pointer;
  position: relative;
}

.disc-tab.active {
  color: #0F172A;
  font-weight: 700;
}

.disc-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #047857;
  border-radius: 2px;
}

.disc-tab-count {
  font-weight: 400;
  color: #94A3B8;
}

.disc-sort-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748B;
}

.disc-sort-wrapper select {
  border: none;
  background: transparent;
  font-weight: 600;
  color: #334155;
  outline: none;
  cursor: pointer;
}

/* Job Cards Container */
.job-cards-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex-grow: 1;
}

.job-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.job-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.job-card.active {
  border: 1.5px solid #10B981;
  background: #FAFCFB;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.06);
}

.job-card-logo-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #0F172A;
  flex-shrink: 0;
}

.job-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.job-card-header-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.job-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.3;
}

.job-card-company {
  font-size: 13px;
  color: #64748B;
}

.job-card-location {
  font-size: 12px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.job-card-tags-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.job-pill-tag {
  background: #F1F5F9;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
}

.job-card-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
}

.match-score-pill {
  background: #D1FAE5;
  color: #065F46;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
}

.job-card-bookmark-btn {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 2px;
}

.job-card-time-ago {
  font-size: 11px;
  color: #94A3B8;
}

/* Right Panel: Selected Job Workspace */
.workspace-top-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.workspace-company-logo-large {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
}

.btn-apply-primary {
  background: #047857;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
}

.btn-apply-primary:hover {
  background: #065F46;
  color: white;
}

/* An applied job: the same button reads as a settled state, not a call to
   action. The status can still be moved on from the job tracker. */
.btn-apply-primary.is-applied {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.btn-apply-primary.is-applied:hover {
  background: #D1FAE5;
  color: #065F46;
}

/* The tracker card's status control — the later half of the Apply flow. */
.tracker-status-select {
  width: 100%;
  margin-top: 6px;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-color);
  cursor: pointer;
}

.workspace-subtabs-bar {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 4px;
}

.ws-subtab {
  background: none;
  border: none;
  padding: 8px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748B;
  cursor: pointer;
  position: relative;
}

.ws-subtab.active {
  color: #0F172A;
  font-weight: 700;
}

.ws-subtab.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 2px;
  background: #047857;
}

.ai-match-card-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.match-score-big-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.big-score-val {
  font-size: 32px;
  font-weight: 800;
  color: #047857;
  line-height: 1;
}

.big-score-label {
  font-size: 12px;
  font-weight: 600;
  color: #047857;
  margin-top: 4px;
}

.big-score-bar-bg {
  width: 100%;
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.big-score-bar-fill {
  height: 100%;
  background: #10B981;
  border-radius: 3px;
}

.match-list-col h5 {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.match-list-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #475569;
}

.icon-check-green {
  color: #10B981;
  font-weight: 700;
}

.icon-warn-amber {
  color: #F59E0B;
  font-weight: 700;
}

.workspace-actions-row {
  display: flex;
  gap: 12px;
}

.btn-action-main {
  background: #047857;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-main:hover {
  background: #065F46;
}

.btn-action-secondary {
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  color: #374151;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-secondary:hover {
  background: #F9FAFB;
  border-color: #9CA3AF;
}

.workspace-meta-grid {
  display: grid;
  /* Five or six facts are common now (posted, arrangement, type, seniority,
     department, source); let them flow instead of wrapping a lone item. */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  padding: 16px 0;
}

.meta-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
}

.meta-stat-text {
  display: flex;
  flex-direction: column;
}

.meta-stat-label {
  font-size: 11px;
  color: #94A3B8;
}

.meta-stat-val {
  font-size: 12.5px;
  font-weight: 600;
  color: #1E293B;
}

.job-desc-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 12px;
}

.job-desc-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.job-desc-header h4 {
  margin-bottom: 0;
}

.job-desc-original {
  font-size: 12.5px;
  font-weight: 600;
  color: #2563EB;
  text-decoration: none;
  white-space: nowrap;
}

.job-desc-original:hover {
  text-decoration: underline;
}

/* Overview's role summary, derived verbatim from the vacancy text. */
.job-summary-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.job-summary-card h5 {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 8px 0;
}

.job-summary-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: #475569;
  margin: 0 0 12px 0;
  max-width: 720px;
}

.match-empty-note {
  font-size: 13px;
  line-height: 1.55;
  color: #64748B;
  margin: 0 0 12px 0;
  max-width: 640px;
}

/* --- Outreach: contact search + message drafting --------------------------- */
.outreach-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.outreach-subtab {
  background: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary, #475569);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.outreach-subtab.active {
  background: var(--primary, #1a56db);
  border-color: var(--primary, #1a56db);
  color: #fff;
}

.outreach-draft-section {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.outreach-draft-head h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.outreach-draft-head p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.outreach-draft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-bottom: 14px;
}

.outreach-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.outreach-field-wide {
  grid-column: 1 / -1;
}

.outreach-field input[type="text"],
.outreach-field select,
.outreach-field textarea {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-main, #0f172a);
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
}

.outreach-draft-context {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.outreach-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary, #475569);
  cursor: pointer;
}

.outreach-draft-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.outreach-draft-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.outreach-draft-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 150px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-main, #0f172a);
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  resize: vertical;
  font-family: inherit;
}

.outreach-draft-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.job-desc-body {
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  /* The renderer emits paragraphs, headings, lists and <br>, so the body does
     not rely on preserved whitespace. */
  white-space: normal;
  /* Collapsed by default. A job description runs to ~16k characters, which
     swamps the pane, so the body is clamped and "Show full description"
     expands it. line-height is 14px x 1.6 = 22.4px, so 14 lines is an exact
     multiple and the clip lands on a line boundary. The button is only shown
     when this actually clips — see syncDescriptionToggle() in app.js. */
  max-height: calc(22.4px * 14);
  overflow: hidden;
}

.job-desc-body.expanded {
  max-height: none;
}

/* Structure rebuilt by frontend/js/job_description.js. */
.job-desc-body p {
  margin: 0 0 10px 0;
}

.job-desc-body p:last-child {
  margin-bottom: 0;
}

.job-desc-body .job-desc-heading {
  color: #0F172A;
  font-weight: 700;
  margin: 16px 0 8px 0;
}

.job-desc-body h3.job-desc-heading {
  font-size: 15px;
}

.job-desc-body h4.job-desc-heading {
  font-size: 14px;
}

.job-desc-body ul,
.job-desc-body ol {
  margin: 0 0 10px 0;
  padding-left: 22px;
}

.job-desc-body li {
  margin-bottom: 4px;
}

.job-desc-body a {
  color: #2563EB;
  text-decoration: underline;
}

.job-desc-body blockquote {
  margin: 0 0 10px 0;
  padding-left: 12px;
  border-left: 3px solid #E2E8F0;
  color: #475569;
}

.job-desc-body pre {
  margin: 0 0 10px 0;
  padding: 10px 12px;
  background: #F8FAFC;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-x: auto;
}

.job-desc-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.job-desc-body hr {
  border: 0;
  border-top: 1px solid #E2E8F0;
  margin: 14px 0;
}

/* Shown when the stored description ends in an ellipsis, i.e. the upstream feed
   truncated it. Distinct from .btn-show-more-desc, which only appears when the
   text we *do* have is clipped by the clamp above. */
.job-desc-truncated {
  font-size: 12.5px;
  color: #64748B;
  margin-top: 10px;
}

.job-desc-truncated a {
  color: #2563EB;
  font-weight: 600;
  text-decoration: none;
}

.job-desc-truncated a:hover {
  text-decoration: underline;
}

.btn-show-more-desc {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  margin-top: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --- Greenhouse CV presentation (in-app preview) ----------------------------
   The print/PDF stylesheet for this template lives in cv_templates.js
   (GREENHOUSE_CSS). These rules style the on-screen preview only. */
.gh-cv-document {
  font-family: 'Inter', 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 10.5pt; line-height: 1.4; color: #111; background: #fff;
}
.gh-cv-document .gh-header { padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid #000; }
.gh-cv-document .gh-name { font-size: 21pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 2px 0; }
.gh-cv-document .gh-title { font-size: 11pt; font-weight: 500; color: #222; margin: 0 0 2px 0; }
.gh-cv-document .gh-contact { font-size: 9.5pt; color: #333; }
.gh-cv-document .gh-section { margin-top: 12px; }
.gh-cv-document .gh-section-title { font-size: 10.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid #999; padding-bottom: 2px; margin: 0 0 5px 0; }
.gh-cv-document .gh-summary { font-size: 10.5pt; }
.gh-cv-document .gh-role-row,
.gh-cv-document .gh-org-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.gh-cv-document .gh-role-row { margin-top: 6px; }
.gh-cv-document .gh-role-title { font-size: 10.5pt; font-weight: 700; }
.gh-cv-document .gh-role-dates { font-size: 9.5pt; color: #333; white-space: nowrap; }
.gh-cv-document .gh-org { font-size: 10pt; font-weight: 500; }
.gh-cv-document .gh-org-loc { font-size: 9.5pt; color: #444; white-space: nowrap; }
.gh-cv-document ul.gh-bullets { margin: 3px 0 4px 0; padding-left: 16px; list-style-type: disc; }
.gh-cv-document ul.gh-bullets li { font-size: 10.5pt; line-height: 1.4; margin-bottom: 2px; }
.gh-cv-document .gh-skills,
.gh-cv-document .gh-plain { font-size: 10.5pt; }

/* --- Career Copilot Parsing Check (Greenhouse only) ------------------------
   UI chrome around the preview; NOT part of the CV document itself. */
.cc-parsing-panel {
  margin-top: 14px; border: 1px solid #e2e8f0; border-radius: 8px;
  background: #f8fafc; padding: 12px 14px;
}
.cc-parsing-header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.cc-parsing-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.cc-parsing-sub { font-size: 11.5px; color: #64748b; }
.cc-parsing-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cc-check { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.cc-check-icon { width: 14px; text-align: center; font-weight: 700; }
.cc-check-label { font-weight: 600; color: #0f172a; }
.cc-check-note { color: #64748b; }
.cc-check-pass .cc-check-icon { color: #16a34a; }
.cc-check-warning .cc-check-icon { color: #d97706; }
.cc-check-fail .cc-check-icon { color: #dc2626; }

/* ==========================================================================
   COMPANY DISCOVERY (Firecrawl) — view-specific styles
   ==========================================================================
   Scope is deliberately limited to the Company Discovery panel: every rule
   below is prefixed `cd-` or nested under `.cd-card`, so no existing view is
   restyled. Layout reuses the shared tokens and card classes
   (.dashboard-section-card, .btn, .match-score-badge) rather than restating
   them here.
   ========================================================================== */

.cd-pill.saved { background: var(--color-primary-light); color: var(--color-primary); }

.cd-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cd-decisions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* A dismissed company stays visible (it is reversible) but recedes. */
.cd-card.dismissed { opacity: 0.5; }

.cd-pill.shortlisted { background: var(--color-primary-light); color: var(--color-primary); }
.cd-pill.dismissed { background: rgba(0, 0, 0, 0.06); color: var(--text-muted); }

.cd-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* Automatic weekday discovery toggle + daily credit budget. */
.cd-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: 10px;
}

.cd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-main);
  cursor: pointer;
}

.cd-budget-input {
  width: 80px;
  font-size: 12px;
  padding: 4px 8px;
  margin: 0;
}

.cd-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.cd-pill.live  { background: var(--color-success-light); color: var(--color-success); }
.cd-pill.dry   { background: var(--color-warning-light); color: var(--color-warning); }
.cd-pill.off   { background: var(--color-danger-light);  color: var(--color-danger); }
.cd-pill.roles { background: var(--color-success-light); color: var(--color-success); }
.cd-pill.no-roles { background: rgba(0, 0, 0, 0.045); color: var(--text-muted); }
.cd-pill.hiring { background: var(--color-success-light); color: var(--color-success); }
.cd-pill.proactive { background: rgba(0, 0, 0, 0.045); color: var(--text-muted); }

/* Hiring Now / Proactive Targets filter. Deliberately compact: it groups the
   existing cards, it does not change the view's layout. */
.cd-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.cd-filter-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}
.cd-filter-btn span { font-weight: 700; margin-left: 3px; }
.cd-filter-btn.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.cd-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 14px 0 6px;
}
.cd-group-title:first-child { margin-top: 0; }
.cd-group-title span { color: var(--text-main); margin-left: 3px; }

/* A verified role attached to a company card. */
.cd-job {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(0, 0, 0, 0.015);
}
.cd-job-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.cd-job-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-headers);
}
.cd-job-score {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-success);
  white-space: nowrap;
}
.cd-job-meta { font-size: 11px; color: var(--text-muted); }
.cd-job-link {
  font-size: 11px;
  color: var(--color-primary);
  text-decoration: underline;
  word-break: break-all;
}
.cd-job-empty { color: var(--text-muted); font-size: 11px; gap: 4px; }

.cd-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cd-card + .cd-card { margin-top: 10px; }

.cd-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.cd-card-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-headers);
}

.cd-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.cd-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cd-score-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* A bare .match-score-badge has no background of its own (the shared class only
   styles the .high/.mid variants), so give it a neutral one inside this card. */
.cd-card .match-score-badge {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  min-width: 34px;
}
.cd-card .match-score-badge.high {
  background-color: var(--color-success-light);
  color: var(--color-success);
  border-color: rgba(46, 117, 89, 0.2);
}
.cd-card .match-score-badge.mid {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
  border-color: rgba(184, 115, 51, 0.2);
}

.cd-rationale {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-main);
}

.cd-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cd-factor {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
}
.cd-factor.pos { background: var(--color-success-light); color: var(--color-success); }
.cd-factor.neg { background: var(--color-danger-light);  color: var(--color-danger); }

.cd-sources {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cd-sources-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.cd-source {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 11px;
}

.cd-source-claim {
  color: var(--text-muted);
  flex-shrink: 0;
}

.cd-source a {
  color: var(--color-primary);
  text-decoration: underline;
  word-break: break-all;
}

.cd-query-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cd-query {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
}

.cd-empty {
  padding: 22px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

.cd-empty-error { color: var(--color-danger); }

.cd-note {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* The mandatory geographic filter, stated in the preview so the rule is visible
   before a single Firecrawl request is spent. */
.cd-geography {
  margin-top: 8px;
  padding: 6px 10px;
  border-left: 3px solid var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 4px;
}


/* ============================================
   Toasts (showNotification) — used by the CV upload/import and the
   tailored-CV build to confirm an action without a browser alert.
   ============================================ */
.cc-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
  background: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.cc-toast-success { background: var(--color-success, #16a34a); }
.cc-toast-error { background: var(--color-danger, #dc2626); }

.cc-toast-out {
  opacity: 0;
  transform: translateY(8px);
}

/* ==========================================================================
   CV TEMPLATE PICKER (Part 2)
   The thumbnails render the real document (same renderer, same model) at a
   reduced scale, so what the card shows is what the preview and exports use.
   ========================================================================== */
.cv-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cv-template-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cv-template-card:hover { border-color: #14384C; }

.cv-template-card.is-selected {
  border-color: #14384C;
  box-shadow: 0 0 0 2px rgba(20, 56, 76, 0.18);
}

.cv-template-thumb {
  height: 200px;
  overflow: hidden;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.cv-template-thumb__inner {
  width: 800px;
  padding: 26px;
  transform: scale(0.30);
  transform-origin: top left;
  pointer-events: none;
}

.cv-template-card__body {
  padding: 10px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cv-template-card__body strong { font-size: 13px; }
.cv-template-card__body p { font-size: 11.5px; color: var(--text-muted); margin: 0; line-height: 1.4; }
.cv-template-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #14384C;
}

.cv-paper-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.cv-paper-options { display: flex; gap: 18px; }
.cv-paper-option { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
