:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-muted: #4b5563;
  --color-border: #d1d5db;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-shadow: rgba(15, 23, 42, 0.06);

  /* Semantic tokens */
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-success-border: #bbf7d0;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-info-bg: #eff6ff;
  --color-info-border: #bfdbfe;
  --color-accent-bg: #f0f9ff;
  --color-accent-border: #bae6fd;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;

  /* Radius */
  --radius-xs: 0.25rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lifted: 0 8px 24px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-btn: 0 2px 8px rgba(37, 99, 235, 0.22), 0 1px 2px rgba(37, 99, 235, 0.14);
  --shadow-btn-hover: 0 6px 18px rgba(37, 99, 235, 0.28), 0 2px 4px rgba(37, 99, 235, 0.18);

  /* Gradients */
  --gradient-page: linear-gradient(160deg, #f0f2f8 0%, #f4f5f7 55%, #eef0f5 100%);
  --gradient-accent: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-accent-soft: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  --gradient-card: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(249,250,251,1) 100%);
  --gradient-btn: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #2563eb 100%);
  --gradient-hero: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 60%, #eff6ff 100%);
  --gradient-progress: linear-gradient(90deg, #2563eb 0%, #6366f1 100%);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container-width: 1100px;
  --content-width-narrow: 38rem;
  --content-width-form: 44rem;
  --content-width-brief: 56rem;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--gradient-page);
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.container {
  width: min(100% - 2rem, var(--container-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.header-inner {
  min-height: 4.5rem;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.wordmark,
.footer-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.875rem;
}

.wordmark {
  font-size: 0.875rem;
}

.footer-brand {
  font-size: 0.8125rem;
}

.header-tagline,
.footer-confidential,
.page-subtitle {
  color: var(--color-muted);
}

.header-tagline {
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  font-weight: 400;
}

.header-nav {
  min-height: 1.5rem;
}

.main-content {
  min-height: calc(100vh - 9rem);
  padding: var(--space-8) 0;
}

.site-footer {
  border-top: 1px solid rgba(229, 231, 235, 0.7);
  background: rgba(255, 255, 255, 0.7);
  padding: var(--space-4) 0;
}

.footer-inner {
  font-size: 0.9375rem;
}

.page-hero {
  margin-bottom: var(--space-6);
  max-width: 48rem;
}

.page-title {
  margin: 0 0 var(--space-3);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

.page-subtitle {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.card {
  background: var(--gradient-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

.card:hover {
  box-shadow: var(--shadow-lifted);
  transform: translateY(-1px);
}

/* Card variants */
.card--summary {
  border-color: rgba(37, 99, 235, 0.3);
  border-left-width: 4px;
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, #fafbff 0%, #f5f7ff 100%);
}

.card--summary:hover {
  box-shadow: var(--shadow-lifted);
}

.card--accent {
  border-color: var(--color-accent-border);
  background: var(--color-accent-bg);
}

.card--warning {
  border-color: var(--color-warning-border);
  background: var(--color-warning-bg);
}

.card--compact .card-header {
  padding-bottom: 0;
}

.card--compact .card-body {
  padding-top: var(--space-3);
}

.card-header {
  padding: var(--space-5) var(--space-5) 0;
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.card-body p {
  margin: 0 0 var(--space-4);
}

.card-meta {
  margin: var(--space-1) 0 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.card-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid rgba(229, 231, 235, 0.6);
  background: rgba(249, 250, 251, 0.7);
  font-size: 0.9375rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-btn);
  background-size: 200% 100%;
  background-position: 100% 0;
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background-position: 0% 0;
  box-shadow: var(--shadow-btn-hover);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-lifted);
}

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

.btn-ghost:hover {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-danger {
  background: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
}

/* ── Focus visible ────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Flow pill ────────────────────────────────────────────── */

.flow-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3125rem 0.75rem;
  border-radius: 9999px;
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid var(--color-info-border);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: 0.01em;
}

/* ── Badges & tags ────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
}

.badge--primary {
  background: var(--color-primary);
  color: #fff;
}

.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge--danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge--subtle {
  background: rgba(255, 255, 255, 0.8);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
}

.tag--subtle {
  background: rgba(249, 250, 251, 0.7);
  color: var(--color-muted);
  border-color: rgba(229, 231, 235, 0.7);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ── Section & document hierarchy ────────────────────────── */

.section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.75;
  margin: 0 0 var(--space-3);
}

.section-group {
  margin-bottom: var(--space-6);
}

.meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-5);
}

.meta-grid-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.meta-grid-item__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
}

.meta-grid-item__value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
}

/* ── Trust & info panels ──────────────────────────────────── */

.trust-panel p,
.info-panel p {
  margin: 0;
}

/* ── Form primitives ──────────────────────────────────────── */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.form-label .required-marker {
  color: var(--color-danger);
  margin-left: 0.25rem;
}

.form-label .label-hint {
  font-weight: 400;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.form-input,
.form-textarea {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea {
  resize: vertical;
  line-height: 1.6;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.form-input--error {
  border-color: var(--color-danger);
}

.form-hint {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.form-error {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  color: var(--color-danger);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* ── Dropzone ─────────────────────────────────────────────── */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-xl);
  background: rgba(249, 250, 251, 0.6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-smooth), background var(--transition-smooth);
  position: relative;
}

.dropzone:hover,
.dropzone--active {
  border-color: var(--color-primary);
  background: var(--gradient-accent-soft);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone__icon {
  font-size: 2rem;
  color: var(--color-muted);
}

.dropzone__hint {
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.dropzone__hint strong {
  color: var(--color-primary);
}

.dropzone__file {
  font-size: 0.875rem;
  color: var(--color-success);
  font-weight: 500;
}

/* ── Step indicator ───────────────────────────────────────── */

.step-indicator {
  margin-bottom: var(--space-5);
}

.step-indicator__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.step-indicator__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
}

.step-indicator__item + .step-indicator__item::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 1px;
  background: var(--color-border);
  margin: 0 var(--space-2);
  flex-shrink: 0;
}

.step-indicator__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
}

.step-indicator__item--current .step-indicator__marker {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.step-indicator__item--current .step-indicator__label {
  color: var(--color-text);
  font-weight: 600;
}

.step-indicator__item--completed .step-indicator__marker {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: var(--color-success);
}

.step-indicator__item--completed .step-indicator__label {
  color: var(--color-muted);
}

.step-indicator__label {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .step-indicator__label {
    display: none;
  }

  .step-indicator__item + .step-indicator__item::before {
    width: 1rem;
    margin: 0 var(--space-1);
  }
}

/* ── Loading / synthesis states ───────────────────────────── */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-5);
  text-align: center;
}

.loading-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
}

.loading-steps li {
  font-size: 0.9375rem;
  color: var(--color-muted);
  padding-left: var(--space-5);
  position: relative;
}

.loading-steps li::before {
  content: '·';
  position: absolute;
  left: var(--space-3);
  color: var(--color-primary);
}

/* ── Hero gradient ────────────────────────────────────────── */

.page-hero--gradient {
  background: var(--gradient-hero);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-6) var(--space-5);
  margin-bottom: var(--space-6);
  border: 1px solid rgba(191, 219, 254, 0.5);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.06);
}

