/* =====================================================
   SwiftPharma v8 — Workbench Design System
   Shared inner page styles for all module workbenches
   ===================================================== */

/* ═══════════ DESIGN TOKENS ═══════════ */
:root {
  --sp-bg: #F8FBFF;
  --sp-bg-soft: #EEF6FF;
  --sp-bg-panel: rgba(255,255,255,0.76);
  --sp-bg-panel-solid: #FFFFFF;
  --sp-primary: #2563EB;
  --sp-primary-light: #3B82F6;
  --sp-cyan: #38BDF8;
  --sp-indigo: #6366F1;
  --sp-teal: #14B8A6;
  --sp-violet: #8B5CF6;
  --sp-pink: #EC4899;
  --sp-amber: #F59E0B;
  --sp-text-main: #0F172A;
  --sp-text-sub: #334155;
  --sp-text-muted: #64748B;
  --sp-border: rgba(37,99,235,0.14);
  --sp-border-strong: rgba(37,99,235,0.26);
  --sp-radius-sm: 12px;
  --sp-radius-md: 18px;
  --sp-radius-lg: 28px;
  --sp-radius-xl: 36px;
  --sp-shadow-card: 0 22px 60px rgba(37,99,235,0.10);
  --sp-shadow-soft: 0 14px 38px rgba(37,99,235,0.08);
  --sp-blur: blur(22px);
}

/* ═══════════ MODULE ACCENT COLORS ═══════════ */
body.module-target {
  --module-accent: #2563EB;
  --module-accent-2: #38BDF8;
  --module-soft: rgba(37, 99, 235, 0.10);
  --module-glow: rgba(37, 99, 235, 0.15);
}

body.module-gen {
  --module-accent: #6366F1;
  --module-accent-2: #8B5CF6;
  --module-soft: rgba(99, 102, 241, 0.11);
  --module-glow: rgba(99, 102, 241, 0.15);
}

body.module-screen {
  --module-accent: #14B8A6;
  --module-accent-2: #38BDF8;
  --module-soft: rgba(20, 184, 166, 0.11);
  --module-glow: rgba(20, 184, 166, 0.15);
}

body.module-deliver {
  --module-accent: #8B5CF6;
  --module-accent-2: #EC4899;
  --module-soft: rgba(139, 92, 246, 0.11);
  --module-glow: rgba(139, 92, 246, 0.15);
}

body.module-integrated {
  --module-accent: #2563EB;
  --module-accent-2: #F59E0B;
  --module-soft: rgba(245, 158, 11, 0.10);
  --module-glow: rgba(245, 158, 11, 0.12);
}

/* Module accent applications */
[class*="module-"] .config-header {
  border-top: 3px solid var(--module-accent, var(--sp-primary));
  border-radius: var(--sp-radius-md) var(--sp-radius-md) 0 0;
  margin: -24px -24px 20px;
  padding: 20px 24px 14px;
}

[class*="module-"] .config-version {
  background: var(--module-soft, var(--sp-bg-soft));
  color: var(--module-accent, var(--sp-primary));
}

[class*="module-"] .wb-btn-primary {
  background: linear-gradient(135deg, var(--module-accent, var(--sp-primary)), var(--module-accent-2, var(--sp-primary-light)));
  box-shadow: 0 4px 16px var(--module-glow, rgba(37,99,235,0.25));
}

[class*="module-"] .wb-btn-primary:hover {
  box-shadow: 0 8px 28px var(--module-glow, rgba(37,99,235,0.3));
}

[class*="module-"] .wb-input:focus,
[class*="module-"] .wb-select:focus,
[class*="module-"] .wb-textarea:focus {
  border-color: var(--module-accent, var(--sp-primary-light));
  box-shadow: 0 0 0 3px var(--module-glow, rgba(37,99,235,0.12));
}

[class*="module-"] .module-kicker {
  color: var(--module-accent, var(--sp-primary));
}

[class*="module-"] .module-status-chip {
  color: var(--module-accent, var(--sp-primary));
  border-color: var(--module-soft, var(--sp-border));
  background: var(--module-soft, var(--sp-bg-soft));
}

[class*="module-"] .wb-progress-fill {
  background: linear-gradient(90deg, var(--module-accent, var(--sp-primary)), var(--module-accent-2, var(--sp-cyan)));
}

[class*="module-"] .status-running {
  background: var(--module-soft, rgba(37,99,235,0.1));
  color: var(--module-accent, var(--sp-primary));
}

