/* ========================================
   Component Styles Part 2
   Stepper, Tables, Score bars, Toasts,
   Modals, Tabs, Dropzone, etc.
   ======================================== */

/* --- Progress Stepper --- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 0; padding: var(--space-2) var(--space-8); margin-bottom: var(--space-3); }
.stepper-step {
  display: flex; align-items: center; gap: var(--space-3); cursor: pointer;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-full); transition: all var(--transition-fast);
}
.stepper-step:hover { background: var(--bg-glass); }
.stepper-number {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--weight-bold); background: var(--bg-glass-strong);
  color: var(--text-tertiary); border: 2px solid var(--border-default); transition: all var(--transition-fast); flex-shrink: 0;
}
.stepper-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-tertiary); transition: color var(--transition-fast); }
.stepper-connector { width: 40px; height: 2px; background: var(--border-default); flex-shrink: 0; transition: background var(--transition-fast); }
.stepper-step.active .stepper-number { background: var(--accent-primary); border-color: var(--accent-primary); color: white; box-shadow: var(--shadow-glow-sm); }
.stepper-step.active .stepper-label { color: var(--text-primary); }
.stepper-step.completed .stepper-number { background: var(--color-success); border-color: var(--color-success); color: white; }
.stepper-step.completed .stepper-label { color: var(--text-secondary); }
.stepper-connector.completed { background: var(--color-success); }
.stepper-step.disabled { cursor: not-allowed; opacity: 0.5; }

/* --- Data Table --- */
.data-table-wrapper { overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--radius-lg); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table thead { background: var(--bg-glass-strong); position: sticky; top: 0; z-index: 2; }
.data-table th {
  padding: var(--space-3) var(--space-4); text-align: left; font-weight: var(--weight-semibold);
  color: var(--text-secondary); font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: 0.05em; border-bottom: 1px solid var(--border-default); white-space: nowrap;
  cursor: default; user-select: none;
}
.data-table td {
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-default);
  color: var(--text-primary); vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--bg-glass); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .cell-number { font-family: var(--font-mono); font-size: var(--text-xs); text-align: right; }
.data-table .cell-positive { color: var(--color-success); }
.data-table .cell-negative { color: var(--color-error); }

/* --- Score Bar --- */
.score-bar { display: flex; align-items: center; gap: var(--space-2); }
.score-bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: var(--radius-full); overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width var(--transition-slow); }
.score-bar-value { font-size: var(--text-xs); font-weight: var(--weight-semibold); font-family: var(--font-mono); min-width: 32px; text-align: right; }
.score-high .score-bar-fill { background: var(--color-success); }
.score-high .score-bar-value { color: var(--color-success); }
.score-medium .score-bar-fill { background: var(--color-warning); }
.score-medium .score-bar-value { color: var(--color-warning); }
.score-low .score-bar-fill { background: var(--color-error); }
.score-low .score-bar-value { color: var(--color-error); }

/* --- Badge --- */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; font-size: var(--text-xs); font-weight: var(--weight-semibold); border-radius: var(--radius-full); line-height: 1.4; }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-error { background: var(--color-error-bg); color: var(--color-error); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }
.badge-accent { background: rgba(124,92,252,0.15); color: var(--accent-primary); }

/* --- Toast --- */
.toast-container {
  position: fixed; top: var(--space-6); right: var(--space-6); z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--space-3); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5);
  background: var(--bg-tertiary); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); animation: slideInRight var(--transition-base) ease-out;
  pointer-events: auto; min-width: 280px; max-width: 420px;
}
.toast-success { border-left: 3px solid var(--color-success); }
.toast-error { border-left: 3px solid var(--color-error); }
.toast-warning { border-left: 3px solid var(--color-warning); }
.toast-info { border-left: 3px solid var(--color-info); }
.toast-icon { font-size: var(--text-lg); flex-shrink: 0; }
.toast-message { font-size: var(--text-sm); color: var(--text-primary); flex: 1; }
.toast-close { background: none; border: none; color: var(--text-tertiary); cursor: pointer; padding: var(--space-1); font-size: var(--text-base); line-height: 1; }