.page-hero--gradient .page-title {
  color: var(--color-text);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

@media (max-width: 768px) {
  .main-content {
    padding: var(--space-6) 0;
  }

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

  .header-inner {
    min-height: 3.5rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .header-tagline {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(100% - 1.25rem, var(--container-width));
  }

  .page-title {
    font-size: 1.75rem;
  }

  .card-header,
  .card-body {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .page-hero--gradient {
    padding: var(--space-4) var(--space-4) var(--space-4);
    border-radius: var(--radius-md);
  }

  .intake-cta-row .btn-lg {
    width: 100%;
    justify-content: center;
  }
}

/* ── Intake flow ──────────────────────────────────────────── */

.intake-cta-row {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.landing-trust-line {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* Landing — step list */
.intake-flow-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  max-width: 36rem;
}

.flow-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.flow-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.flow-step p {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

/* Upload card — width constraint only; primitives from shared form stack */
.upload-card {
  max-width: 36rem;
}

/* Legacy upload-specific selectors kept for backward compatibility */
.upload-field {
  margin-bottom: var(--space-5);
}

.upload-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.upload-input {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-family: var(--font-sans);
  font-size: 1rem;
}

.upload-hint {
  margin: var(--space-2) 0 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* Legacy trust-copy — prefer .trust-panel from shared primitives */
.trust-copy {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  font-size: 0.9375rem;
  color: var(--color-muted);
}

.trust-copy p {
  margin: 0;
}


/* Progress bar */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.progress-bar-track {
  flex: 1;
  height: 0.5rem;
  background: var(--color-border);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-progress);
  border-radius: 9999px;
  transition: width var(--transition-slow);
}

.progress-label {
  font-size: 0.875rem;
  color: var(--color-muted);
  white-space: nowrap;
}

/* Conversation */
.conversation-card {
  /* Width fills the main column — constrained by the grid */
}

.conversation-card__progress {
  padding: var(--space-4) var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-4);
}

.conversation-card__context {
  margin: var(--space-2) 0 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.conversation-question {
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--color-text);
}

.conversation-field {
  margin-bottom: var(--space-5);
}

.conversation-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  resize: vertical;
  line-height: 1.6;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.conversation-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.conversation-actions {
  display: flex;
  justify-content: flex-end;
}

.conversation-actions--split {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Synthesis */
.synthesis-card {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}

.synthesis-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.synthesis-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid rgba(37, 99, 235, 0.12);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

.synthesis-title {
  margin: 0;
  font-size: 1.5rem;
}

.synthesis-description {
  margin: 0;
  color: var(--color-muted);
}

.synthesis-trust {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-style: italic;
}

/* Brief */
.brief-card {
  margin-bottom: var(--space-5);
}

.brief-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.brief-list {
  margin: 0;
  padding-left: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.brief-badges-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* brief-badge-item and brief-badge defined below in WP-001 section */

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

/* ── Hiring intake — vacancy form ─────────────────────────── */

/* Width constraint only — field primitives use shared .form-group/.form-input/.form-textarea */
.vacancy-card {
  /* Width fills the flow-main column — no additional max-width needed */
}

/* Legacy vacancy-specific selectors kept for backward compatibility */
.vacancy-field-group {
  margin-bottom: var(--space-5);
}

.vacancy-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.vacancy-label-hint {
  font-weight: 400;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.vacancy-input {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-family: var(--font-sans);
  font-size: 1rem;
}

.vacancy-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.vacancy-textarea {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-family: var(--font-sans);
  font-size: 1rem;
  resize: vertical;
  line-height: 1.6;
}

.vacancy-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

/* ── Page entrance animation ──────────────────────────────── */

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

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

.animate-in {
  animation: fadeSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ── Eyebrow label ────────────────────────────────────────── */

.eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.8;
  margin-bottom: var(--space-2);
}

/* ── Brief document refinements ───────────────────────────── */

.brief-badge-item {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.brief-badge {
  display: inline-block;
  background: var(--gradient-accent);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 0.25rem 0.75rem;
  font-weight: 600;
  font-size: 1rem;
}

/* ── Btn-lg override ──────────────────────────────────────── */

.btn-lg {
  padding: 0.875rem 1.625rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* ── Trust & info panel refinements ──────────────────────── */

.trust-panel {
  background: rgba(249, 250, 251, 0.7);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: var(--radius-lg);
  color: var(--color-muted);
  padding: var(--space-4) var(--space-5);
  font-size: 0.9375rem;
}

.info-panel {
  background: var(--gradient-accent-soft);
  border: 1px solid rgba(191, 219, 254, 0.5);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  padding: var(--space-4) var(--space-5);
  font-size: 0.9375rem;
}

/* ═══════════════════════════════════════════════════════════
   WP-001 — Shared visual system additions
   ═══════════════════════════════════════════════════════════ */

/* ── Additional design tokens ─────────────────────────────── */
:root {
  --color-purple: #7c3aed;
  --color-purple-dark: #6d28d9;
  --color-purple-soft: #f5f3ff;
  --color-purple-border: #ddd6fe;
  --gradient-glow-top: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99, 102, 241, 0.09) 0%, transparent 70%);
  --gradient-hero-premium: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 55%, #f0fdfa 100%);
  --shadow-document: 0 4px 24px rgba(15, 23, 42, 0.07), 0 1px 4px rgba(15, 23, 42, 0.05);
}

/* ── Page shell — radial background glow ─────────────────── */

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60vh;
  background: var(--gradient-glow-top);
  pointer-events: none;
  z-index: 0;
}

.main-content {
  position: relative;
  z-index: 1;
}

/* ── Flow hero partial ────────────────────────────────────── */

.flow-hero {
  background: var(--gradient-hero-premium);
  border: 1px solid rgba(191, 219, 254, 0.5);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: 0 2px 14px rgba(37, 99, 235, 0.07);
  max-width: 54rem;
}

.flow-hero__eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.8;
  margin-bottom: var(--space-2);
}

.flow-hero__title {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-text);
}

.flow-hero__subtitle {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-muted);
  max-width: 42rem;
}

.flow-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.flow-hero__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(191, 219, 254, 0.4);
}

.flow-hero__step {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.flow-hero__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.8125rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.flow-hero__step-title {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.flow-hero__step-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.flow-hero__cta {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.flow-hero__trust {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.flow-hero__output-preview {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.flow-hero__output-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.flow-hero__output-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.75;
  margin-bottom: var(--space-1);
}

.flow-hero__output-text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.55;
}

/* ── Split intake layout ──────────────────────────────────── */

.split-intake-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: var(--space-6);
  align-items: start;
}

.split-intake-layout__main {
  min-width: 0;
}

.split-intake-layout__rail {
  position: sticky;
  top: calc(4.5rem + var(--space-5));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.rail-block {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.rail-block__eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.75;
  margin: 0 0 var(--space-3);
}

.rail-block__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.55;
}

.rail-block__text + .rail-block__text {
  margin-top: var(--space-2);
}

@media (max-width: 820px) {
  .split-intake-layout {
    grid-template-columns: 1fr;
  }

  .split-intake-layout__rail {
    position: static;
  }
}

/* ── Document header partial ──────────────────────────────── */

.document-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}

.document-header__eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.8;
  margin-bottom: var(--space-2);
}

.document-header__title {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text);
}

.document-header__subtitle {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--color-muted);
  line-height: 1.55;
}

.document-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  align-items: center;
  margin-top: var(--space-4);
}

.document-header__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.document-header__meta-label {
  font-weight: 600;
  color: var(--color-text);
}

.document-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* ── Synthesis checklist partial ──────────────────────────── */

.synthesis-checklist {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: left;
  width: 100%;
  max-width: 28rem;
}

.synthesis-checklist__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9375rem;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(229, 231, 235, 0.4);
  transition: background var(--transition-smooth), color var(--transition-smooth), border-color var(--transition-smooth);
  color: var(--color-muted);
}

.synthesis-checklist__item--done {
  color: var(--color-text);
  background: rgba(240, 253, 244, 0.8);
  border-color: rgba(187, 247, 208, 0.7);
}

