/* ============================================================
   CSS VARIABLES & RESET
   ============================================================ */
:root {
  --sidebar-bg: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-active: #1E2D4A;
  --sidebar-border: #1E293B;
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #F1F5F9;
  --sidebar-width: 260px;

  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-light: #EEF2FF;
  --accent-glow: rgba(99, 102, 241, 0.15);

  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #3B82F6;
  --info-light: #EFF6FF;

  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-placeholder: #CBD5E1;

  --border: #E2E8F0;
  --border-focus: #6366F1;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-accent: 0 4px 14px rgba(99, 102, 241, 0.25);

  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  transition: transform var(--transition-slow);
}

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

.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.page-content {
  padding: 32px;
  flex: 1;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #818CF8);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.sidebar-logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--sidebar-text-active);
  letter-spacing: -0.3px;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--sidebar-text);
  margin-top: 1px;
  font-weight: 400;
}

.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-full);
  background: linear-gradient(135deg, var(--accent), #818CF8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.sidebar-username {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text-active);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-text);
  padding: 12px 20px 6px;
  opacity: 0.6;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 400;
  user-select: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg, .nav-item:hover svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--border-radius-full);
  line-height: 1.4;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 8px 0;
  transition: color var(--transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}

.sidebar-logout:hover {
  color: var(--danger);
}

.sidebar-logout svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: #CBD5E1;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 12px;
}

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

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

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

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

.btn-success:hover {
  background: #059669;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: var(--border-radius);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition);
  outline: none;
  line-height: 1.5;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* File upload */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--border-radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-secondary);
  position: relative;
}

.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

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

.file-drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-muted);
}

.file-drop-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.file-drop-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.file-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--success-light);
  border: 1px solid #A7F3D0;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  color: #065F46;
  margin-top: 10px;
}

.file-selected svg {
  width: 16px;
  height: 16px;
  color: var(--success);
  flex-shrink: 0;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.08) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--border-radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent), #818CF8);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.login-logo-icon svg {
  width: 28px;
  height: 28px;
  color: white;
}

.login-logo-text {
  font-size: 28px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}

.login-headline {
  text-align: center;
  margin-bottom: 36px;
}