/* --- Modal --- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: var(--z-modal-backdrop); animation: fadeIn var(--transition-fast) ease-out; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: var(--z-modal);
  width: 90%; max-width: 560px; max-height: 80vh; background: var(--bg-secondary);
  border: 1px solid var(--border-default); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
  overflow-y: auto; animation: scaleIn var(--transition-base) ease-out;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-6); border-bottom: 1px solid var(--border-default); }
.modal-body { padding: var(--space-6); }
.modal-footer { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-default); }

/* --- Tabs --- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-default); margin-bottom: var(--space-6); }
.tab {
  padding: var(--space-3) var(--space-5); font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: var(--text-tertiary); cursor: pointer; border: none; background: none; font-family: var(--font-family);
  position: relative; transition: color var(--transition-fast);
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--text-primary); }
.tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--accent-gradient); border-radius: var(--radius-full); }

/* --- Dropzone --- */
.dropzone {
  border: 2px dashed var(--border-default); border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-8); text-align: center; cursor: pointer;
  transition: all var(--transition-base); position: relative; overflow: hidden;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent-primary); background: rgba(124,92,252,0.05); }
.dropzone-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.5; transition: all var(--transition-base); }
.dropzone:hover .dropzone-icon, .dropzone.drag-over .dropzone-icon { opacity: 0.8; transform: translateY(-4px); }
.dropzone-text { font-size: var(--text-base); color: var(--text-secondary); margin-bottom: var(--space-2); }
.dropzone-hint { font-size: var(--text-xs); color: var(--text-tertiary); }

/* --- Empty State --- */
.empty-state { text-align: center; padding: var(--space-16) var(--space-8); color: var(--text-tertiary); }
.empty-state-icon { font-size: 64px; margin-bottom: var(--space-4); opacity: 0.3; }
.empty-state-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text-secondary); margin-bottom: var(--space-2); }
.empty-state-description { font-size: var(--text-sm); max-width: 400px; margin: 0 auto; }

/* --- Misc --- */
.skeleton { background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-glass-strong) 50%, var(--bg-glass) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-2); }
.checkbox-item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); cursor: pointer; transition: background var(--transition-fast); }
.checkbox-item:hover { background: var(--bg-glass); }
.checkbox-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-primary); cursor: pointer; }
.checkbox-item label { font-size: var(--text-sm); color: var(--text-secondary); cursor: pointer; }

.copy-btn {
  display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs); color: var(--text-tertiary); background: none; border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition-fast); font-family: var(--font-family);
}
.copy-btn:hover { color: var(--text-primary); border-color: var(--border-hover); background: var(--bg-glass); }
.copy-btn.copied { color: var(--color-success); border-color: rgba(52,211,153,0.3); }

.char-counter { font-size: var(--text-xs); font-family: var(--font-mono); color: var(--text-tertiary); text-align: right; margin-top: var(--space-1); }
.char-counter.over-limit { color: var(--color-error); font-weight: var(--weight-semibold); }

.file-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--bg-glass); border: 1px solid var(--border-default); border-radius: var(--radius-md); transition: all var(--transition-fast); }
.file-item:hover { border-color: var(--border-hover); }
.file-icon { font-size: var(--text-xl); flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-primary); }
.file-meta { font-size: var(--text-xs); color: var(--text-tertiary); }
.file-status { flex-shrink: 0; }

.section-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-6); flex-wrap: wrap; gap: var(--space-4); }
.section-title { font-size: var(--text-xl); font-weight: var(--weight-bold); }
.section-description { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-1); max-width: 600px; }

.insight-card { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); background: var(--bg-glass); border-radius: var(--radius-md); border: 1px solid var(--border-default); }
.insight-icon { font-size: var(--text-xl); flex-shrink: 0; margin-top: 2px; }
.insight-content { flex: 1; }
.insight-label { font-size: var(--text-xs); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: var(--space-1); }
.insight-value { font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--text-primary); }
.insight-detail { font-size: var(--text-xs); color: var(--text-secondary); margin-top: var(--space-1); }