.synthesis-checklist__item--active {
  color: var(--color-primary);
  background: rgba(239, 246, 255, 0.9);
  border-color: rgba(191, 219, 254, 0.7);
  font-weight: 500;
}

.synthesis-checklist__item--pending {
  opacity: 0.4;
}

.synthesis-checklist__icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
}

.synthesis-checklist__icon--done {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.synthesis-checklist__icon--active {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  position: relative;
  overflow: hidden;
}

.synthesis-checklist__icon--active::after {
  content: '';
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-primary);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.synthesis-checklist__icon--pending {
  background: rgba(229, 231, 235, 0.5);
  border: 1px solid rgba(209, 213, 219, 0.6);
}

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

/* ── Step indicator — rail variant ────────────────────────── */

.step-indicator--rail .step-indicator__list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

.step-indicator--rail .step-indicator__item + .step-indicator__item::before {
  flex: 1;
  width: auto;
  min-width: 2rem;
  height: 2px;
  background: var(--color-border);
  margin: 0 0.25rem;
}

.step-indicator--rail .step-indicator__item--completed + .step-indicator__item::before {
  background: var(--gradient-progress);
}

.step-indicator--rail .step-indicator__marker {
  width: 1.75rem;
  height: 1.75rem;
}

/* ── Card additional variants ─────────────────────────────── */

.card--elevated {
  box-shadow: var(--shadow-document);
  border-color: rgba(229, 231, 235, 0.5);
}

.card--document {
  background: var(--color-surface);
  border: 1px solid rgba(229, 231, 235, 0.6);
  box-shadow: var(--shadow-document);
  border-radius: var(--radius-lg);
}

.card--subtle {
  background: rgba(249, 250, 251, 0.6);
  border-color: rgba(229, 231, 235, 0.5);
  box-shadow: none;
}

/* ── Header refinements ───────────────────────────────────── */

.header-flow-label {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid var(--color-info-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  letter-spacing: 0.01em;
}

/* ── Reduced motion ───────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Flow page layout (upload / vacancy) ──────────────────── */

.flow-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: var(--space-5) var(--space-6);
  align-items: start;
}

.flow-hero-card {
  grid-column: 1;
  margin-bottom: 0;
  max-width: none;
}

.flow-main {
  grid-column: 1;
  min-width: 0;
}

.flow-aside {
  grid-column: 2;
  grid-row: 1 / 3;
  position: sticky;
  top: calc(4.5rem + var(--space-5));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 820px) {
  .flow-page {
    grid-template-columns: 1fr;
  }

  .flow-hero-card,
  .flow-main {
    grid-column: 1;
  }

  .flow-aside {
    grid-column: 1;
    grid-row: auto;
    position: static;
  }
}

/* ── Flow preview card (landing "What you receive") ───────── */

.flow-preview-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(191, 219, 254, 0.5);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.05);
  max-width: 54rem;
}

.flow-preview-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.flow-preview-card__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.flow-preview-card__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.75;
  margin-bottom: var(--space-1);
}

.flow-preview-card__text {
  margin: 0 0 var(--space-4);
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.6;
}

/* ── Answer summary (conversation rail) ─────────────────────── */

.answer-summary {
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.answer-summary__header {
  display: block;
  padding: var(--space-2) var(--space-3);
  background: rgba(249, 250, 251, 0.8);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.answer-summary-list {
  display: flex;
  flex-direction: column;
}

.answer-summary-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(229, 231, 235, 0.4);
}

.answer-summary-item:last-child {
  border-bottom: none;
}

.answer-summary-item__question {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-muted);
  line-height: 1.4;
}

.answer-summary-item__answer {
  font-size: 0.8125rem;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Previous answers summary ─────────────────────────────── */

.conversation-answers {
  margin-bottom: var(--space-5);
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.conversation-answers__header {
  display: block;
  padding: var(--space-2) var(--space-4);
  background: rgba(249, 250, 251, 0.8);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.conversation-answers__list {
  display: flex;
  flex-direction: column;
}

.conversation-answer-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgba(229, 231, 235, 0.4);
}

.conversation-answer-item:last-child {
  border-bottom: none;
}

.conversation-answer-item__question {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-muted);
  line-height: 1.4;
}

.conversation-answer-item__answer {
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.5;
}

/* ── Synthesis split layout ───────────────────────────────── */

.synthesis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: var(--space-6);
  align-items: start;
}

.synthesis-layout__main {
  min-width: 0;
}

.synthesis-layout__side {
  position: sticky;
  top: calc(4.5rem + var(--space-5));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 820px) {
  .synthesis-layout {
    grid-template-columns: 1fr;
  }

  .synthesis-layout__side {
    position: static;
  }
}

/* Synthesis card — non-centered split variant */
.synthesis-card--split {
  padding: var(--space-5);
}