.login-headline h2 {
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.login-headline p {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}

.login-form .form-label {
  color: rgba(255,255,255,0.7);
}

.login-form .form-input {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: white;
}

.login-form .form-input::placeholder {
  color: rgba(255,255,255,0.3);
}

.login-form .form-input:focus {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 28px;
}

.login-feature-tag {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.06;
  transform: translate(20px, -20px);
}

.stat-card.accent::after { background: var(--accent); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.info::after { background: var(--info); }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-icon.accent { background: var(--accent-light); color: var(--accent); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info { background: var(--info-light); color: var(--info); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.stat-change {
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up { color: var(--success); }
.stat-change.neutral { color: var(--text-muted); }

/* ============================================================
   SESSION CARDS
   ============================================================ */
.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.session-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.session-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.session-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.session-card-company {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.session-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.session-progress {
  display: flex;
  align-items: center;
  gap: 4px;
}

.session-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background var(--transition);
}

.session-step-dot.done { background: var(--success); }
.session-step-dot.active { background: var(--accent); }

.session-card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

.session-card-cost {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   AGENT / TASK WORKFLOW
   ============================================================ */
.agent-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.agent-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.agent-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
}

/* Step progress */
.step-progress {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  gap: 0;
  overflow-x: auto;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-item.done:not(:last-child)::after {
  background: var(--success);
}

.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  z-index: 1;
  transition: all var(--transition);
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
}

.step-item.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-item.active .step-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.step-item.running .step-circle {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
  animation: pulse 1.5s infinite;
}

.step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}

.step-item.active .step-label,
.step-item.done .step-label {
  color: var(--text-secondary);
}

/* Task cards */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition);
}

.task-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

.task-card.completed {
  border-color: #A7F3D0;
}

.task-card.failed {
  border-color: #FCA5A5;
}

.task-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.task-card-header:hover {
  background: var(--bg-secondary);
}

.task-number-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.task-card.pending .task-number-badge {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.task-card.running .task-number-badge {
  background: var(--warning-light);
  color: var(--warning);
}

.task-card.completed .task-number-badge {
  background: var(--success-light);
  color: var(--success);
}

.task-card.failed .task-number-badge {
  background: var(--danger-light);
  color: var(--danger);
}

.task-card.active .task-number-badge {
  background: var(--accent-light);
  color: var(--accent);
}

.task-card-info {
  flex: 1;
}

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

.task-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--border-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pending { background: var(--bg-secondary); color: var(--text-muted); }
.status-running { background: var(--warning-light); color: #92400E; }
.status-completed { background: var(--success-light); color: #065F46; }
.status-failed { background: var(--danger-light); color: #991B1B; }

/* Task body / stream output */
.task-body {
  border-top: 1px solid var(--border);
  padding: 20px;
}

.stream-output {
  background: #0F172A;
  border-radius: var(--border-radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #94A3B8;
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.stream-output .stream-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  border-radius: 1px;
}

/* Task result panels */
.result-panel {
  margin-top: 16px;
}

/* Match score circle */
.match-score-container {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
}

.match-score-circle {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.match-score-circle svg {
  transform: rotate(-90deg);
  width: 100px;
  height: 100px;
}

.match-score-circle .score-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.match-score-circle .score-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease;
}

.match-score-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.match-score-number span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.match-score-info {
  flex: 1;
}

.match-score-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.match-score-justification {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Keywords */
.keywords-section {
  margin-bottom: 16px;
}

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

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  border: 1px solid;
}

.keyword-tag.critical {
  background: var(--danger-light);
  color: #991B1B;
  border-color: #FCA5A5;
}

.keyword-tag.high {
  background: var(--warning-light);
  color: #92400E;
  border-color: #FDE68A;
}

.keyword-tag.medium {
  background: var(--info-light);
  color: #1E40AF;
  border-color: #BFDBFE;
}

.keyword-tag.added {
  background: var(--success-light);
  color: #065F46;
  border-color: #A7F3D0;
}

.keyword-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Strengths / gaps */
.list-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.list-item-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.list-item-icon.check {
  background: var(--success-light);
  color: var(--success);
}

.list-item-icon.x {
  background: var(--danger-light);
  color: var(--danger);
}

.list-item-icon svg {
  width: 11px;
  height: 11px;
}

/* ATS issues */
.ats-issue {
  padding: 12px 14px;
  border-radius: var(--border-radius-sm);
  border-left: 3px solid;
  margin-bottom: 8px;
}

.ats-issue.critical {
  background: var(--danger-light);
  border-color: var(--danger);
}

.ats-issue.warning {
  background: var(--warning-light);
  border-color: var(--warning);
}

.ats-issue.info {
  background: var(--info-light);
  border-color: var(--info);
}

.ats-issue-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ats-issue-section {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ats-issue-text {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
}

.ats-issue-fix {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Interview Q&A */
.qa-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qa-item {
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.qa-question {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}

.qa-question:hover {
  background: var(--bg-secondary);
}

.qa-number {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qa-question-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.5;
}

.qa-type-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--border-radius-full);
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 3px;
}

.qa-type-badge.behavioral { background: var(--accent-light); color: var(--accent); }
.qa-type-badge.technical { background: var(--info-light); color: var(--info); }
.qa-type-badge.situational { background: var(--warning-light); color: var(--warning); }
.qa-type-badge.competency { background: var(--success-light); color: var(--success); }

.qa-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 4px;
  transition: transform var(--transition);
}

.qa-item.open .qa-chevron {
  transform: rotate(180deg);
}

.qa-answer {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.qa-item.open .qa-answer {
  display: block;
}

.qa-why-asked {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin: 12px 0 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 6px;
  border-left: 2px solid var(--accent);
}

.qa-answer-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-line;
}

.qa-tips {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.qa-tip {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.qa-tip::before {
  content: '→';
  color: var(--accent);
  flex-shrink: 0;
  font-weight: 600;
}

/* Cover letter */
.cover-letter-display {
  background: #FAFAFA;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 28px 32px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-line;
  font-family: 'Georgia', serif;
}

/* Token usage */
.token-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--border-radius-full);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.token-badge svg {
  width: 12px;
  height: 12px;
}

.token-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.token-stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

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

.token-divider {
  width: 1px;
  height: 14px;
  background: var(--border);
}

/* ============================================================
   RESUME PREVIEW
   ============================================================ */
.resume-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.resume-preview-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
}

.resume-preview-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.resume-preview-title svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.resume-preview-body {
  padding: 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--font-mono);
}

/* JD preview */
.jd-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.jd-preview-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.jd-preview-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.jd-preview-body {
  padding: 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ============================================================
   METRICS PAGE
   ============================================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.metric-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-card-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.metric-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.task-breakdown-table {
  width: 100%;
  border-collapse: collapse;
}

.task-breakdown-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.task-breakdown-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

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

.task-breakdown-table tr:hover td {
  background: var(--bg-secondary);
}

.cost-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cost-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.cost-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ============================================================
   HISTORY PAGE
   ============================================================ */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.history-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.history-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-item-icon svg {
  width: 20px;
  height: 20px;
}

.history-item-info {
  flex: 1;
}

.history-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.history-item-company {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.history-task-pills {
  display: flex;
  gap: 3px;
}

.history-task-pill {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.history-task-pill.done { background: var(--success); }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
}

.empty-state-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.empty-state-icon svg {
  width: 36px;
  height: 36px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #1E293B;
  border-radius: var(--border-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  animation: slideInRight 0.3s ease;
  border: 1px solid rgba(255,255,255,0.08);
}

.toast.removing {
  animation: slideOutRight 0.25s ease forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.toast-icon svg {
  width: 12px;
  height: 12px;
}

.toast.success .toast-icon { background: var(--success); color: white; }
.toast.error .toast-icon { background: var(--danger); color: white; }
.toast.info .toast-icon { background: var(--info); color: white; }
.toast.warning .toast-icon { background: var(--warning); color: white; }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.toast-message {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  padding: 0;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  margin-top: -1px;
}

.toast-close:hover {
  color: rgba(255,255,255,0.7);
}

/* ============================================================
   LOADING SKELETONS
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text.sm { height: 12px; }
.skeleton-text.lg { height: 18px; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-text.w-33 { width: 33%; }

.skeleton-card {
  height: 120px;
  border-radius: var(--border-radius);
}

.skeleton-stat {
  height: 100px;
  border-radius: var(--border-radius);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  animation: scaleIn 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}

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

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   DIVIDER & MISC
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--border-radius-full);
}

.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-muted { background: var(--bg-secondary); color: var(--text-muted); border: 1px solid var(--border); }

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.three-col-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.animate-fade-in { animation: fadeInUp 0.3s ease; }

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .sidebar,
  .page-header,
  .btn,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 0;
  }

  body {
    background: white;
  }

  .print-content {
    padding: 20px;
    font-family: 'Times New Roman', serif;
    font-size: 11pt;
    color: black;
    line-height: 1.5;
  }

  .print-content h1 { font-size: 16pt; font-weight: bold; margin-bottom: 4pt; }
  .print-content h2 { font-size: 12pt; font-weight: bold; margin-top: 12pt; margin-bottom: 4pt; border-bottom: 1px solid black; padding-bottom: 2pt; }
  .print-content p { margin-bottom: 4pt; }
  .print-content ul { margin-left: 14pt; }
  .print-content li { margin-bottom: 2pt; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .agent-sidebar-panel {
    position: static;
    order: -1;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

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

  .two-col-grid {
    grid-template-columns: 1fr;
  }

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

/* ============================================================
   NEW SESSION FORM
   ============================================================ */
.new-session-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.new-session-step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.new-session-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.new-session-step-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.resume-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
}

.resume-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: none;
  font-family: var(--font);
  transition: all var(--transition);
}

.resume-tab.active {
  background: var(--bg-card);
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-bar-fill.accent { background: var(--accent); }
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }

/* ============================================================
   INFO BLOCKS
   ============================================================ */
.info-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.info-block.accent {
  background: var(--accent-light);
  color: #3730A3;
  border: 1px solid #C7D2FE;
}

.info-block.success {
  background: var(--success-light);
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.info-block.warning {
  background: var(--warning-light);
  color: #92400E;
  border: 1px solid #FDE68A;
}

.info-block svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #CBD5E1;
}

/* ============================================================
   XYZ EXAMPLES
   ============================================================ */
.xyz-example {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}

.xyz-original {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.xyz-original::before {
  content: 'Before:';
  font-weight: 600;
  color: var(--danger);
  flex-shrink: 0;
}

.xyz-rewritten {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-weight: 500;
}

.xyz-rewritten::before {
  content: 'After:';
  font-weight: 600;
  color: var(--success);
  flex-shrink: 0;
}

/* Session detail view */
.session-info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-full);
  color: var(--text-secondary);
  font-weight: 500;
}

.info-chip svg {
  width: 13px;
  height: 13px;
  color: var(--text-muted);
}

/* ============================================================
   ATS Gate Block
   ============================================================ */

.ats-gate-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--border-radius);
  border: 1.5px solid;
  margin-top: 16px;
}

.ats-gate-block.pass {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.ats-gate-block.fail {
  background: #FFF7ED;
  border-color: #FCD34D;
}

.ats-gate-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ats-gate-block.pass .ats-gate-icon {
  background: #DCFCE7;
  color: #16A34A;
}

.ats-gate-block.fail .ats-gate-icon {
  background: #FEF3C7;
  color: #D97706;
}

.ats-gate-content {
  flex: 1;
  min-width: 0;
}

.ats-gate-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.ats-gate-block.pass .ats-gate-title { color: #15803D; }
.ats-gate-block.fail .ats-gate-title { color: #92400E; }

.ats-gate-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ATS Gate Badge (shown in task card header) */
.ats-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--border-radius-full);
}

.ats-gate-badge.pass {
  background: #DCFCE7;
  color: #15803D;
}

.ats-gate-badge.fail {
  background: #FEF3C7;
  color: #92400E;
}

.ats-gate-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Locked reason text */
.locked-reason {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.locked-reason svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ============================================================
   PDF Preview Block
   ============================================================ */

.pdf-preview-block {
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--card-bg);
}

.pdf-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.pdf-preview-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pdf-preview-label svg {
  color: var(--accent);
}

.pdf-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pdf-preview-iframe {
  width: 100%;
  height: 560px;
  border: none;
  display: block;
  background: #fff;
}

/* ============================================================
   Step progress — 6 steps
   ============================================================ */

/* Override min-width for 6 items so it doesn't overflow */
.step-progress {
  gap: 0;
}

.step-item {
  min-width: 0;
  flex: 1;
}

.step-label {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56px;
}

/* ============================================================
   Resume Management — Cards Grid
   ============================================================ */

.resume-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.resume-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.resume-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.resume-card.is-default {
  border-color: var(--accent);
  background: linear-gradient(135deg, #F5F3FF 0%, #fff 60%);
}

.resume-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.resume-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.resume-card-icon svg { width: 18px; height: 18px; }

.resume-card-meta { flex: 1; min-width: 0; }

.resume-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resume-card-filename {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.resume-default-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
  white-space: nowrap;
}

.resume-card-preview {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  padding: 8px 10px;
  min-height: 48px;
  font-family: 'Georgia', serif;
}

.resume-card-stats {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.resume-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

/* ============================================================
   Resume Selector — New Analysis
   ============================================================ */

.resume-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.resume-select-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.resume-select-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.resume-select-item.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.resume-select-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #EDE9FE;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.resume-select-icon svg { width: 16px; height: 16px; }

.resume-select-info { flex: 1; min-width: 0; }

.resume-select-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.resume-select-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.resume-select-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.15s;
}

.resume-select-item.selected .resume-select-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.resume-select-check svg { width: 11px; height: 11px; }

/* Compact drop zone for inline resume upload */
.file-drop-zone-sm {
  padding: 14px !important;
}
.file-drop-zone-sm .file-drop-icon { font-size: 18px !important; margin-bottom: 4px !important; }
.file-drop-zone-sm .file-drop-text { font-size: 12px !important; }

/* Checkbox row */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }

/* ============================================================
   Modals (Upload / Preview)
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-box-lg { max-width: 800px; }

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

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-title svg { width: 16px; height: 16px; color: var(--accent); }

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--border); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Resume full-text preview inside modal */
.resume-preview-text {
  font-family: 'Georgia', serif;
  font-size: 12pt;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  padding: 24px 28px;
  background: #FAFAFA;
}

/* Session history — resume tag */
.session-resume-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
}
.session-resume-tag svg { width: 11px; height: 11px; }

/* ── Work Samples ─────────────────────────────────────────── */
.ws-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ws-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  gap: 12px;
}

.ws-section-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ws-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ws-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.ws-section-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.ws-section-body {
  padding: 16px 20px;
}

.ws-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.ws-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 14px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ws-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.ws-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ws-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ws-card-info { flex: 1; min-width: 0; }

.ws-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.ws-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.ws-type-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--border-radius-full);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ws-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 4px;
}

.ws-card-preview {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ws-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  gap: 12px;
}

.ws-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.ws-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ws-empty-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.6;
}

/* ── Child Task Tree ──────────────────────────────────────── */
.child-task-tree {
  margin-top: -2px;
  margin-bottom: 4px;
  padding-left: 20px;
}

.child-tree-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 4px 0;
  position: relative;
}