/* ========================================
   AI Settings & Integration Styles
   ======================================== */

/* --- AI Settings Card --- */
.ai-settings-card {
  background: linear-gradient(135deg, rgba(124,92,252,0.05), rgba(69,184,255,0.05));
  border: 1px solid rgba(124,92,252,0.2);
  position: relative;
  overflow: hidden;
}
.ai-settings-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary, #45b8ff));
}
.ai-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.ai-settings-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.ai-settings-title h4 { margin: 0; }
.ai-icon { font-size: 24px; }
.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(124,92,252,0.2), rgba(69,184,255,0.2));
  color: var(--accent-primary);
  letter-spacing: 0.03em;
  border: 1px solid rgba(124,92,252,0.3);
}
.ai-settings-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
  line-height: 1.5;
}

/* --- AI Config Panel --- */
.ai-config-panel {
  transition: opacity var(--transition-base), filter var(--transition-base);
}
.ai-config-panel.ai-config-disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.5);
}

/* --- API Key Input --- */
.api-key-input-wrapper {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.api-key-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
}
.api-key-toggle {
  flex-shrink: 0;
  font-size: var(--text-base);
}

/* --- AI Actions Row --- */
.ai-actions-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* --- Connection Status --- */
.ai-connection-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-left: auto;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-none { background: var(--text-tertiary); }
.status-ready { background: var(--color-warning); }
.status-testing { background: var(--color-info); animation: pulse 1s infinite; }
.status-ok { background: var(--color-success); box-shadow: 0 0 6px rgba(52,211,153,0.4); }
.status-error { background: var(--color-error); }

/* --- AI Loading State --- */
.ai-loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: var(--space-8);
}
.ai-loading-card {
  text-align: center;
  max-width: 480px;
  padding: var(--space-10) var(--space-8);
  background: linear-gradient(135deg, rgba(124,92,252,0.06), rgba(69,184,255,0.06));
  border: 1px solid rgba(124,92,252,0.2);
}
.ai-loading-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-loading-spinner {
  position: absolute;
  inset: 0;
  border: 3px solid rgba(124,92,252,0.15);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.ai-loading-emoji {
  font-size: 32px;
  animation: pulse 2s ease-in-out infinite;
}
.ai-loading-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ai-loading-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

/* --- AI Loading Steps --- */
.ai-loading-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
}
.ai-step {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  border-left: 2px solid transparent;
}
.ai-step.active {
  color: var(--accent-primary);
  background: rgba(124,92,252,0.08);
  border-left-color: var(--accent-primary);
  font-weight: var(--weight-medium);
}
.ai-step.done {
  color: var(--color-success);
  text-decoration: line-through;
  opacity: 0.6;
}

/* --- AI Error State --- */
.ai-error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: var(--space-8);
}
.ai-error-card {
  text-align: center;
  max-width: 520px;
  padding: var(--space-8);
  border: 1px solid rgba(248,113,113,0.2);
  background: linear-gradient(135deg, rgba(248,113,113,0.04), rgba(0,0,0,0));
}
.ai-error-icon { font-size: 48px; margin-bottom: var(--space-4); }
.ai-error-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-error);
  margin-bottom: var(--space-3);
}
.ai-error-message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-6);
  padding: var(--space-3);
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  word-break: break-word;
}
.ai-error-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- AI Generated Badge --- */
.ai-gen-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(124,92,252,0.15), rgba(69,184,255,0.15));
  color: var(--accent-primary);
  border: 1px solid rgba(124,92,252,0.25);
  animation: glowPulse 3s ease-in-out infinite;
}
.template-gen-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