[class*="module-"] .upload-dropzone:hover,
[class*="module-"] .upload-dropzone.dragover {
  border-color: var(--module-accent, var(--sp-primary-light));
  box-shadow: 0 0 0 3px var(--module-glow, rgba(37,99,235,0.08));
}

/* ═══════════ MODULE HERO ═══════════ */
.module-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 36px 48px;
  max-width: 1400px;
  margin: 0 auto;
  animation: heroFadeIn 0.6s ease both;
}

.module-icon-bubble {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.module-icon-bubble svg {
  width: 32px;
  height: 32px;
}

.bubble-blue {
  background: linear-gradient(135deg, #2563EB, #38BDF8);
  box-shadow: 0 8px 24px rgba(37,99,235,0.25);
}

.bubble-indigo {
  background: linear-gradient(135deg, #6366F1, #818CF8);
  box-shadow: 0 8px 24px rgba(99,102,241,0.25);
}

.bubble-teal {
  background: linear-gradient(135deg, #14B8A6, #38BDF8);
  box-shadow: 0 8px 24px rgba(20,184,166,0.25);
}

.bubble-violet {
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  box-shadow: 0 8px 24px rgba(139,92,246,0.25);
}

.bubble-cyan {
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
  box-shadow: 0 8px 24px rgba(6,182,212,0.25);
}

.bubble-amber {
  background: linear-gradient(135deg, #F59E0B, #EC4899);
  box-shadow: 0 8px 24px rgba(245,158,11,0.25);
}

.module-hero-text {
  flex: 1;
  min-width: 0;
}

.module-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--sp-primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.module-hero-text h1 {
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 800;
  color: var(--sp-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.3;
}

.module-hero-desc {
  font-size: 0.85rem;
  color: var(--sp-text-muted);
  line-height: 1.6;
  max-width: 600px;
}

.module-status-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--sp-bg-soft);
  color: var(--sp-primary);
  border: 1px solid var(--sp-border);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════ WORKBENCH GRID LAYOUT ═══════════ */
.workbench {
  display: grid;
  grid-template-columns: 360px 1fr 320px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 48px;
  align-items: stretch;
  animation: panelsFadeIn 0.6s 0.15s ease both;
}

.workbench-2col {
  grid-template-columns: 360px 1fr;
}

/* ═══════════ GLASS PANEL ═══════════ */
.workbench-config {
  position: sticky;
  top: 88px;
  background: var(--sp-bg-panel);
  backdrop-filter: var(--sp-blur);
  -webkit-backdrop-filter: var(--sp-blur);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 24px;
  box-shadow: var(--sp-shadow-soft);
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(37,99,235,0.15) transparent;
}

.workbench-config::-webkit-scrollbar {
  width: 5px;
}

.workbench-config::-webkit-scrollbar-thumb {
  background: rgba(37,99,235,0.15);
  border-radius: 10px;
}

.workbench-main {
  position: relative;
  background: var(--sp-bg-panel-solid);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 24px;
  box-shadow: var(--sp-shadow-soft);
  min-height: calc(100vh - 160px);
  overflow: hidden;
}

/* Workspace ambient background */
.workbench-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 20%, var(--module-soft, rgba(37,99,235,0.06)), transparent 32%),
    radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.05), transparent 30%);
  pointer-events: none;
  border-radius: var(--sp-radius-md);
}

.workbench-main::after {
  content: "";
  position: absolute;
  inset: 20px;
  border-radius: var(--sp-radius-lg);
  border: 1px dashed rgba(37, 99, 235, 0.06);
  pointer-events: none;
}

.workbench-main > * {
  position: relative;
  z-index: 1;
}

.workbench-status {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
}

/* ═══════════ CONFIG PANEL HEADER ═══════════ */
.config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sp-border);
}

.config-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--sp-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-header h2 svg {
  width: 18px;
  height: 18px;
  color: var(--sp-primary);
}

.config-version {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--sp-bg-soft);
  color: var(--sp-text-muted);
}

/* ═══════════ FORM INPUTS (UNIFIED) ═══════════ */
.wb-form-group {
  margin-bottom: 16px;
}

.wb-form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sp-text-sub);
  margin-bottom: 6px;
}

.wb-form-group label svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.wb-input,
.wb-select,
.wb-textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--sp-border);
  border-radius: 14px;
  background: rgba(239,246,255,0.65);
  font-size: 0.82rem;
  color: var(--sp-text-main);
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
}

