:root {
  --bg-main: #0a0e17;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.25);
  
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 20px;
  flex-wrap: wrap;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.brand-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.quick-stats-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  display: flex;
  gap: 6px;
  align-items: center;
}

.stat-label {
  color: var(--text-dim);
  font-weight: 500;
}

.stat-value {
  font-weight: 600;
  color: var(--text-main);
}

.nav-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 9999px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1540px;
  margin: 0 auto;
  width: 100%;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

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

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

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.pane-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
  max-width: 820px;
}

.sample-actions, .pipeline-actions {
  display: flex;
  gap: 10px;
}

/* Cards & Glassmorphism */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-body {
  padding: 24px;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1080px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Form Controls */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

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

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

input[type="text"],
input[type="url"],
select,
textarea {
  background: rgba(12, 17, 29, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(15, 23, 42, 0.95);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.btn-ghost:hover {
  color: var(--text-main);
}

/* Chips & Badges */
.chip {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.chip-info { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.chip-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.chip-warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.chip-danger { background: rgba(244, 63, 94, 0.15); color: #fda4af; }
.chip-muted { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

/* Analysis Results */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h4 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 440px;
  margin: 0 auto;
}

/* Alert Banner */
.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-safe {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.alert-danger {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fecdd3;
}

/* Score Cards */
.score-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.score-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.score-card-title {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-card-number {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 4px 0 8px;
}

.score-card-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent-blue), var(--accent-emerald));
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-cyan {
  background: linear-gradient(to right, var(--accent-cyan), var(--accent-blue));
}

/* Analysis Tags */
.analysis-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.analysis-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.analysis-box h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list li {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.tag-list.matched li {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
}

.tag-list.gap li {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

/* Generation Panel */
.generation-panel {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.generation-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.gen-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  transition: all 0.2s;
}

.gen-tab:hover {
  color: var(--text-main);
}

.gen-tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.05);
}

.gen-content-container {
  padding: 16px;
  background: rgba(10, 14, 23, 0.6);
}

.gen-pane {
  display: none;
}

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

.gen-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.gen-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-output {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: #e2e8f0;
  line-height: 1.6;
  max-height: 380px;
  overflow-y: auto;
}

.prep-output {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-main);
}

.prep-item {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--accent-blue);
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prep-item strong {
  display: block;
  color: #93c5fd;
  margin-bottom: 4px;
}

/* Save to Pipeline Box */
.save-pipeline-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  gap: 16px;
}

.save-pipeline-info strong {
  display: block;
  font-size: 0.9rem;
  color: #a7f3d0;
}

.save-pipeline-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: flex-start;
}

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-col {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 500px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.kanban-col-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
}

.col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-blue { background: var(--accent-blue); }
.dot-amber { background: var(--accent-amber); }
.dot-purple { background: var(--accent-purple); }
.dot-green { background: var(--accent-emerald); }

.count-badge {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  color: var(--text-muted);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.job-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.job-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.job-card-company {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 8px;
}

.job-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.74rem;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--text-muted);
}

.job-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  margin-top: 8px;
}

.move-select {
  font-size: 0.72rem;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.4);
}

.btn-card-del {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-card-del:hover {
  color: var(--accent-rose);
}

/* Job Board Optimizer Tab */
.profile-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.channel-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.channel-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 0.95rem;
}