/* --- Accent Button --- */
.btn-accent {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, #45b8ff));
  color: white;
  border: none;
  font-weight: var(--weight-semibold);
  transition: all var(--transition-fast);
}
.btn-accent:hover {
  box-shadow: var(--shadow-glow-sm);
  transform: translateY(-1px);
}

/* --- Animations --- */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,92,252,0); }
  50% { box-shadow: 0 0 12px 2px rgba(124,92,252,0.15); }
}

/* ──────────────────────────────────────────────────
   AI Niche Assessment Panel (Screen Analysis)
   ────────────────────────────────────────────────── */

.ai-niche-panel {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(168, 85, 247, 0.06) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-top: 3px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  overflow: hidden;
}
.niche-insights-inner { padding: var(--space-5) var(--space-6); }

/* idle */
.niche-idle-content {
  display: flex; align-items: center; gap: var(--space-5);
}
.niche-idle-icon { font-size: 32px; flex-shrink: 0; opacity: 0.8; }
.niche-idle-title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-primary); margin-bottom: var(--space-1); }
.niche-idle-desc { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.5; }
.niche-idle-content .btn-ai {
  flex-shrink: 0; margin-left: auto;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  color: white; border: none;
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  border-radius: var(--radius-full); cursor: pointer; white-space: nowrap;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.niche-idle-content .btn-ai:hover { opacity: 0.9; transform: translateY(-1px); }

/* loading */
.niche-title {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-primary);
  margin-bottom: var(--space-4);
}
.ai-spinner-sm {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.niche-skeleton-lines { display: flex; flex-direction: column; gap: var(--space-2); }
.skeleton-line {
  height: 14px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* done */
.niche-done .niche-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-5); padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.ai-badge-sm {
  display: inline-flex; align-items: center;
  padding: 2px 8px; font-size: 11px; font-weight: var(--weight-semibold);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
  color: white; border-radius: var(--radius-full);
  margin-left: var(--space-2); vertical-align: middle;
}
.niche-items { display: flex; flex-direction: column; gap: var(--space-4); }
.niche-item {
  display: flex; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  border-left: 3px solid rgba(99,102,241,0.4);
  transition: border-color var(--transition-fast);
}
.niche-item:hover { border-left-color: var(--accent-primary); }
.niche-item-warning { border-left-color: rgba(251,191,36,0.5); }
.niche-item-warning:hover { border-left-color: #FBBF24; }
.niche-item-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.niche-item-label {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  color: var(--accent-primary); text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: var(--space-1);
}
.niche-item-text { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.65; }

/* error */
.niche-error {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  color: #ef4444; font-size: var(--text-sm);
}

/* ghost / tiny button */
.btn-ghost {
  background: transparent; border: 1px solid var(--border-default);
  color: var(--text-secondary); border-radius: var(--radius-md);
  cursor: pointer; font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  transition: all var(--transition-fast);
}
.btn-ghost:hover { background: var(--bg-glass); color: var(--text-primary); border-color: var(--border-strong); }
.btn-xs { font-size: var(--text-xs) !important; padding: var(--space-1) var(--space-3) !important; }

/* ──────────────────────────────────────────────────
   Keyword Card — extended metrics row (spec §23)
   ────────────────────────────────────────────────── */

.keyword-term-row {
  display: flex; align-items: center; gap: var(--space-2);
  flex-wrap: wrap; margin-bottom: var(--space-2);
}
.keyword-term {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--text-primary); flex: 1; min-width: 0;
}
.keyword-niche-tag {
  font-size: 11px; color: var(--text-tertiary);
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full); padding: 1px 8px;
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.keyword-metrics {
  display: flex; gap: var(--space-3); flex-wrap: wrap;
}
.keyword-metric {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 44px;
}
.keyword-metric-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-tertiary); font-weight: var(--weight-semibold);
}
.keyword-metric-value {
  font-size: var(--text-xs); font-family: var(--font-mono);
  color: var(--text-secondary); font-weight: var(--weight-medium);
}
.keyword-metric-value.cell-positive { color: var(--color-success); }
.keyword-metric-value.cell-negative { color: var(--color-error); }