.wb-textarea {
  height: auto;
  min-height: 100px;
  padding: 12px 14px;
  resize: vertical;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.wb-input:focus,
.wb-select:focus,
.wb-textarea:focus {
  border-color: var(--sp-primary-light);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.wb-input::placeholder,
.wb-textarea::placeholder {
  color: var(--sp-text-muted);
  opacity: 0.7;
}

.wb-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Coordinate row */
.coord-row {
  display: flex;
  gap: 8px;
}

.coord-row .wb-input {
  flex: 1;
  min-width: 0;
}

/* Two-column param grid */
.param-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.param-grid .wb-form-group {
  margin-bottom: 0;
}

/* ═══════════ FILE UPLOAD DROPZONE ═══════════ */
.upload-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  border: 2px dashed var(--sp-border-strong);
  border-radius: var(--sp-radius-sm);
  background: rgba(239,246,255,0.45);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--sp-primary-light);
  background: rgba(239,246,255,0.75);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.upload-dropzone.dragover {
  animation: dropzonePulse 1s ease infinite;
}

.upload-dropzone .upload-icon-bubble {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-dropzone .upload-icon-bubble svg {
  width: 20px;
  height: 20px;
  color: white;
}

.upload-dropzone strong {
  font-size: 0.82rem;
  color: var(--sp-text-sub);
}

.upload-dropzone .upload-hint {
  font-size: 0.72rem;
  color: var(--sp-text-muted);
}

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

.upload-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(37,99,235,0.08);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sp-primary);
  animation: chipSlideIn 0.3s ease;
}

.upload-file-chip svg {
  width: 12px;
  height: 12px;
}

/* ═══════════ BUTTONS ═══════════ */
.wb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

.wb-btn svg {
  width: 16px;
  height: 16px;
}

.wb-btn-primary {
  background: linear-gradient(135deg, var(--sp-primary), var(--sp-primary-light));
  color: white;
  box-shadow: 0 4px 16px rgba(37,99,235,0.25);
}

.wb-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}

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

.wb-btn-primary.loading {
  pointer-events: none;
  opacity: 0.8;
}

.wb-btn-primary.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

.wb-btn-secondary {
  background: var(--sp-bg-soft);
  color: var(--sp-text-sub);
  border: 1px solid var(--sp-border);
}

.wb-btn-secondary:hover {
  background: rgba(239,246,255,0.9);
  border-color: var(--sp-border-strong);
  transform: translateY(-1px);
}

.wb-btn-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.wb-btn-group .wb-btn {
  flex: 1;
}

/* ═══════════ ACCORDION / COLLAPSIBLE ═══════════ */
.wb-accordion {
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}

.wb-accordion summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sp-text-sub);
  cursor: pointer;
  list-style: none;
  transition: background 0.2s;
}

.wb-accordion summary::-webkit-details-marker {
  display: none;
}

.wb-accordion summary::marker {
  display: none;
  content: '';
}

.wb-accordion summary:hover {
  background: rgba(239,246,255,0.5);
}

.wb-accordion summary svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.wb-accordion .accordion-chevron {
  margin-left: auto;
  width: 14px;
  height: 14px;
  transition: transform 0.3s ease;
  opacity: 0.5;
}

.wb-accordion[open] .accordion-chevron {
  transform: rotate(90deg);
}

.wb-accordion-content {
  padding: 0 14px 14px;
  animation: accordionOpen 0.35s ease;
}

/* ═══════════ RUN STATUS PANEL ═══════════ */
.run-status-panel {
  background: var(--sp-bg-panel);
  backdrop-filter: var(--sp-blur);
  -webkit-backdrop-filter: var(--sp-blur);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 20px;
  box-shadow: var(--sp-shadow-soft);
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sp-border);
}

.status-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--sp-text-main);
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.status-idle {
  background: var(--sp-bg-soft);
  color: var(--sp-text-muted);
}

.status-running {
  background: rgba(37,99,235,0.1);
  color: var(--sp-primary);
  animation: badgePulse 2s ease infinite;
}

.status-done {
  background: rgba(20,184,166,0.1);
  color: var(--sp-teal);
}

.status-error {
  background: rgba(239,68,68,0.1);
  color: #EF4444;
}

.status-module-label {
  font-size: 0.75rem;
  color: var(--sp-text-muted);
  margin-bottom: 12px;
}

.status-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.log-entry {
  font-size: 0.73rem;
  color: var(--sp-text-sub);
  padding: 6px 10px;
  background: rgba(239,246,255,0.5);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  animation: logFadeIn 0.3s ease;
}

.log-time {
  color: var(--sp-text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.68rem;
  white-space: nowrap;
}

.status-summary {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--sp-radius-sm);
  background: rgba(20,184,166,0.06);
  border: 1px solid rgba(20,184,166,0.15);
}

