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

:root {
  --bg:        #0f0f14;
  --surface:   #17171f;
  --surface-2: #1e1e28;
  --border:    #2a2a38;
  --accent:    #6366f1;
  --accent-h:  #818cf8;
  --success:   #22c55e;
  --danger:    #ef4444;
  --warning:   #f59e0b;
  --text:      #e4e4f0;
  --text-2:    #9191a8;
  --text-3:    #5a5a72;
  --radius:    10px;
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
}

html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

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

.main {
  flex: 1;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.job-main {
  max-width: 960px;
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.header-job-name {
  color: var(--text-2);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Upload Card ──────────────────────────────────────────── */
.upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-top: 2.5rem;
}

.upload-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.upload-subtitle {
  color: var(--text-2);
  margin-bottom: 2rem;
}

/* ── Form ─────────────────────────────────────────────────── */
.upload-form { display: flex; flex-direction: column; gap: 1.5rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
}

.optional { color: var(--text-3); }

.form-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-3); }

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

/* ── Drop Zone ────────────────────────────────────────────── */
.drop-zone {
  background: var(--surface-2);
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}
.drop-zone:hover,
.drop-zone.drag-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.drop-zone.has-file { border-color: var(--success); border-style: solid; }

.drop-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 2rem;
  pointer-events: none;
}

.drop-icon { font-size: 2rem; }
.drop-primary { font-size: 0.95rem; font-weight: 500; }
.drop-secondary { font-size: 0.8rem; color: var(--text-2); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 7px;
  border: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-h); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-3); }
.btn-link { background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; }
.btn-link:hover { opacity: 0.75; }

.btn-large { padding: 0.8rem 1.8rem; font-size: 1rem; }

.btn-icon-sm {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-2);
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}
.btn-icon-sm:hover { color: var(--text); }
.btn-icon-sm.locked { color: var(--accent); border-color: var(--accent); }

/* ── Spinner ──────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Jobs List ────────────────────────────────────────────── */
.jobs-section { margin-top: 2.5rem; }
.jobs-title { font-size: 0.9rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }

.jobs-list { display: flex; flex-direction: column; gap: 1px; }

.job-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.4rem;
  transition: background 0.1s;
}
.job-row:hover { background: var(--surface-2); }

.job-name { font-weight: 500; flex: 1; }
.job-meta { color: var(--text-3); font-size: 0.8rem; font-family: var(--mono); }
.job-id { font-size: 0.75rem; }

.job-state { font-size: 0.8rem; font-weight: 500; white-space: nowrap; }
.state-complete { color: var(--success); }
.state-failed { color: var(--danger); }
.state-waiting-review { color: var(--warning); }
.state-queued { color: var(--text-3); }
.state-running-shotlist,
.state-running-search,
.state-running-download { color: var(--accent-h); }

/* ── Stage Progress ───────────────────────────────────────── */
.stages {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 2rem 0;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.stage-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-3);
  position: relative;
}

.stage-label {
  font-size: 0.72rem;
  color: var(--text-3);
  white-space: nowrap;
}

.stage-done .stage-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.stage-done .stage-label { color: var(--text-2); }

.stage-active .stage-dot {
  border-color: var(--accent);
  color: var(--accent);
}
.stage-active .stage-label { color: var(--text); font-weight: 600; }

.stage-failed .stage-dot {
  border-color: var(--danger);
  color: var(--danger);
}

.stage-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-top: -1.6rem;
  min-width: 1.5rem;
}
.stage-connector.done { background: var(--accent); }

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.pulse {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.pulse::after {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-ring 1.2s ease-out infinite;
}

/* ── Panels ───────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Log ──────────────────────────────────────────────────── */
.log-body {
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: #a8b4c8;
  background: #0a0a10;
  padding: 1rem;
  height: 340px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-line-success { color: var(--success); }
.log-line-error   { color: var(--danger); }
.log-line-info    { color: var(--accent-h); }
.log-line-dim     { color: var(--text-3); }

/* ── Progress Panel ───────────────────────────────────────── */
.progress-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.progress-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.progress-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.progress-shot-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.progress-shot-title {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

.progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-h));
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-2);
}

/* ── Sub-stage Steps ──────────────────────────────────────── */
.substage-steps {
  display: flex;
  align-items: center;
}

.substage-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.substage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  display: block;
  flex-shrink: 0;
  transition: background 0.2s;
}

.substage-name {
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
  transition: color 0.2s;
}

.substage-divider {
  flex: 1;
  height: 1px;
  background: var(--border);
  min-width: 0.75rem;
  margin: 0 0.5rem;
}

.substage-step.active .substage-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  animation: substage-pulse 1.4s ease-in-out infinite;
}
.substage-step.active .substage-name {
  color: var(--text);
  font-weight: 600;
}

.substage-step.complete .substage-dot {
  background: var(--accent);
}
.substage-step.complete .substage-name {
  color: var(--text-2);
}

@keyframes substage-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.35); opacity: 0.75; }
}

/* ── Queue Position ───────────────────────────────────────── */
.queue-position {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.2rem;
  color: var(--text-2);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ── Error Banner ─────────────────────────────────────────── */
.error-banner {
  background: color-mix(in srgb, var(--danger) 15%, var(--surface));
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  color: #fca5a5;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ── Review Panel ─────────────────────────────────────────── */
.review-hint {
  color: var(--text-2);
  font-size: 0.82rem;
}

.review-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-height: 70vh;
  overflow-y: auto;
}

.review-loading {
  color: var(--text-2);
  text-align: center;
  padding: 2rem;
}

.review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  gap: 1rem;
}

.selection-summary {
  color: var(--text-2);
  font-size: 0.85rem;
}