/* Analysis insights — 5 cards flexible */
.analysis-insights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

/* ────────────────────────────────────────────────
   Screen 1 (Data Source) — Sheet Selection Cards
   ──────────────────────────────────────────────── */
.sheet-select-card {
  padding: var(--space-4);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  cursor: pointer;
  transition: all var(--transition-base);
}
.sheet-select-card:hover {
  border-color: var(--color-primary);
  background: var(--bg-elevated);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.sheet-select-card--active {
  border-color: var(--color-primary) !important;
  background: var(--bg-elevated) !important;
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb, 99,102,241), 0.25);
}

/* Niche tab selector list */
.niche-tab-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-1);
}
.niche-tab-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.niche-tab-item:hover:not(.niche-tab-item--disabled) {
  border-color: var(--color-primary);
  color: var(--text-primary);
}
.niche-tab-item--selected {
  border-color: var(--color-primary);
  background: var(--bg-glass);
  color: var(--text-primary);
}
.niche-tab-item--disabled {
  opacity: 0.7;
  cursor: default;
}
.niche-tab-name { flex: 1; }
.niche-tab-count {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}
.niche-tab-checkbox { flex-shrink: 0; }

/* ────────────────────────────────────────────────
   Screen 2 (Setup) — Summary Banner
   ──────────────────────────────────────────────── */
.setup-summary-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.setup-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-1) var(--space-4);
}
.setup-summary-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
}
.setup-summary-value {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.setup-summary-divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.setup-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
@media (max-width: 768px) {
  .setup-layout { grid-template-columns: 1fr; }
}
.setup-section { display: flex; flex-direction: column; gap: var(--space-4); }

/* Spinner for loading */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ────────────────────────────────────────────────
   Sheet Type Pill — radio toggle (Add Sheet form)
   ──────────────────────────────────────────────── */
.sheet-type-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  min-width: 180px;
  user-select: none;
}
.sheet-type-pill:hover {
  border-color: var(--color-primary);
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.sheet-type-pill--active {
  border-color: var(--color-primary) !important;
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.20);
}

/* ════════════════════════════════════════════════════
   SCALE UPGRADE — Batch Scale Screen Styles (§15)
   ════════════════════════════════════════════════════ */

/* --- Batch Layout --- */
.batch-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  align-items: start;
}
@media (max-width: 900px) {
  .batch-layout { grid-template-columns: 1fr; }
}

.batch-config-panel { display: flex; flex-direction: column; gap: 0; }
.batch-output-panel { display: flex; flex-direction: column; gap: var(--space-4); min-height: 400px; }

/* --- Mode Badges --- */
.mode-badge {
  display: inline-flex; align-items: center;
  padding: 4px 14px; font-size: var(--text-sm); font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
}
.badge-job {
  background: linear-gradient(135deg, rgba(69,184,255,0.15), rgba(124,92,252,0.15));
  color: #45b8ff;
  border: 1px solid rgba(69,184,255,0.3);
}
.badge-name {
  background: linear-gradient(135deg, rgba(249,168,212,0.15), rgba(253,186,116,0.15));
  color: #f9a8d4;
  border: 1px solid rgba(249,168,212,0.3);
}

/* --- Template Family Grid --- */
.template-family-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.template-family-card {
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.template-family-card:hover {
  border-color: var(--accent-primary);
  background: rgba(124,92,252,0.06);
  transform: translateY(-1px);
}
.template-family-card.selected {
  border-color: var(--accent-primary);
  background: rgba(124,92,252,0.1);
  box-shadow: 0 0 0 2px rgba(124,92,252,0.2);
}
.template-family-card.selected::before {
  content: '✓';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 12px;
  color: var(--accent-primary);
  font-weight: var(--weight-bold);
}
.template-family-emoji { font-size: 20px; margin-bottom: var(--space-1); }
.template-family-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); margin-bottom: 2px; }
.template-family-desc { font-size: var(--text-xs); color: var(--text-muted); margin-bottom: var(--space-2); line-height: 1.4; }
.template-family-pattern {
  font-size: 10px; font-family: var(--font-mono);
  color: var(--accent-primary); background: rgba(124,92,252,0.08);
  border-radius: var(--radius-sm); padding: 2px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid rgba(124,92,252,0.2);
}