.child-tree-vline {
  width: 2px;
  height: 20px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-muted, #c7d2fe));
  border-radius: 1px;
  flex-shrink: 0;
}

.child-tree-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.child-tree-count {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
}

.child-tree-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
}

.child-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 0;
  position: relative;
}

.child-row-connector {
  position: relative;
  width: 24px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
}

.child-row-vline {
  position: absolute;
  left: 1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

/* Hide the vline for the last row's bottom half */
.child-task-row:last-child .child-row-vline {
  height: 50%;
}

.child-row-hline {
  position: absolute;
  left: 1px;
  top: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
}

.child-row-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
}

.child-row-dot.done {
  background: var(--success-light, #d1fae5);
  color: var(--success, #059669);
  border: 1.5px solid var(--success, #059669);
}

.child-row-dot.running {
  background: var(--accent-light);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.child-row-dot.failed {
  background: var(--danger-light);
  color: var(--danger);
  border: 1.5px solid var(--danger);
}

.child-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.child-row-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

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

/* Trigger area at bottom of task result */
.child-analysis-trigger {
  margin-top: 20px;
  padding-top: 16px;
}

.child-trigger-line {
  width: 2px;
  height: 14px;
  background: linear-gradient(to bottom, var(--border), var(--accent));
  margin-left: 12px;
  margin-bottom: 6px;
  border-radius: 1px;
}

.child-trigger-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.child-trigger-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   CHOICE TASK UI
   ============================================================ */

.choice-task-ui {
  padding: 24px 20px 28px;
  text-align: center;
}

.choice-task-prompt {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.choice-task-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.choice-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 28px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  min-width: 150px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.choice-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.choice-btn:disabled,
.choice-btn.saving {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.choice-btn-icon {
  font-size: 28px;
  display: block;
  line-height: 1;
}

.choice-btn-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.choice-btn-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

/* Yes / submitted / invite */
.choice-btn.choice-yes:hover,
.choice-btn.choice-yes.selected {
  border-color: #10B981;
  background: #D1FAE5;
}
.choice-btn.choice-yes:hover .choice-btn-label,
.choice-btn.choice-yes.selected .choice-btn-label {
  color: #065F46;
}

/* No / not yet */
.choice-btn.choice-no:hover,
.choice-btn.choice-no.selected {
  border-color: var(--text-muted);
  background: var(--bg-surface, #F9FAFB);
}

/* Offer / got the job */
.choice-btn.choice-offer:hover,
.choice-btn.choice-offer.selected {
  border-color: #10B981;
  background: #D1FAE5;
}
.choice-btn.choice-offer:hover .choice-btn-label,
.choice-btn.choice-offer.selected .choice-btn-label {
  color: #065F46;
}

/* Still pending */
.choice-btn.choice-pending:hover,
.choice-btn.choice-pending.selected {
  border-color: #F59E0B;
  background: #FEF3C7;
}
.choice-btn.choice-pending:hover .choice-btn-label,
.choice-btn.choice-pending.selected .choice-btn-label {
  color: #92400E;
}

/* Rejected / not moving forward */
.choice-btn.choice-rejected:hover,
.choice-btn.choice-rejected.selected {
  border-color: #EF4444;
  background: #FEE2E2;
}
.choice-btn.choice-rejected:hover .choice-btn-label,
.choice-btn.choice-rejected.selected .choice-btn-label {
  color: #991B1B;
}

/* Choice result display (after a choice is saved) */
.choice-result-display {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 10px;
  margin: 4px 0;
  border: 1px solid var(--border);
  background: var(--bg-surface, #F9FAFB);
}

.choice-result-display.yes-result {
  background: #D1FAE5;
  border-color: #A7F3D0;
}

.choice-result-display.no-result {
  background: var(--bg-surface, #F9FAFB);
  border-color: var(--border);
}

.choice-result-display.pending-result {
  background: #FEF3C7;
  border-color: #FDE68A;
}

.choice-result-icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}

.choice-result-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.choice-result-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.choice-result-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Make step progress more compact for 9 steps */
@media (max-width: 900px) {
  .step-label {
    font-size: 9px;
  }
  .step-circle {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }
}

/* Task connector line between consecutive task cards — folder-tree style */
.task-connector {
  position: relative;
  width: 100%;
  height: 20px;
}

.task-connector::before {
  content: '';
  position: absolute;
  left: 34px; /* center of .task-number-badge: 20px card padding + 14px (half of 28px badge) */
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 1px;
}