/* ═══════════ PROGRESS BAR ═══════════ */
.wb-progress {
  width: 100%;
  height: 6px;
  background: rgba(37,99,235,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0;
}

.wb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sp-primary), var(--sp-cyan));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ═══════════ EMPTY STATE (LARGE ANIMATED) ═══════════ */
.empty-state {
  display: grid;
  place-items: center;
  padding: 48px 24px;
  height: 100%;
  min-height: calc(100vh - 240px);
}

.empty-state-inner {
  width: min(720px, 90%);
  text-align: center;
}

.empty-visual {
  width: clamp(260px, 32vw, 460px);
  height: clamp(220px, 28vw, 380px);
  margin: 0 auto 28px;
  position: relative;
}

.empty-visual svg {
  width: 100%;
  height: 100%;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sp-text-main);
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--sp-text-muted);
  max-width: 420px;
  line-height: 1.7;
  margin: 0 auto 24px;
}

.empty-state .wb-btn {
  height: 40px;
  font-size: 0.8rem;
  background: var(--module-soft, var(--sp-bg-soft));
  color: var(--module-accent, var(--sp-primary));
  border: 1px solid var(--module-accent, var(--sp-border-strong));
}

.empty-state .wb-btn:hover {
  background: var(--module-accent, var(--sp-primary));
  color: white;
}

/* Legacy small empty state override */
.empty-state svg.empty-illustration {
  width: 140px;
  height: 140px;
  margin-bottom: 24px;
  opacity: 0.6;
}

/* ═══════════ PIPELINE STEPPER (automation) ═══════════ */
.pipeline-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 32px;
  margin-bottom: 24px;
}

.pipe-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.pipe-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sp-bg-soft);
  border: 2px solid var(--sp-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.pipe-step.active .pipe-dot {
  background: linear-gradient(135deg, var(--sp-primary), var(--sp-cyan));
  border-color: transparent;
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}

.pipe-step.completed .pipe-dot {
  background: var(--sp-teal);
  border-color: transparent;
}

.pipe-step.completed .pipe-dot::after {
  content: '';
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M13.485 3.929a1 1 0 010 1.414l-6.364 6.364a1 1 0 01-1.414 0L3.05 9.05a1 1 0 011.414-1.414l2.121 2.121 5.657-5.657a1 1 0 011.414 0z'/%3E%3C/svg%3E") no-repeat center;
}

.pipe-step span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sp-text-muted);
  white-space: nowrap;
}

.pipe-step.active span {
  color: var(--sp-primary);
}

.pipe-step.completed span {
  color: var(--sp-teal);
}

.pipe-connector {
  width: 48px;
  height: 2px;
  background: var(--sp-border-strong);
  margin: 0 4px;
  margin-bottom: 22px;
  border-radius: 1px;
  position: relative;
}

.pipe-connector.filled {
  background: linear-gradient(90deg, var(--sp-teal), var(--sp-primary));
}

/* Pipeline Status Panel */
.pipeline-status-panel {
  background: var(--sp-bg-panel);
  backdrop-filter: var(--sp-blur);
  -webkit-backdrop-filter: var(--sp-blur);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-md);
  padding: 20px;
  box-shadow: var(--sp-shadow-soft);
}

.pipeline-stage-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.pipeline-stage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239,246,255,0.4);
  font-size: 0.78rem;
  color: var(--sp-text-sub);
}

.pipeline-stage-item.active {
  background: rgba(37,99,235,0.08);
  color: var(--sp-primary);
  font-weight: 600;
}

.pipeline-stage-item.completed {
  color: var(--sp-teal);
}

.pipeline-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sp-border-strong);
  flex-shrink: 0;
}

.pipeline-stage-item.active .pipeline-stage-dot {
  background: var(--sp-primary);
  animation: dotPulse 1.5s ease infinite;
}

.pipeline-stage-item.completed .pipeline-stage-dot {
  background: var(--sp-teal);
}

/* ═══════════ RADIO GROUP ═══════════ */
.wb-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(239,246,255,0.45);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wb-radio-option:hover {
  background: rgba(239,246,255,0.75);
}

.wb-radio-option:has(input:checked) {
  background: rgba(37,99,235,0.06);
  border-color: var(--sp-primary-light);
}

.wb-radio-option input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sp-primary);
  margin: 0;
  flex-shrink: 0;
}

.wb-radio-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sp-text-sub);
}

.wb-radio-desc {
  font-size: 0.7rem;
  color: var(--sp-text-muted);
  margin-left: auto;
}

/* ═══════════ CHECKBOX ═══════════ */
.wb-checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.wb-checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sp-primary);
  margin: 0;
  flex-shrink: 0;
}