/* --- Entity Input & Counter --- */
.batch-entity-input {
  width: 100%; resize: vertical; font-family: var(--font-mono);
  font-size: var(--text-sm); line-height: 1.6;
  background: var(--bg-glass); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-3); color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.batch-entity-input:focus { outline: none; border-color: var(--accent-primary); }
.entity-counter-badge {
  font-size: var(--text-xs); color: var(--text-tertiary);
  text-align: right; margin-top: var(--space-1);
  font-family: var(--font-mono);
}

/* --- Range slider --- */
.form-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: var(--radius-full);
  background: var(--bg-glass-strong); outline: none; cursor: pointer;
  margin-top: var(--space-2);
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-primary); cursor: pointer;
  box-shadow: 0 0 0 2px rgba(124,92,252,0.3);
  transition: box-shadow var(--transition-fast);
}
.form-range::-webkit-slider-thumb:hover { box-shadow: 0 0 0 4px rgba(124,92,252,0.2); }

/* --- Progress Bar --- */
.batch-progress-container {
  padding: var(--space-5);
  background: var(--bg-glass);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.batch-progress-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-3);
  font-size: var(--text-sm); color: var(--text-secondary);
}
.batch-progress-bar {
  width: 100%; height: 8px;
  background: var(--bg-glass-strong);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.batch-progress-fill {
  height: 100%;
  background: var(--accent-gradient, linear-gradient(90deg, var(--accent-primary), #45b8ff));
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}
.batch-progress-error {
  margin-top: var(--space-2); font-size: var(--text-xs);
  color: var(--color-error); background: rgba(248,113,113,0.08);
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3);
}

/* --- Empty State --- */
.batch-output-empty {
  text-align: center; padding: var(--space-12) var(--space-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  background: var(--bg-glass); border: 1px dashed var(--border-default);
}
.batch-empty-icon { font-size: 48px; opacity: 0.4; }
.batch-empty-hints {
  display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center;
  margin-top: var(--space-2);
}
.batch-hint {
  font-size: var(--text-xs); color: var(--text-muted);
  background: var(--bg-glass-strong); padding: 4px 12px;
  border-radius: var(--radius-full); border: 1px solid var(--border-subtle);
}

/* --- Output Header & Stats --- */
.batch-output-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-4); padding: var(--space-4) var(--space-5);
  background: var(--bg-glass); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.batch-output-stats { display: flex; gap: var(--space-5); }
.batch-stat { display: flex; flex-direction: column; gap: 2px; }
.batch-stat-value { font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--text-primary); }
.batch-stat-label { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.text-warning { color: var(--color-warning) !important; }
.text-success { color: var(--color-success) !important; }
.text-accent  { color: var(--accent-primary)  !important; }

/* --- Listing Unit Rows --- */
.listing-units-table { display: flex; flex-direction: column; gap: var(--space-2); }
.listing-unit-row {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
  background: var(--bg-secondary);
}
.listing-unit-row:hover { border-color: var(--border-hover); }
.listing-unit-row.duplicate { border-color: rgba(251,191,36,0.35); }
.listing-unit-row.duplicate .unit-row-header { background: rgba(251,191,36,0.06); }

.unit-row-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap; gap: var(--space-2);
}
.unit-entity-name { display: flex; align-items: center; gap: var(--space-2); }
.unit-idx { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); min-width: 28px; }
.unit-entity-value { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-primary); }
.unit-meta { display: flex; align-items: center; gap: var(--space-2); }