/* ── Shot Card ────────────────────────────────────────────── */
.shot-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.shot-header-top {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.shot-num {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--text-3);
  flex-shrink: 0;
}

.shot-timecode {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent-h);
  flex-shrink: 0;
}

.shot-context-before,
.shot-context-after {
  font-size: 0.8rem;
  color: var(--text-3);
  font-style: italic;
}

.shot-text {
  font-size: 0.9rem;
  color: var(--text);
}

.queries-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Query Block ──────────────────────────────────────────── */
.query-label {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.query-text {
  color: var(--text-2);
  font-style: italic;
}

.candidates-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ── Candidate Card ───────────────────────────────────────── */
.candidate-card {
  width: 250px;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  background: var(--surface-2);
  flex-shrink: 0;
}
.candidate-card:hover { border-color: var(--text-3); transform: translateY(-1px); }
.candidate-card.selected { border-color: var(--accent); }
.candidate-card.selected .candidate-thumb::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
  font-weight: 700;
}

.candidate-thumb {
  width: 100%;
  height: 140px;
  background: #0a0a10;
  position: relative;
  overflow: hidden;
}

.candidate-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 1.5rem;
}

.source-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  background: rgba(0,0,0,0.7);
  color: var(--text-2);
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-family: var(--mono);
}

.candidate-meta {
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-3);
}

.meta-score {
  font-family: var(--mono);
  font-size: 0.68rem;
}

.meta-slug {
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-attribution {
  font-size: 0.62rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-attribution a { color: var(--accent); text-decoration: none; }
.meta-attribution a:hover { text-decoration: underline; }

.score-high { color: var(--success); }
.score-mid  { color: var(--warning); }
.score-low  { color: var(--text-3); }

/* ── Complete Panel ───────────────────────────────────────── */
.complete-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 2rem;
  text-align: center;
}

.complete-icon {
  width: 64px;
  height: 64px;
  background: color-mix(in srgb, var(--success) 15%, var(--surface));
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--success);
}

.complete-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.complete-subtitle {
  color: var(--text-2);
  font-size: 0.9rem;
}

/* ── Feedback Form ────────────────────────────────────────── */
.feedback-section {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: left;
}

.feedback-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

.feedback-header {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  letter-spacing: 0.04em;
}

.feedback-tagline {
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
  margin-top: -0.5rem;
}

#feedback-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.feedback-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.feedback-label {
  font-size: 0.85rem;
  color: var(--text-2);
}

.feedback-optional {
  color: var(--text-3);
  font-size: 0.78rem;
}

.feedback-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.feedback-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.feedback-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}

.feedback-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
}

.feedback-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.feedback-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-3);
}

.feedback-slider-live {
  font-weight: 600;
  color: var(--text-2);
}

.feedback-slider-poles {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-3);
}

.feedback-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.feedback-chip {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.feedback-chip:hover { border-color: var(--text-3); color: var(--text); }

.feedback-chip.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--text);
}

.feedback-textarea,
.feedback-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  resize: vertical;
  transition: border-color 0.15s;
}

.feedback-textarea { min-height: 72px; }

.feedback-textarea:focus,
.feedback-input:focus {
  outline: none;
  border-color: var(--accent);
}

.feedback-textarea::placeholder,
.feedback-input::placeholder { color: var(--text-3); }

.feedback-thanks-text {
  text-align: center;
  color: var(--success);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.5rem 0;
}

/* ── Dev Section ──────────────────────────────────────────── */
.dev-section {
  border: 1px dashed #3a3a50;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dev-banner {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--warning);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dev-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-2);
  cursor: pointer;
}

.dev-option input[type="checkbox"] { cursor: pointer; }

.dev-sources { margin-top: 12px; }
.dev-sources-label { font-size: 0.75rem; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.05em; }
.dev-sources-grid { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }

/* ── Active Job Card ──────────────────────────────────────── */
.active-job-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin: 1.75rem 0 0.75rem;
}

.active-job-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.active-job-name {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-job-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-review  { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.dot-running { background: var(--accent);  animation: pulse-dot 1.4s ease-in-out infinite; }
.dot-queued  { background: var(--text-3); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.new-project-row {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0.25rem;
}

.back-btn {
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  padding: 0.35rem 0;
}

/* ── Danger button ────────────────────────────────────────── */
.btn-danger {
  background: color-mix(in srgb, var(--danger) 18%, var(--surface-2));
  border: 1px solid var(--danger);
  color: #fca5a5;
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 30%, var(--surface-2));
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.4);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-body {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* ── Auth ─────────────────────────────────────────────────── */
.auth-card {
  max-width: 420px;
  margin: 0 auto;
}

.auth-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.35);
  color: #fca5a5;
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.auth-notice {
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.35);
  color: var(--accent-h);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.auth-switch {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-2);
  margin-top: 1.25rem;
}

.auth-switch a {
  color: var(--accent-h);
  text-decoration: underline;
}

.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-2);
}

.header-user a {
  color: var(--text-3);
  font-size: 0.8rem;
}

.header-user a:hover {
  color: var(--text-2);
}

.btn-link-danger {
  color: var(--text-3);
}

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

/* ── Legal footer ─────────────────────────────────────────── */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-3);
}

.site-footer a {
  color: var(--text-3);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text-2);
  text-decoration: underline;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .upload-card { padding: 1.5rem; }
  .candidate-card { width: 200px; }
  .candidate-thumb { height: 112px; }
  .stages { gap: 0; }
  .stage-label { display: none; }
  .active-job-card { flex-direction: column; align-items: flex-start; }
  .modal-actions { flex-direction: column-reverse; }
}