.wb-checkbox-group span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sp-text-sub);
}

/* ═══════════ TOOLTIP ═══════════ */
.wb-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.wb-tooltip svg {
  width: 13px;
  height: 13px;
  color: var(--sp-text-muted);
  opacity: 0.6;
  cursor: help;
}

.wb-tooltip .wb-tooltip-text {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--sp-text-main);
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  max-width: 240px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.wb-tooltip:hover .wb-tooltip-text {
  opacity: 1;
}

/* ═══════════ RESULT CARDS ═══════════ */
.result-card {
  background: var(--sp-bg-panel-solid);
  border: 1px solid var(--sp-border);
  border-radius: var(--sp-radius-sm);
  padding: 18px;
  transition: all 0.2s ease;
  animation: cardFadeIn 0.4s ease both;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sp-shadow-card);
}

/* ═══════════ ERROR MESSAGE ═══════════ */
.wb-error {
  display: none;
  padding: 12px 16px;
  border-radius: var(--sp-radius-sm);
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  color: #DC2626;
  font-size: 0.8rem;
  margin-top: 12px;
  animation: cardFadeIn 0.3s ease;
}

/* ═══════════ ANIMATIONS ═══════════ */
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes dropzonePulse {
  0%, 100% { border-color: var(--module-accent, var(--sp-primary-light)); }
  50% { border-color: var(--module-accent-2, var(--sp-cyan)); }
}

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

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

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

@keyframes logFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* Empty state motion tokens */
@keyframes floatSoft {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -10px, 0); }
}

@keyframes pulseSoft {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes drawLine {
  from { stroke-dashoffset: 180; }
  to { stroke-dashoffset: 0; }
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes flowDots {
  0% { opacity: 0; transform: translateX(-20px) scale(0.5); }
  50% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(20px) scale(0.5); }
}

@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 4px var(--module-accent, rgba(37,99,235,0.3))); }
  50% { filter: drop-shadow(0 0 12px var(--module-accent, rgba(37,99,235,0.5))); }
}

/* SVG animation helpers */
.anim-float { animation: floatSoft 5s ease-in-out infinite; }
.anim-float-delay { animation: floatSoft 6s ease-in-out 1s infinite; }
.anim-pulse { animation: pulseSoft 4s ease-in-out infinite; }
.anim-pulse-delay { animation: pulseSoft 4.5s ease-in-out 0.8s infinite; }
.anim-glow { animation: glowPulse 3s ease-in-out infinite; }
.anim-rotate { animation: rotateSlow 20s linear infinite; }
.anim-draw { stroke-dasharray: 180; stroke-dashoffset: 180; animation: drawLine 4s ease forwards; }
.anim-draw-delay { stroke-dasharray: 180; stroke-dashoffset: 180; animation: drawLine 4s ease 1s forwards; }
.anim-flow { animation: flowDots 3s ease-in-out infinite; }
.anim-flow-2 { animation: flowDots 3s ease-in-out 1s infinite; }
.anim-flow-3 { animation: flowDots 3s ease-in-out 2s infinite; }

/* Loading dots */
.wb-loading-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.wb-loading-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sp-primary-light);
  animation: dotBounce 1.4s ease-in-out infinite;
}

.wb-loading-dots .dot:nth-child(2) { animation-delay: 0.16s; }
.wb-loading-dots .dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1200px) {
  .workbench {
    grid-template-columns: 340px 1fr;
    padding: 0 24px 40px;
  }

  .workbench-status {
    position: static;
    grid-column: 1 / -1;
    max-height: none;
  }

  .workbench-config {
    position: static;
    max-height: none;
  }

  .workbench-main {
    min-height: 500px;
  }

  .empty-visual {
    width: clamp(200px, 28vw, 380px);
    height: clamp(180px, 24vw, 320px);
  }
}

@media (max-width: 768px) {
  .workbench {
    grid-template-columns: 1fr;
    padding: 0 16px 32px;
  }

  .module-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 16px;
    gap: 16px;
  }

  .module-status-chip {
    align-self: flex-start;
  }

  .pipeline-stepper {
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
  }

  .pipe-connector {
    width: 24px;
  }

  .wb-btn-group {
    flex-direction: column;
  }

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

  .workbench-main {
    min-height: 400px;
  }

  .empty-state {
    min-height: 360px;
    padding: 32px 16px;
  }

  .empty-visual {
    width: clamp(180px, 60vw, 300px);
    height: clamp(150px, 50vw, 260px);
  }
}

/* ═══════════ PREFERS-REDUCED-MOTION ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