.unit-family-badge {
  font-size: 10px; padding: 2px 8px;
  background: rgba(124,92,252,0.1); color: var(--accent-primary);
  border-radius: var(--radius-full); border: 1px solid rgba(124,92,252,0.2);
  white-space: nowrap;
}
.badge-ai {
  font-size: 10px; padding: 2px 8px;
  background: linear-gradient(135deg,rgba(124,92,252,0.15),rgba(69,184,255,0.15));
  color: #45b8ff; border-radius: var(--radius-full);
  border: 1px solid rgba(69,184,255,0.2);
}
.badge-template {
  font-size: 10px; padding: 2px 8px;
  background: var(--bg-glass); color: var(--text-secondary);
  border-radius: var(--radius-full); border: 1px solid var(--border-subtle);
}
.badge-count {
  font-size: 10px; padding: 2px 8px; font-weight: var(--weight-bold);
  background: var(--accent-primary); color: white; border-radius: var(--radius-full);
  margin-left: var(--space-1);
}
.dedup-badge {
  font-size: 10px; padding: 2px 8px;
  background: rgba(251,191,36,0.15); color: var(--color-warning);
  border-radius: var(--radius-full); border: 1px solid rgba(251,191,36,0.3);
}

.unit-title-preview {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); color: var(--text-primary);
  line-height: 1.5; border-bottom: 1px solid var(--border-subtle);
}

/* --- Expanded Unit --- */
.unit-expanded {
  padding: var(--space-4); border-top: 1px solid var(--border-subtle);
  animation: fadeIn var(--transition-fast) ease-out;
  display: flex; flex-direction: column; gap: var(--space-4);
}
.unit-expanded-section { display: flex; flex-direction: column; gap: var(--space-2); }
.unit-expanded-label {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary);
}
.unit-title-item {
  display: flex; align-items: baseline; gap: var(--space-2);
  font-size: var(--text-sm); color: var(--text-secondary);
}
.unit-title-num {
  font-family: var(--font-mono); font-size: 10px; color: var(--accent-primary);
  background: rgba(124,92,252,0.1); border-radius: 3px; padding: 1px 5px;
  flex-shrink: 0;
}
.unit-bullet-item { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.6; }
.unit-desc-text  { font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.7; }
.unit-backend-text { font-size: var(--text-xs); font-family: var(--font-mono); color: var(--accent-primary); }

/* --- Trace Info --- */
.unit-trace { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.trace-item {
  font-size: var(--text-xs); color: var(--text-muted);
  background: var(--bg-glass); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 2px 8px;
}
.trace-item strong { color: var(--text-primary); }

/* --- Textarea (generic) --- */
.form-textarea {
  background: var(--bg-glass); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-3); color: var(--text-primary);
  font-size: var(--text-sm); line-height: 1.6; width: 100%; resize: vertical;
  transition: border-color var(--transition-fast); font-family: inherit;
}
.form-textarea:focus { outline: none; border-color: var(--accent-primary); }

/* --- Scale CTA on Listing screen --- */
.batch-scale-cta { padding: var(--space-5) var(--space-6); }

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

/* ══════════════════════════════════════════════════════════════════
   Multi-Product Upgrade — Product Type Selector & Badges
   ══════════════════════════════════════════════════════════════════ */

/* Product type 4-card grid */
.product-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.product-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-3) var(--space-2);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  user-select: none;
}

.product-type-card:hover {
  border-color: var(--accent-primary);
  background: rgba(124, 92, 252, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 92, 252, 0.14);
}

.product-type-card.selected {
  border-color: var(--accent-primary);
  background: rgba(124, 92, 252, 0.12);
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.25);
}

.product-type-emoji {
  font-size: 24px;
  line-height: 1;
  margin-bottom: 2px;
}

.product-type-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.product-type-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Product badge (in listing info bar, batch header) */
.product-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border: 1px solid transparent;
}

.product-badge-mug {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.2);
}

.product-badge-shirt {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.2);
}

.product-badge-poster {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.2);
}

.product-badge-blanket {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.2);
}

/* Product Fit panel (analysis screen) */
.product-fit-panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.product-fit-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.product-fit-stats {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.product-fit-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
}