.synthesis-status {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.synthesis-title--inline {
  font-size: 1.25rem;
  margin: 0 0 var(--space-1);
}

.synthesis-checklist-wrap {
  margin-bottom: var(--space-4);
}

.synthesis-checklist-wrap .synthesis-checklist {
  max-width: none;
  margin-top: 0;
}

/* ── Synthesis preview sections ───────────────────────────── */

.synthesis-preview-header {
  margin-bottom: 0;
}

.synthesis-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.synthesis-preview__section {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.synthesis-preview__section--done {
  background: rgba(240, 253, 244, 0.6);
  border-color: rgba(187, 247, 208, 0.6);
}

.synthesis-preview__section--active {
  background: rgba(239, 246, 255, 0.85);
  border-color: rgba(191, 219, 254, 0.7);
}

.synthesis-preview__section--pending {
  opacity: 0.4;
}

.synthesis-preview__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

.synthesis-preview__section--done .synthesis-preview__label {
  color: var(--color-success);
}

.synthesis-preview__section--active .synthesis-preview__label {
  color: var(--color-primary);
}

.synthesis-preview__line {
  height: 0.45rem;
  border-radius: 9999px;
  background: rgba(209, 213, 219, 0.45);
  margin-bottom: var(--space-1);
}

.synthesis-preview__line:last-child {
  margin-bottom: 0;
}

.synthesis-preview__section--done .synthesis-preview__line {
  background: rgba(134, 239, 172, 0.45);
}

.synthesis-preview__section--active .synthesis-preview__line {
  background: linear-gradient(90deg, rgba(147, 197, 253, 0.7) 0%, rgba(209, 213, 219, 0.25) 100%);
  animation: shimmer-line 1.8s ease-in-out infinite;
}

@keyframes shimmer-line {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ═══════════════════════════════════════════════════════════
   WP-002 — Landing and intake entry page polish
   ═══════════════════════════════════════════════════════════ */

/* ── Brief sample preview — skeleton preview of output ────── */

.brief-sample-preview {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: var(--radius-md);
}

.brief-sample-preview__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.brief-sample-preview__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.6;
  margin-bottom: 0.125rem;
}

.brief-sample-preview__bar {
  display: block;
  height: 0.4rem;
  border-radius: 9999px;
  background: rgba(209, 213, 219, 0.55);
}

.brief-sample-preview__bar--wide { width: 85%; }
.brief-sample-preview__bar--med  { width: 62%; }
.brief-sample-preview__bar--short { width: 45%; }

.brief-sample-preview__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.brief-sample-preview__tag {
  display: block;
  height: 1.25rem;
  width: 3.5rem;
  border-radius: var(--radius-sm);
  background: rgba(209, 213, 219, 0.45);
}

.brief-sample-preview__tag--wide {
  width: 5rem;
}

/* ── Page hero — gradient variant with step indicator ─────── */

.page-hero--gradient .step-indicator {
  margin-top: var(--space-4);
  margin-bottom: 0;
}

/* Ensure step indicator fits comfortably inside the gradient hero */
@media (max-width: 480px) {
  .page-hero--gradient .step-indicator__label {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-006 — Responsive, accessibility & motion hardening pass
   ═══════════════════════════════════════════════════════════ */

/* ── Focus rings — enhanced visibility ────────────────────── */

/* Global focus override: stronger ring and glow */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15);
}

/* Inline form fields: ring inside rather than outside */
.form-input:focus-visible,
.form-textarea:focus-visible,
.conversation-textarea:focus-visible,
.vacancy-input:focus-visible,
.vacancy-textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 0;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Secondary / ghost buttons need their own focus ring */
.btn-secondary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Danger button focus contrast */
.btn-danger:focus-visible {
  outline: 2px solid var(--color-danger);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

/* ── Touch targets — minimum 44 px on touch devices ───────── */

@media (pointer: coarse) {
  .btn {
    min-height: 2.75rem; /* ≈ 44px */
  }

  .btn-sm {
    min-height: 2.25rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .form-input,
  .form-textarea,
  .conversation-textarea,
  .vacancy-input,
  .vacancy-textarea {
    min-height: 2.75rem;
  }

  /* Dropzone file input overlay must be tappable */
  .dropzone {
    min-height: 8rem;
  }
}

/* ── Tablet refinements — 481 px to 820 px ────────────────── */

@media (min-width: 481px) and (max-width: 820px) {
  /* Tighten flow hero padding */
  .flow-hero {
    padding: var(--space-5);
  }

  /* Rail and synthesis side: reduce internal padding when stacked */
  .split-intake-layout__rail .rail-block,
  .synthesis-layout__side .rail-block,
  .flow-aside .rail-block {
    padding: var(--space-3) var(--space-4);
  }

  /* Document header: less vertical breathing at tablet */
  .document-header {
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
  }

  /* Step indicator labels: smaller but keep visible at tablet */
  .step-indicator__label {
    font-size: 0.75rem;
  }

  /* Brief two-col: tighter gap when stacked */
  .brief-two-col {
    gap: var(--space-4);
  }

  /* Synthesis layout: tighter gap */
  .synthesis-layout {
    gap: var(--space-5);
  }

  /* Synthesis card padding when in split view at tablet */
  .synthesis-card--split {
    padding: var(--space-4);
  }

  /* Conversation card: full width at tablet (already no max-width) */
}

/* ── Additional mobile refinements — max 480 px ───────────── */

@media (max-width: 480px) {
  /* Form actions: stack buttons full-width */
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Conversation actions: stack on narrow screens */
  .conversation-actions,
  .conversation-actions--split {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .conversation-actions .btn,
  .conversation-actions--split .btn {
    width: 100%;
    justify-content: center;
  }

  /* Document header: compact on mobile */
  .document-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
  }

  .document-header__title {
    font-size: clamp(1.5rem, 6vw, 1.875rem);
  }

  .document-header__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .document-header__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Flow hero: compact on mobile */
  .flow-hero {
    padding: var(--space-4);
  }

  .flow-hero__steps {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .flow-hero__cta {
    align-items: stretch;
  }

  .flow-hero__cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* Rail blocks: reduced padding when stacked */
  .split-intake-layout__rail .rail-block,
  .synthesis-layout__side .rail-block,
  .flow-aside .rail-block {
    padding: var(--space-3) var(--space-4);
  }

  /* Brief: tighten gap on mobile */
  .brief-two-col {
    gap: var(--space-3);
  }

  /* Synthesis card: left-align for mobile readability */
  .synthesis-card {
    text-align: left;
  }

  .synthesis-body {
    align-items: flex-start;
  }

  /* Vacancy and conversation cards: full width on mobile (already no max-width) */

  /* Upload card: full width on mobile (already no max-width) */

  /* Meta grid: tighter gap */
  .meta-grid {
    gap: var(--space-2) var(--space-3);
  }

  /* Intake flow steps: tighter on mobile */
  .intake-flow-steps {
    gap: var(--space-4);
  }
}

/* ── Reduced-motion — targeted element overrides ──────────── */

/* The global rule above uses 0.01ms duration, which keeps elements
   fully visible. These overrides remove decorative shimmer and pulse
   entirely to ensure a genuinely still experience. */

@media (prefers-reduced-motion: reduce) {
  /* Synthesis spinner: static ring — no rotation */
  .synthesis-spinner {
    animation: none !important;
    border-color: rgba(37, 99, 235, 0.25);
    border-top-color: var(--color-primary);
    opacity: 0.75;
  }

  /* Checklist pulse dot: solid static dot */
  .synthesis-checklist__icon--active::after {
    animation: none !important;
    opacity: 0.85;
    transform: scale(1);
  }

  /* Shimmer line: static gradient — no pulsing */
  .synthesis-preview__section--active .synthesis-preview__line {
    animation: none !important;
    background: rgba(147, 197, 253, 0.55);
  }

  /* Progress bar fill: instant width change */
  .progress-bar-fill {
    transition: none !important;
  }

  /* Page entrance: elements appear immediately */
  .animate-in {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  /* Card hover: no lift on reduced-motion */
  .card:hover,
  .card--summary:hover {
    transform: none;
  }

  /* Button hover: no lift */
  .btn:hover {
    transform: none;
  }
}

/* ── Print — brief and document readability ───────────────── */

@media print {
  /* Remove decorative page chrome */
  body::before {
    display: none;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.55;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-header,
  .site-footer,
  .step-indicator,
  .flow-hero,
  .split-intake-layout__rail,
  .synthesis-layout__side,
  .flow-aside,
  .document-header__actions,
  .intake-cta-row,
  .conversation-actions,
  .form-actions {
    display: none !important;
  }

  .main-content {
    padding: 0;
    min-height: auto;
  }

  .container {
    width: 100%;
    max-width: none;
  }

  /* Cards: flat borders only */
  .card,
  .card--document,
  .card--elevated,
  .card--summary {
    box-shadow: none !important;
    border: 1px solid #ccc;
    border-radius: 0;
    background: #fff !important;
  }

  /* Document header: stronger rule separator */
  .document-header {
    border-bottom: 2px solid #000;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }

  .document-header__title {
    font-size: 22pt;
    color: #000;
    letter-spacing: -0.02em;
  }

  .document-header__eyebrow {
    color: #444;
    opacity: 1;
  }

  .section-label {
    color: #444;
    opacity: 1;
  }

  /* Brief two-col: keep side by side in print */
  .brief-two-col {
    grid-template-columns: repeat(2, 1fr);
  }

  .brief-badge-item {
    background: #f5f5f5 !important;
    border-color: #ccc;
  }

  .brief-badge {
    background: #222 !important;
    color: #fff;
  }

  /* Hide buttons */
  .btn {
    display: none !important;
  }

  /* Suppress link underlines */
  a {
    color: inherit;
    text-decoration: none;
  }

  @page {
    margin: 1.5cm;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-002 — Brief refinement workspace layout
   ═══════════════════════════════════════════════════════════ */

/* ── Brief workspace two-column layout ────────────────────── */

.brief-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22rem;
  gap: var(--space-6);
  align-items: start;
  max-width: var(--container-width);
  margin: 0 auto;
}

.brief-workspace__main {
  min-width: 0;
}

.brief-workspace__aside {
  position: sticky;
  top: calc(4.5rem + var(--space-5));
}

@media (max-width: 820px) {
  .brief-workspace {
    grid-template-columns: 1fr;
  }

  .brief-workspace__aside {
    position: static;
  }
}

/* ── Refinement panel ─────────────────────────────────────── */

.refinement-panel {
  background: var(--color-surface);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.refinement-panel__header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(229, 231, 235, 0.6);
  background: var(--gradient-accent-soft);
}

.refinement-panel__eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0.8;
  margin-bottom: var(--space-1);
}

.refinement-panel__title {
  margin: 0 0 var(--space-1);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.refinement-panel__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.refinement-panel__body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
}

.refinement-panel__prompt-label {
  margin: 0 0 var(--space-2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted);
}

.refinement-chip-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.refinement-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-border);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.refinement-chip:hover {
  border-color: var(--color-primary);
  background: var(--color-info-bg);
  color: var(--color-primary);
}

.refinement-panel__input-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.refinement-panel__input {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  resize: none;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-surface);
  margin-bottom: var(--space-3);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.refinement-panel__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.refinement-panel__action {
  width: 100%;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.refinement-panel__demo-note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
  text-align: center;
  font-style: italic;
  line-height: 1.45;
}

/* Hide the refinement panel and collapse to single column in print */

@media print {
  .brief-workspace {
    grid-template-columns: 1fr !important;
  }

  .brief-workspace__aside {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-003 — Hiring intake conversation and loading polish
   ═══════════════════════════════════════════════════════════ */

/* ── Vacancy form actions footer ────────────────────────── */

.vacancy-form-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.vacancy-form-actions__note {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

/* ── Conversation prompt — assistant-style question block ── */

.conversation-prompt-wrap {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--gradient-accent-soft);
  border-radius: 0; /* card handles outer radius */
}

.conversation-prompt {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.conversation-prompt__indicator {
  flex-shrink: 0;
  margin-top: 0.2rem;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.conversation-prompt__text {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text);
}

/* ── Conversation composer label ─────────────────────────── */

.conversation-composer-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

/* ── Conversation context label ──────────────────────────── */

.conversation-card__context-label {
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

/* ── Answer history list (improved rail) ─────────────────── */

.answer-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.answer-history-item {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  padding: var(--space-3) 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  counter-increment: answer-counter;
}

.answer-history-item:first-child {
  padding-top: var(--space-2);
}

.answer-history-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.answer-history-item__q {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  line-height: 1.4;
}

.answer-history-item__a {
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 820px) {
  .conversation-prompt-wrap {
    border-radius: 0;
  }

  .answer-history-item__a {
    -webkit-line-clamp: 2;
  }
}

/* ── Placeholder text — explicit legible color ────────────── */

.form-input::placeholder,
.form-textarea::placeholder,
.conversation-textarea::placeholder,
.vacancy-input::placeholder,
.vacancy-textarea::placeholder,
.refinement-panel__input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* ── Section labels and eyebrows — remove opacity wash ───── */
/* Previously these used color: primary + opacity: 0.6–0.8,
   which caused low contrast on off-white surfaces. Using
   --color-primary-dark directly gives a clean, readable label. */

.section-label,
.eyebrow,
.flow-hero__eyebrow,
.flow-hero__output-label,
.document-header__eyebrow,
.rail-block__eyebrow,
.refinement-panel__eyebrow,
.brief-sample-preview__label,
.flow-preview-card__label {
  color: var(--color-primary-dark);
  opacity: 1;
}

/* ── Sidebar rail text — bump to full token weight ─────────── */

.rail-block__text {
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* ── Answer summary headers — consistent muted style ────────── */

.answer-summary__header,
.conversation-answers__header {
  color: var(--color-muted);
  opacity: 1;
}

/* ── Synthesis pending items — slightly more visible ─────────── */

.synthesis-checklist__item--pending {
  opacity: 0.55;
}

/* ── Status badge normalization ──────────────────────────────── */
/* Ensure .badge always carries explicit font-weight and a visible
   border so states remain distinguishable. */

.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge--info {
  background: var(--color-info-bg);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-info-border);
}

/* ── Focus ring — strengthen for inline text fields ──────────── */
/* Supplement to WP-006: add explicit box-shadow to legacy field
   selectors that share focus styling with the shared form stack. */

.upload-input:focus,
.upload-input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 0;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* ── Card borders — use updated --color-border token ─────────── */
/* Cards that use hardcoded semi-transparent gray get a subtle
   border-color reinforcement via the card base rule. */

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

/* ═══════════════════════════════════════════════════════════
   WP-002 — Normalize shared shells and partials
   ═══════════════════════════════════════════════════════════ */

/* ── Skip-to-content link ─────────────────────────────────── */

.skip-to-content {
  position: absolute;
  top: -9999px;
  left: var(--space-4);
  z-index: 999;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: var(--space-3);
}

/* ── Document header — top row (eyebrow + status badge) ────── */

.document-header__top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

/* Eyebrow inside the top row — remove its own bottom margin */
.document-header__top .document-header__eyebrow {
  margin-bottom: 0;
}

.document-header__status-badge {
  font-size: 0.75rem;
  padding: 0.1875rem 0.5625rem;
}

/* ── Refinement panel — remove demo-note residual space ──────── */

.refinement-panel__demo-note {
  display: none;
}

/* ── Answer-summary rail — improved readability ────────────── */

.answer-summary-item__question {
  font-size: 0.75rem;
}

.answer-summary-item__answer {
  font-size: 0.875rem;
}

/* ── Rail block — ensure consistent border at all sizes ───────── */

@media (max-width: 820px) {
  .split-intake-layout__rail .rail-block + .rail-block {
    border-top: none; /* blocks already have own border via border property */
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-004 — Elevate hiring brief and workspace
   ═══════════════════════════════════════════════════════════ */

/* ── Brief chapter divider ──────────────────────────────── */
/* Creates a subtle horizontal rule between major document
   sections (Role context, Requirements, Search strategy,
   Open questions) so the brief reads as a structured
   document rather than a stack of cards. */

.brief-chapter-break {
  border: none;
  border-top: 1px solid rgba(209, 213, 219, 0.55);
  margin: 0 0 var(--space-6);
}

/* ── Open questions — left-accent card ─────────────────── */
/* Distinct from the base card--subtle to signal a
   review-action state without using a full warning card. */

.brief-open-questions {
  border-left: 3px solid var(--color-warning-border);
}

.brief-open-questions__list {
  color: var(--color-muted);
}

/* ── Refinement panel — "Brief notes" title sizing ─────── */
/* The panel title is now "Brief notes" which is shorter;
   keep it at the same weight but slightly larger for
   readability as a review workspace heading. */

.refinement-panel__title {
  font-size: 1.0625rem;
}

/* ── Brief action row — bordered variant used at bottom of brief pages */
/* Overrides the default top-margin with border + padding so the    */
/* action row reads as a clear document footer.                       */

.intake-cta-row--brief {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
  margin-top: var(--space-2);
}

/* ── Brief industries / tag strip ───────────────────────── */
/* Inline tag row for target industries and similar attribute  */
/* groups on brief pages — replaces inline style block.        */

.brief-tag-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-5);
  background: rgba(239, 246, 255, 0.5);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-lg);
}

.brief-tag-strip__label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted);
  white-space: nowrap;
}

.brief-tag-strip__divider {
  width: 1px;
  height: 1rem;
  background: var(--color-border);
  flex-shrink: 0;
}

/* ── Brief meta row — bottom-spaced variant ─────────────── */

.meta-grid--brief {
  margin-bottom: var(--space-6);
}

/* ── Brief meta row — flush (no bottom margin, used in cards) */

.meta-grid--flush {
  margin-bottom: 0;
}

/* ── Card title with inline badge ───────────────────────── */
/* Ensures badge sits baseline-aligned next to the title text */

.card-title--with-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── Brief card spacing — stacked cards with gap below ──── */

.brief-card-spaced {
  margin-bottom: var(--space-4);
}

/* ── Brief body typography ───────────────────────────────── */
/* Consistent body text sizes for brief content blocks;       */
/* replaces per-element inline font/line-height rules.        */

.brief-body-lead {
  font-size: 1.0625rem;
  line-height: 1.75;
  margin: 0 0 var(--space-4);
}

.brief-body-lead:last-child {
  margin-bottom: 0;
}

.brief-body-secondary {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.brief-body-text {
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
}

/* ── Brief summary card body top padding ────────────────── */

.card-body--summary {
  padding-top: var(--space-5);
}

/* ── Brief summary lead paragraph ───────────────────────── */

.brief-summary-lead {
  font-size: 1.125rem;
  line-height: 1.75;
  margin: 0;
  font-weight: 400;
  color: var(--color-text);
}

/* ── Brief confidence note ───────────────────────────────── */

.brief-confidence-note {
  margin: 0 0 var(--space-6);
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* ── Brief footer note ───────────────────────────────────── */

.brief-footer-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* ── Open questions heading layout ───────────────────────── */

.brief-open-questions__heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9375rem;
}

.brief-open-questions__note {
  font-weight: 400;
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* ── Skills group label — replaces inline style ─────────── */

.skills-group-label {
  margin: 0 0 var(--space-2);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted);
}

/* ── Tag list with bottom spacing for adjacent groups ────── */

.tag-list--spaced {
  margin-bottom: var(--space-4);
}

/* ── Meta grid item variants ─────────────────────────────── */

.meta-grid-item--full {
  flex-basis: 100%;
  margin-top: var(--space-2);
}

.meta-grid-item__value--tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.meta-grid-item__value--muted {
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════
   WP-007 — Home page lift and final responsive hardening
   ═══════════════════════════════════════════════════════════ */

/* ── Home paths grid ──────────────────────────────────────── */

.home-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  max-width: 52rem;
}

/* ── Home path card — eyebrow spacing ────────────────────── */

.home-path-card__eyebrow {
  display: block;
  margin-bottom: var(--space-2);
}

/* ── Home path steps ──────────────────────────────────────── */

.home-path-steps {
  list-style: none;
  counter-reset: home-step;
  padding: var(--space-4) 0 0;
  margin: 0 0 var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border-top: 1px solid rgba(229, 231, 235, 0.6);
}

.home-path-steps li {
  counter-increment: home-step;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.45;
}

.home-path-steps li::before {
  content: counter(home-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: 0.75rem;
}

/* ── Home path CTA block ──────────────────────────────────── */

.home-path-card__cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.home-path-card__trust {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

/* ── Responsive: stack home paths on tablet and mobile ────── */

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

@media (max-width: 480px) {
  .home-path-card__cta .btn-lg {
    width: 100%;
    justify-content: center;
  }
}

/* ── Final responsive hardening — sidebar overflow guard ──── */
/* Prevent any brief-workspace or split-intake-layout from
   overflowing the viewport at narrow widths. */

.brief-workspace,
.split-intake-layout {
  min-width: 0;
  overflow: hidden;
}

/* Ensure brief-two-col stacks on mobile */

@media (max-width: 480px) {
  .brief-two-col {
    display: flex;
    flex-direction: column;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-001 — Stabilize shared intake shell and right rail
   ═══════════════════════════════════════════════════════════ */

/* ── Intake-scoped spacing tokens ────────────────────────── */
/* These custom properties scope common measurements to the
   intake shell so tweaks here do not bleed into other surfaces. */

:root {
  --intake-rail-gap: var(--space-4);
  --intake-rail-min-answers-height: 4.5rem;
  --intake-card-padding: var(--space-5);
}

/* ── Split layout: ensure top alignment of the rail ──────── */
/* align-items: start is already set on the base rule, but
   explicitly reinforce it here so overrides in other WPs
   cannot push the rail below the first main card. */

.split-intake-layout {
  align-items: start;
}

/* ── Rail gap normalisation ──────────────────────────────── */
/* Ensure the gap between rail blocks matches the intake token. */

.split-intake-layout__rail {
  gap: var(--intake-rail-gap);
}

/* ── Rail answers block — stable reserved height ─────────── */
/* The answers block is always rendered, even when empty on
   question 1.  Reserve a minimum height so the rail does not
   jump when the first answer appears on question 2+. */

.rail-block--answers {
  min-height: var(--intake-rail-min-answers-height);
}

/* ── Empty answers state — intentional, not broken ──────── */
/* On question 1 there are no previous answers.  The text is
   styled as a subdued placeholder rather than an error. */

.rail-answers-empty {
  font-style: italic;
  color: var(--color-muted);
  opacity: 0.7;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0;
}

/* ── Rail block rhythm — consistent vertical cadence ──────── */
/* Ensure the first rail block is always flush with the top of
   the main card by removing any auto margin from the sticky
   container. */

.split-intake-layout__rail {
  margin-top: 0;
}

/* ── Responsive: preserve reserved height when stacked ────── */
/* On narrow screens the rail stacks below the main content.
   Keep the reserved height so the block looks intentional. */

@media (max-width: 820px) {
  .rail-block--answers {
    min-height: auto;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-002 — Refactor hiring intake into conversation shell
   ═══════════════════════════════════════════════════════════ */

/* ── Conversation prompt: column layout for sender + question */
/* The prompt block now stacks a sender attribution row above
   the question text so the block reads as a message from
   Commexce rather than a section header. */

.conversation-prompt {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

/* ── Sender attribution row ──────────────────────────────── */
/* Renders the dot indicator and "Commexce" label side-by-side
   so the question reads as originating from the system. */

.conversation-prompt__sender {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.conversation-prompt__sender-name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
}

/* ── Reply composer variant ──────────────────────────────── */
/* Adds a left-border accent that visually connects the textarea
   to the prompt above, reading as a direct reply in a thread. */

.conversation-textarea--reply {
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  padding-left: calc(var(--space-4) - 2px); /* offset for the extra border width */
}

.conversation-textarea--reply:focus {
  border-left-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

@media (max-width: 820px) {
  .conversation-textarea--reply {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-005 — Harden responsive states and focus polish
   ═══════════════════════════════════════════════════════════ */

/* ── Composer :focus-visible — reinstate stronger ring ────────
   The reply-variant :focus override (WP-002) reduces the glow
   to 3px / 0.10.  Reinstate the 4px / 0.18 ring from WP-006
   and use the darker border-left so the focus state is
   unambiguous on the card surface.                           */

.conversation-textarea--reply:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 0;
  border-left-color: var(--color-primary-dark);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

/* ── Navigation buttons — vertical alignment ──────────────────
   The base .conversation-actions--split rule already sets
   align-items: center; the mobile override (≤ 480 px) sets
   align-items: stretch for full-width stacking.  No override
   is needed here; the comment is kept for audit traceability. */

/* ── Ghost nav button — on-card hover treatment ───────────────
   The default .btn-ghost hover uses var(--color-bg) which can
   be imperceptible on the white card surface.  Give the ghost
   button a defined background and border on hover so the state
   change reads clearly inside the conversation card.        */

.conversation-actions--split .btn-ghost {
  border-color: transparent;
}

.conversation-actions--split .btn-ghost:hover {
  background: rgba(243, 244, 246, 0.9);
  border-color: var(--color-border);
  color: var(--color-text);
}

.conversation-actions--split .btn-ghost:active {
  background: rgba(229, 231, 235, 0.7);
  border-color: var(--color-border);
  transform: translateY(0);
}

/* ── Rail stacking — tablet two-column grid ───────────────────
   At 481–820 px the rail drops below the main card as a single
   column.  Lay the context blocks out in a two-column grid so
   they consume less vertical space.  The answers block spans
   the full width at the bottom for easy scanning.           */

@media (min-width: 481px) and (max-width: 820px) {
  .split-intake-layout__rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    align-items: start;
  }

  .split-intake-layout__rail .rail-block--answers {
    grid-column: 1 / -1;
    min-height: var(--intake-rail-min-answers-height);
  }
}

/* ── Mobile: compact rail ─────────────────────────────────────
   On narrow screens the rail stacks below the form.  Tighten
   internal padding further and let the blocks breathe without
   the full desktop rhythm.                                  */

@media (max-width: 480px) {
  .split-intake-layout__rail .rail-block {
    padding: var(--space-3);
  }

  /* On the narrowest screens show the current-question context
     (first block) and the answer history (answers block).
     Secondary trust/next blocks add scroll without adding value
     at this width and are hidden.                           */
  .split-intake-layout__rail .rail-block:not(.rail-block--answers):not(:first-child) {
    display: none;
  }
}

/* ── Conversation card body — reduced side padding on mobile ──
   Mirror the card-header / card-body mobile override so the
   textarea and button row are not over-inset on small screens. */

@media (max-width: 480px) {
  .conversation-card .card-body {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* ── Progress label — wrap gracefully on narrow screens ───────
   Prevent the "Question N of M" label from forcing the progress
   bar to shrink to zero on very narrow widths.             */

@media (max-width: 360px) {
  .progress-bar-wrap {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .progress-bar-track {
    flex-basis: 100%;
  }

  .progress-label {
    font-size: 0.8125rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-001 — Commexce brand token set & app shell
   Single source of truth for all Commexce design decisions.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Brand primitives */
  --commexce-primary:       #2563eb;
  --commexce-primary-dark:  #1d4ed8;
  --commexce-accent:        #7c3aed;

  /* Surface & border */
  --commexce-surface:       #ffffff;
  --commexce-surface-tint:  rgba(248, 250, 255, 0.72);
  --commexce-bg:            #f4f5f7;
  --commexce-border:        rgba(209, 213, 219, 0.75);
  --commexce-border-subtle: rgba(229, 231, 235, 0.6);

  /* Radius */
  --commexce-radius-sm:     0.5rem;
  --commexce-radius-md:     0.75rem;
  --commexce-radius-lg:     1rem;
  --commexce-radius-xl:     1.5rem;
  --commexce-radius-2xl:    2rem;
  --commexce-radius-pill:   9999px;

  /* Shadow */
  --commexce-shadow:        0 2px 8px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.04);
  --commexce-shadow-md:     0 4px 16px rgba(15, 23, 42, 0.07), 0 1px 4px rgba(15, 23, 42, 0.05);
  --commexce-shadow-raised: 0 8px 28px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);
  --commexce-shadow-btn:    0 2px 8px rgba(37, 99, 235, 0.22), 0 1px 2px rgba(37, 99, 235, 0.14);

  /* Typography */
  --commexce-font-sans:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --commexce-font-mono:     'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;

  /* Type scale */
  --commexce-text-xs:    0.6875rem;
  --commexce-text-sm:    0.875rem;
  --commexce-text-base:  1rem;
  --commexce-text-lg:    1.125rem;

  /* Gradients */
  --commexce-gradient-brand:   linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --commexce-gradient-surface: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

/* ── App shell root ───────────────────────────────────────── */

.commexce-app {
  font-family: var(--commexce-font-sans);
}

/* ── App topbar — sticky translucent header ───────────────── */

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: var(--commexce-surface-tint);
  border-bottom: 1px solid var(--commexce-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.app-topbar .header-inner {
  min-height: 3.75rem;
}

/* ── App shell content wrapper ────────────────────────────── */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Surface card — primary elevated surface ──────────────── */

.surface-card {
  border-radius: var(--commexce-radius-2xl);
  background: var(--commexce-surface);
  box-shadow: var(--commexce-shadow-md);
  border: 1px solid var(--commexce-border-subtle);
}

/* ── Pill — generic pill chip ─────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  border-radius: var(--commexce-radius-pill);
  background: rgba(239, 246, 255, 0.9);
  border: 1px solid rgba(191, 219, 254, 0.75);
  font-size: var(--commexce-text-xs);
  font-weight: 600;
  color: var(--commexce-primary);
  letter-spacing: 0.01em;
}

.pill--accent {
  background: rgba(245, 243, 255, 0.9);
  border-color: rgba(221, 214, 254, 0.75);
  color: var(--commexce-accent);
}

.pill--muted {
  background: rgba(249, 250, 251, 0.9);
  border-color: var(--commexce-border);
  color: var(--color-muted);
}

/* ── Eyebrow — already defined above; alias with token ───── */
/* .eyebrow defined earlier in this file at the shared layer */

/* ── Meta mono — monospace metadata label ─────────────────── */

.meta-mono {
  font-family: var(--commexce-font-mono);
  font-size: var(--commexce-text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

/* ── Skip link (accessibility) ────────────────────────────── */

.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  background: var(--commexce-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--commexce-radius-sm);
  font-size: var(--commexce-text-sm);
  font-weight: 600;
}

.skip-to-content:focus {
  left: 0.5rem;
}

@media (max-width: 768px) {
  .app-topbar .header-inner {
    min-height: 3.25rem;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-002 — Reusable intake conversation partials
   ═══════════════════════════════════════════════════════════ */

/* ── Intake shell layout ──────────────────────────────────── */

.intake-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.intake-shell__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 19rem;
  gap: var(--space-6);
  align-items: start;
}

.intake-shell__main {
  min-width: 0;
}

.intake-shell__card {
  overflow: visible; /* allow composer to sit flush */
}

@media (max-width: 820px) {
  .intake-shell__layout {
    grid-template-columns: 1fr;
  }
}

/* ── Intake status strip ──────────────────────────────────── */

.intake-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0 var(--space-4);
  flex-wrap: wrap;
}

.intake-status-strip__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.intake-status-strip__type {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.intake-status-strip__label {
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.intake-status-strip__label::before {
  content: '—';
  margin-right: var(--space-2);
  opacity: 0.4;
}

.intake-status-strip__progress {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 12rem;
}

.intake-status-strip__track {
  flex: 1;
  height: 0.375rem;
  background: var(--color-border);
  border-radius: 9999px;
  overflow: hidden;
}

.intake-status-strip__fill {
  height: 100%;
  background: var(--gradient-progress);
  border-radius: 9999px;
  transition: width var(--transition-slow);
}

.intake-status-strip__count {
  font-size: 0.75rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .intake-status-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .intake-status-strip__progress {
    width: 100%;
    min-width: 0;
  }
}

/* ── Intake thread ────────────────────────────────────────── */

.intake-thread {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: var(--space-4) var(--space-5) 0;
}

/* ── Intake message ───────────────────────────────────────── */

.intake-message {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.intake-message + .intake-message {
  border-top: 1px solid rgba(229, 231, 235, 0.35);
}

/* Assistant message — left-aligned with avatar */

.intake-message--assistant {
  align-items: flex-start;
}

.intake-message__avatar {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.125rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.22);
}

.intake-message__avatar-mark {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.intake-message--assistant .intake-message__bubble {
  background: var(--gradient-accent-soft);
  border: 1px solid rgba(191, 219, 254, 0.6);
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  max-width: 88%;
}

.intake-message__sender {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-1);
}

.intake-message--assistant .intake-message__text {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-text);
}

/* Latest (unanswered) assistant message — slightly elevated */

.intake-message--assistant.intake-message--latest .intake-message__bubble {
  background: rgba(239, 246, 255, 0.95);
  border-color: rgba(147, 197, 253, 0.7);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.07);
}

/* User message — right-aligned, no avatar */

.intake-message--user {
  flex-direction: row-reverse;
  align-items: flex-start;
}

.intake-message--user .intake-message__bubble {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: var(--radius-lg) 0 var(--radius-lg) var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  max-width: 82%;
}

.intake-message--user .intake-message__text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  word-break: break-word;
}

@media (max-width: 480px) {
  .intake-message--assistant .intake-message__bubble,
  .intake-message--user .intake-message__bubble {
    max-width: 95%;
  }
}

/* ── Intake reply composer ────────────────────────────────── */

.intake-composer {
  padding: var(--space-4) var(--space-5) var(--space-5);
  border-top: 1px solid rgba(229, 231, 235, 0.5);
  background: rgba(249, 250, 251, 0.6);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.intake-composer__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

.intake-composer__textarea {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  resize: vertical;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 6rem;
}

.intake-composer__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.intake-composer__textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.intake-composer__hint {
  margin: var(--space-2) 0 var(--space-4);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.intake-composer__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

/* Variant: right-aligned actions only (no back button) */
.intake-composer__actions--end {
  justify-content: flex-end;
}

/* Refinement variant: remove background tint and top border */
.intake-composer--refinement {
  padding: 0;
  border-top: none;
  background: transparent;
  border-radius: 0;
}

@media (max-width: 480px) {
  .intake-composer__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .intake-composer__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Intake context rail ──────────────────────────────────── */

.intake-rail {
  position: sticky;
  top: calc(4.5rem + var(--space-5));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.intake-rail__card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(229, 231, 235, 0.7);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.intake-rail__card .eyebrow,
.intake-rail__card .meta-mono {
  display: block;
  margin-bottom: var(--space-3);
}

.intake-rail__text {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.55;
}

.intake-rail__text--empty {
  font-style: italic;
}

.intake-rail__answer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.intake-rail__answer-item {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.45);
}

.intake-rail__answer-item:first-child {
  padding-top: 0;
}

.intake-rail__answer-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.intake-rail__answer-q {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  line-height: 1.4;
}

.intake-rail__answer-a {
  font-size: 0.8125rem;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 820px) {
  .intake-rail {
    position: static;
  }
}

/* ── Intake processing state ──────────────────────────────── */

.intake-processing {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
}

.intake-processing__spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(37, 99, 235, 0.12);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  flex-shrink: 0;
}

.intake-processing__title {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--color-text);
}

.intake-processing__desc {
  margin: var(--space-1) 0 0;
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.6;
}

.intake-processing__trust {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .intake-processing__spinner {
    animation: none !important;
    border-color: rgba(37, 99, 235, 0.25);
    border-top-color: var(--color-primary);
    opacity: 0.75;
  }
}

/* ── Print: hide intake rail ──────────────────────────────── */

@media print {
  .intake-rail,
  .intake-status-strip,
  .intake-composer {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   WP-005 — Intake shell responsive pass
   Final breakpoint tuning for the transcript-first shell:
   viewport containment, text wrapping, focus states, and
   rail stacking behaviour.
   ═══════════════════════════════════════════════════════════ */

/* ── Viewport containment ─────────────────────────────────────
   Prevent the shell from causing horizontal scroll at any
   viewport width.  The grid column minmax(0, 1fr) already
   handles the main column; wrap the outer shell too.       */

.intake-shell {
  max-width: 100%;
  overflow-x: hidden;
}

/* ── Long-text bubble wrapping ────────────────────────────────
   Force long words, URLs, and continuous strings to wrap
   inside both assistant and user bubbles.  `overflow-wrap:
   anywhere` allows break-anywhere fallback after
   break-word; min-width: 0 lets flex children shrink.     */

.intake-message--assistant .intake-message__text,
.intake-message--user .intake-message__text {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.intake-message__bubble {
  min-width: 0;
  overflow: hidden;
}

/* ── Focus states — intake composer textarea ──────────────────
   The base :focus rule sets outline:none to rely on
   border+box-shadow.  Restore a visible :focus-visible
   ring so keyboard users see an unambiguous indicator.    */

.intake-composer__textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 0;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

/* ── Rail: desktop sticky position ───────────────────────────
   Clamp the sticky top so the rail never runs off-screen on
   short viewports.  max-height + overflow-y let a long
   answers list scroll rather than overflow the viewport.  */

@media (min-width: 821px) {
  .intake-rail {
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    /* Thin scrollbar so it does not steal visual space */
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
  }
}

/* ── Rail: tablet — horizontal card grid ─────────────────────
   At 481–820 px the layout collapses to a single column and
   the rail appears below the transcript.  Lay the rail cards
   out in a two-column grid so they take less vertical space.
   The answers card spans the full width.                  */

@media (min-width: 481px) and (max-width: 820px) {
  .intake-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    align-items: start;
    margin-top: var(--space-5);
  }

  .intake-rail__card--answers {
    grid-column: 1 / -1;
  }
}

/* ── Rail: mobile — single-column, compact ────────────────────
   Below 480 px keep a single column.  Hide secondary cards
   (anything that is not the first card and not the answers
   card) to keep the page short and focused.              */

@media (max-width: 480px) {
  .intake-rail {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
  }

  .intake-rail__card:not(.intake-rail__card--answers):not(:first-child) {
    display: none;
  }

  .intake-rail__card {
    padding: var(--space-3);
  }
}

/* ── Thread: tighten padding on mobile ───────────────────────
   The desktop side-padding is var(--space-5) (1.5 rem).
   On small screens drop it to var(--space-4) so long messages
   still have 1 rem of breathing room on each side.       */

@media (max-width: 480px) {
  .intake-thread {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .intake-composer {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* ── Status strip: prevent progress from shrinking ───────────
   At very narrow widths the progress section can be squeezed
   to zero by the meta label.  Wrap both rows and let the
   track take the full width when stacked.                */

@media (max-width: 360px) {
  .intake-status-strip__progress {
    min-width: 0;
    flex: 1 1 100%;
  }
}

/* ── Empty answer state — intentional appearance ─────────────
   The italic empty text already signals "nothing yet".
   Add a gentle dashed border so the block does not look
   accidentally broken when there are no prior answers.   */

.intake-rail__text--empty {
  color: var(--color-muted);
  opacity: 0.75;
}

.intake-rail__card--answers:has(.intake-rail__text--empty) {
  border-style: dashed;
  border-color: rgba(209, 213, 219, 0.55);
  background: rgba(249, 250, 251, 0.5);
}

/* ── Processing state: prevent overflow on narrow screens ────
   The spinner + text row should wrap rather than clip.   */

@media (max-width: 480px) {
  .intake-processing {
    padding: var(--space-4);
  }
}

/* ── Reduced-motion: disable transition on fill bar ──────────
   The progress bar uses a slow transition.  Suppress it for
   users who prefer reduced motion.                       */

@media (prefers-reduced-motion: reduce) {
  .intake-status-strip__fill {
    transition: none;
  }
}

/* ── Multi-select checkbox group ─────────────────────────────
   Used by intake_multi_select_field.html for CE intake flows. */

.intake-multi-select {
  width: 100%;
}

.intake-multi-select__helper {
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

.intake-multi-select__error {
  font-size: 0.8125rem;
  color: var(--color-danger);
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}

.intake-multi-select__grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.intake-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-size: 0.875rem;
  color: var(--color-text);
  user-select: none;
}

.intake-option:hover {
  border-color: var(--color-primary);
  background: var(--color-info-bg);
}

.intake-option--checked {
  border-color: var(--color-primary);
  background: var(--color-info-bg);
  color: var(--color-primary);
}

.intake-option__checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.intake-option__checkbox:focus-visible + .intake-option__label {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.intake-option__label {
  line-height: 1.3;
}