.icon-linkedin { background: #0a66c2; }
.icon-sf { background: #d71920; }
.icon-indeed { background: #2164f3; }

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.opt-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.copy-box {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 6px;
}

.copy-box pre {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e2e8f0;
  padding-right: 60px;
}

.copy-box .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

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

.checklist li {
  font-size: 0.84rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 12px;
  border-radius: 6px;
  border-left: 2px solid var(--accent-cyan);
}

.query-pills {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.query-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.query-card code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #93c5fd;
  display: block;
  margin-bottom: 4px;
}

.query-sub {
  font-size: 0.72rem;
  color: var(--accent-amber);
}

/* Master Profile & Vault */
.profile-overview {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.35);
}

.hero-info h3 {
  font-size: 1.35rem;
  font-weight: 800;
}

.hero-sub {
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.92rem;
}

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

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .profile-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.meta-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.meta-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.meta-val {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 2px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 10px 0;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.timeline-item {
  display: flex;
  gap: 16px;
}

.time-badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  height: fit-content;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  min-width: 58px;
  text-align: center;
}

.time-badge.current {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.time-content h5 {
  font-size: 0.94rem;
  font-weight: 700;
}

.time-company {
  font-size: 0.82rem;
  color: var(--accent-blue);
  display: block;
}

.time-date {
  font-size: 0.74rem;
  color: var(--text-dim);
  display: block;
  margin-bottom: 4px;
}

.time-content p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Modal Base */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  box-sizing: border-box;
}

.modal-box {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #111827;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  box-sizing: border-box;
}

.modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
}

.btn-close:hover {
  color: #fff;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  box-sizing: border-box;
}

/* Modal Form Grid */
.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.grid-span-full {
  grid-column: 1 / -1;
}

.link-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-input-group input {
  flex: 1;
  min-width: 0;
}

.launch-job-btn {
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 0.8rem;
  text-decoration: none;
  flex-shrink: 0;
}

/* Copilot Cheatsheet Drawer */
.copilot-box {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
}

.copilot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.copilot-header strong {
  color: #a7f3d0;
  font-size: 0.82rem;
}

.copilot-header span {
  font-size: 0.72rem;
  color: #94a3b8;
}

.copilot-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.copilot-btn-group button {
  flex: 1 1 auto;
  font-size: 0.75rem;
  padding: 6px 10px;
  white-space: nowrap;
}

.copilot-preview {
  font-size: 0.76rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  padding: 8px;
  display: none;
  max-height: 110px;
  overflow-y: auto;
  font-family: var(--font-mono);
  color: #e2e8f0;
  white-space: pre-wrap;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  align-items: center;
}

.modal-footer-secondary {
  display: flex;
  gap: 8px;
}

/* =========================================================
   Tight Phone Boundaries & Mobile Ergonomics (@media <= 768px)
   ========================================================= */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
  }

  .top-nav {
    padding: 10px 14px;
    gap: 10px;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-subtitle {
    font-size: 0.7rem;
  }

  .quick-stats-bar {
    display: none; /* Hide cluttered stats pills on mobile so header stays tight */
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding: 3px;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .main-content {
    padding: 10px 8px;
    overflow-x: hidden;
  }

  .pane-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .pane-header h2 {
    font-size: 1.2rem;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  .pipeline-actions {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .pipeline-actions select,
  .pipeline-actions button {
    width: 100% !important;
  }

  /* Modal Phone Strict Boundary Bounds */
  .modal-overlay {
    padding: 8px !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: calc(100vh - 16px) !important;
    margin: auto 0 !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .modal-header {
    padding: 8px 12px !important;
  }

  .modal-header h3 {
    font-size: 0.92rem !important;
    letter-spacing: -0.2px;
  }

  .modal-body {
    padding: 8px 12px !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
  }

  /* Compact 2-Column Responsive Form Grid */
  .modal-form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .grid-span-full {
    grid-column: 1 / -1 !important;
  }

  .form-group {
    margin-bottom: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .form-group label {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    color: var(--text-dim) !important;
    margin-bottom: 2px !important;
    display: block !important;
  }

  input[type="text"],
  input[type="url"],
  input[type="password"],
  select {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 0.8rem !important;
    padding: 6px 9px !important;
    height: 33px !important;
    min-height: 33px !important;
    border-radius: 6px !important;
  }

  textarea {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 0.8rem !important;
    padding: 6px 9px !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 6px !important;
  }

  .copilot-box {
    padding: 8px 10px !important;
    margin-top: 6px !important;
  }

  .copilot-header strong {
    font-size: 0.78rem !important;
  }

  .copilot-btn-group {
    gap: 4px !important;
  }

  .copilot-btn-group button {
    flex: 1 1 calc(33.3% - 4px) !important;
    font-size: 0.7rem !important;
    padding: 5px 6px !important;
  }

  /* Ergonomic mobile modal footer */
  .modal-footer {
    padding: 8px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .modal-footer button {
    width: 100% !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    font-size: 0.84rem !important;
    justify-content: center !important;
  }

  .modal-footer-secondary {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .modal-footer-secondary button {
    flex: 1 !important;
    padding: 7px 10px !important;
    font-size: 0.78rem !important;
  }

  /* Kanban 1-col on mobile */
  .kanban-board {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .kanban-col {
    min-height: auto !important;
    padding: 12px !important;
  }

  /* Grid 2col in Matcher */
  .grid-2col {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .score-card-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .analysis-sections {
    grid-template-columns: 1fr !important;
  }

  /* Intel Briefing Mobile */
  .intel-briefing-card {
    padding: 12px 14px !important;
    margin-bottom: 12px !important;
  }

  .briefing-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .briefing-quick-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 6px !important;
  }

  .briefing-quick-actions button {
    padding: 6px 4px !important;
    font-size: 0.72rem !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .briefing-action-items {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
}

/* Intel Briefing Card */
.intel-briefing-card {
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.briefing-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.briefing-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-amber);
  text-transform: uppercase;
}

.briefing-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.briefing-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.briefing-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.briefing-summary-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.briefing-status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #93c5fd;
  margin-bottom: 6px;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.briefing-narrative {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.briefing-action-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.action-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.action-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.action-content strong {
  color: #fff;
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

/* Interview Prep STAR Story Styles */
.star-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: all 0.2s ease;
}

.star-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.star-card-q {
  font-weight: 700;
  color: #93c5fd;
  font-size: 0.88rem;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.star-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.star-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.star-lbl {
  font-weight: 700;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  min-width: 48px;
  text-align: center;
  flex-shrink: 0;
}

.lbl-s { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.lbl-t { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.lbl-a { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.lbl-r { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; }

.star-txt {
  color: #cbd5e1;
}

/* ATS Bullets Area */
.ats-bullet-item {
  background: rgba(6, 182, 212, 0.05);
  border-left: 3px solid var(--accent-cyan);
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 0 6px 6px 0;
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.5;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-emerald);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Utilities */
.text-emerald { color: var(--accent-emerald) !important; }
.text-amber { color: var(--accent-amber) !important; }
.text-cyan { color: var(--accent-cyan) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-rose { color: var(--accent-rose) !important; }