.fit-strong  { color: #4ade80; }
.fit-related { color: #60a5fa; }
.fit-neutral { color: var(--text-muted); }
.fit-competing { color: #f87171; }

/* ────────────────────────────────────────────────
   Amazon Research Output — Research Cards & Queue
   ──────────────────────────────────────────────── */

/* Success button variant */
.btn-success {
  background: rgba(52,211,153,0.15);
  color: var(--color-success);
  border: 1px solid rgba(52,211,153,0.35);
  font-weight: var(--weight-semibold);
}
.btn-success:hover {
  background: rgba(52,211,153,0.25);
}

/* Keyword / phrase tag pills */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--text-xs);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  user-select: none;
}
.tag:hover {
  background: var(--bg-glass-strong);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* Research card hover effect */
.research-card {
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}
.research-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(-1px);
}

/* ============================================================
   Bundle Generator — Design Bundle Module CSS
   ============================================================ */

/* Layout */
.bundle-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-6);
  align-items: start;
}

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

/* Style Library Grid */
.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.style-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.style-card:hover {
  border-color: rgba(124,92,252,0.4);
  background: rgba(124,92,252,0.08);
}
.style-card.selected {
  border-color: var(--accent-primary);
  background: rgba(124,92,252,0.15);
  box-shadow: 0 0 0 2px rgba(124,92,252,0.25);
}
.style-card-emoji {
  font-size: 22px;
  margin-bottom: 6px;
}
.style-card-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.2;
}
.style-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.style-tag {
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: var(--text-muted);
}

/* Quote cards */
.quote-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.quote-card:hover {
  border-color: rgba(124,92,252,0.3);
  background: rgba(124,92,252,0.06);
}
.quote-card.selected {
  border-color: var(--accent-primary);
  background: rgba(124,92,252,0.12);
}
.quote-card-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: 6px;
  font-style: italic;
}
.quote-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.quote-score {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.score-high { background: rgba(52,211,153,0.15); color: #34d399; }
.score-mid  { background: rgba(251,191,36,0.15); color: #fbbf24; }
.score-low  { background: rgba(239,68,68,0.15);  color: #ef4444; }

/* Prompt preview */
.prompt-textarea-preview {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 12px;
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  resize: none;
  line-height: 1.6;
  box-sizing: border-box;
}

/* Bundle Table */
.bundle-table-wrap {
  overflow-x: auto;
}
.bundle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.bundle-table th {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}
.bundle-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}
.bundle-row {
  cursor: pointer;
  transition: background 0.15s;
}
.bundle-row:hover { background: rgba(255,255,255,0.04); }
.bundle-row.bundle-dup { background: rgba(251,191,36,0.04); }

/* QA Badges */
.qa-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}
.qa-badge-ok  { background: rgba(52,211,153,0.12); color: #34d399; }
.qa-badge-warn{ background: rgba(251,191,36,0.12); color: #fbbf24; }
.qa-badge-dup { background: rgba(139,92,246,0.12); color: #a78bfa; }

/* Stat badges in output header */
.bundle-output-header { padding: var(--space-3) 0 var(--space-2); }
.bundle-output-stats  { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.stat-total { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.stat-ok    { background: rgba(52,211,153,0.12); color: #34d399; }
.stat-warn  { background: rgba(251,191,36,0.12); color: #fbbf24; }
.stat-dup   { background: rgba(139,92,246,0.12); color: #a78bfa; }

/* Style detail preview */
.style-detail-preview {
  margin-top: var(--space-3);
}

/* Progress */
.bundle-progress-wrap {
  padding: var(--space-3) 0;
}

/* Google Flow Profile Cards */
.gflow-profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: background 0.15s;
}
.gflow-profile-card:hover {
  background: rgba(255,255,255,0.06);
}
.gflow-profile-info {
  flex: 1;
  min-width: 0;
}
.gflow-profile-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}
.gflow-profile-path {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.gflow-profile-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}
