@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

:root {
  --primary: #4318D1;
  --primary-light: #6B4DE6;
  --primary-dark: #3210A3;
  --primary-bg: #F4F1FE;
  --primary-bg-subtle: #F9F8FF;
  --accent-teal: #0EA5A0;
  --accent-purple: #7C3AED;
  --accent-green: #10B981;
  --accent-coral: #F43F5E;
  --accent-orange: #F97316;
  --accent-blue: #3B82F6;
  --accent-indigo: #6366F1;
  --accent-pink: #EC4899;
  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --bg-white: #FFFFFF;
  --bg-page: #FAFBFD;
  --bg-card-hover: #FEFEFE;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-card-hover: 0 8px 25px rgba(67,24,209,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --transition: all 0.2s ease;
  --nav-height: 64px;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex; align-items: center; gap: 12px;
}

.nav-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}

.nav-logo svg { width: 20px; height: 20px; }

.nav-brand-text h1 {
  font-size: 15px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em;
}

.nav-brand-text span {
  font-size: 11px; color: var(--text-tertiary); font-weight: 400; letter-spacing: 0.02em;
}

.nav-links {
  display: flex; align-items: center; gap: 4px;
  position: absolute; left: 50%; transform: translateX(-50%);
}

.nav-link {
  padding: 8px 18px; border-radius: var(--radius-full);
  font-size: 13.5px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  border: none; background: none; text-decoration: none;
}

.nav-link:hover { color: var(--text-primary); background: var(--border-light); }

.nav-link.active {
  background: var(--primary); color: white;
}

.nav-mode-toggle {
  display: flex; align-items: center;
  background: var(--border-light); border-radius: var(--radius-full); padding: 3px;
}

.mode-btn {
  padding: 6px 16px; border-radius: var(--radius-full);
  font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  border: none; background: none;
}

.mode-btn.active {
  background: var(--bg-white); color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.mode-btn:hover:not(.active) { color: var(--text-primary); }

/* LAYOUT */
.app-container {
  margin-top: var(--nav-height);
  display: flex;
  min-height: calc(100vh - var(--nav-height));
}

/* SIDEBAR */
.sidebar {
  width: 280px; min-width: 280px;
  background: var(--bg-white);
  border-right: 1px solid var(--border-light);
  padding: 28px 20px;
  overflow-y: auto;
  height: calc(100vh - var(--nav-height));
  position: sticky; top: var(--nav-height);
}

.sidebar-title {
  font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px;
}

.sidebar-subtitle {
  font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 20px;
}

.sidebar-search {
  width: 100%; padding: 10px 14px; padding-left: 36px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; color: var(--text-primary);
  background: var(--bg-page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239CA3AF' viewBox='0 0 24 24'%3E%3Cpath d='M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z' stroke='%239CA3AF' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") 12px center no-repeat;
  transition: var(--transition); outline: none;
  font-family: inherit;
  margin-bottom: 20px;
}

.sidebar-search:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(67,24,209,0.08);
}

.sidebar-search::placeholder { color: var(--text-tertiary); }

.action-category {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
  margin-bottom: 4px;
}

.action-category:hover { background: var(--primary-bg-subtle); }

.action-category-left {
  display: flex; align-items: center; gap: 12px;
}

.action-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.action-icon.wet-lab { background: #EEE5FF; color: #7C3AED; }
.action-icon.sequencing { background: #E0F7F6; color: #0EA5A0; }
.action-icon.secondary { background: #EDE9FE; color: #6366F1; }
.action-icon.tertiary { background: #F0E7FF; color: #8B5CF6; }
.action-icon.integrations { background: #D1FAE5; color: #10B981; }
.action-icon.qc { background: #FFE4E6; color: #F43F5E; }
.action-icon.notifications { background: #FEE2E2; color: #EF4444; }
.action-icon.ai-agents { background: #FFEDD5; color: #F97316; }

.action-category-name { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.action-category-count { font-size: 12px; color: var(--text-tertiary); }

.action-category-chevron {
  color: var(--text-tertiary); font-size: 14px; transition: var(--transition);
}

/* MAIN CONTENT */
.main-content {
  flex: 1; padding: 32px 40px; max-width: 960px;
}

/* HERO HEADER */
.hero {
  background: linear-gradient(160deg, var(--primary-bg) 0%, #EDE9FE 40%, var(--bg-page) 100%);
  border-radius: var(--radius-xl);
  padding: 36px 40px 32px;
  margin-bottom: 28px;
  position: relative; overflow: hidden;
}

.hero::after {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(107,77,230,0.06);
}

.hero-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.7); backdrop-filter: blur(8px);
  font-size: 12px; font-weight: 500; color: var(--accent-green);
  margin-bottom: 16px;
}

.hero-status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-green);
}

.hero-title {
  font-size: 28px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.02em; margin-bottom: 6px; line-height: 1.2;
}

.hero-subtitle {
  font-size: 14.5px; color: var(--text-secondary); font-weight: 400;
  margin-bottom: 20px; max-width: 500px;
}

.hero-ctas {
  display: flex; gap: 10px; align-items: center;
}

.hero-cta-link {
  font-size: 13px; font-weight: 500; color: var(--primary);
  cursor: pointer; text-decoration: none; display: flex; align-items: center; gap: 4px;
}

.hero-cta-link:hover { text-decoration: underline; }

.hero-meta {
  display: flex; gap: 20px; align-items: center; margin-top: 16px;
}

.hero-meta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-secondary);
}

.hero-meta-item strong { font-weight: 600; color: var(--text-primary); }

.hero-actions {
  position: absolute; top: 36px; right: 40px;
  display: flex; gap: 10px; align-items: center;
}

.hero-sm {
  padding: 24px 32px 20px;
}

.hero-sm .hero-title { font-size: 22px; margin-bottom: 4px; }
.hero-sm .hero-subtitle { font-size: 13px; margin-bottom: 0; }

/* TABS */
.tabs {
  display: flex; gap: 4px; margin-bottom: 28px;
  background: var(--border-light); border-radius: var(--radius-full);
  padding: 3px; width: fit-content;
}

.tab {
  padding: 8px 20px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
  border: none; background: none; display: flex; align-items: center; gap: 6px;
  font-family: inherit;
}

.tab.active {
  background: var(--bg-white); color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

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

.tab-icon { font-size: 14px; }

/* WORKFLOW CARDS GRID */
.workflow-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}

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

/* E2E WORKFLOW CARD */
.workflow-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px; cursor: pointer;
  transition: var(--transition);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-card);
}

.workflow-card:hover {
  border-color: rgba(67,24,209,0.15);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

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

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

.badge {
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}

.badge-validated { background: #D1FAE5; color: #059669; }
.badge-draft { background: #FEF3C7; color: #D97706; }

.workflow-card-steps {
  font-size: 12.5px; color: var(--text-secondary); margin-bottom: 16px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.workflow-card-steps .step-arrow { color: var(--text-tertiary); }

.workflow-card-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}

.workflow-card-meta-label { font-size: 12px; color: var(--text-tertiary); }
.workflow-card-meta-value { font-size: 13px; font-weight: 500; color: var(--text-primary); }

.workflow-card-instruments {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px;
}

.instrument-tag {
  padding: 4px 10px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 500; color: var(--text-secondary);
  background: var(--border-light);
}

.btn-start {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; border: none; border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: var(--transition); display: flex; align-items: center;
  justify-content: center; gap: 8px;
  font-family: inherit;
}

.btn-start:hover {
  box-shadow: 0 4px 16px rgba(67,24,209,0.3);
  transform: translateY(-1px);
}

/* STEP WORKFLOW CARD */
.step-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px; cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.step-card:hover {
  border-color: rgba(67,24,209,0.15);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.step-card-title {
  font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px;
}

.step-card-category {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; margin-bottom: 16px;
}

.cat-qc { background: #FFE4E6; color: #E11D48; }
.cat-analysis { background: #EDE9FE; color: #7C3AED; }
.cat-reporting { background: #DBEAFE; color: #2563EB; }
.cat-integration { background: #D1FAE5; color: #059669; }

.step-card-runtime {
  font-size: 13px; color: var(--text-tertiary);
}

/* SCREEN: E2E OVERVIEW */
.e2e-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}

.e2e-title { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }

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

.btn-secondary {
  padding: 9px 18px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  background: var(--bg-white); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  font-family: inherit;
}

.btn-secondary:hover { border-color: var(--primary-light); color: var(--primary); }

.btn-primary {
  padding: 9px 18px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none; cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
  font-family: inherit;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(67,24,209,0.3);
}

.btn-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); transition: var(--transition); font-size: 16px;
}

.btn-close:hover { border-color: var(--accent-coral); color: var(--accent-coral); }

.e2e-section-label {
  font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px;
}

.e2e-section-desc {
  font-size: 13px; color: var(--text-secondary); margin-bottom: 24px;
}

.e2e-step-count {
  font-size: 13px; color: var(--text-tertiary); font-weight: 500;
}

/* PHASE CARDS */
.phase-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 12px; overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

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

.phase-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; cursor: pointer;
}

.phase-card-left { display: flex; align-items: center; gap: 14px; }

.phase-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.phase-card-info h3 { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
.phase-card-info p { font-size: 12.5px; color: var(--text-secondary); margin-top: 1px; }

.phase-card-right {
  display: flex; align-items: center; gap: 12px;
}

.phase-step-count { font-size: 12.5px; color: var(--text-tertiary); font-weight: 500; }

.phase-chevron {
  color: var(--text-tertiary); transition: transform 0.2s ease; font-size: 18px;
}

.phase-card.expanded .phase-chevron { transform: rotate(180deg); }

.phase-card-body {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
}

.phase-card.expanded .phase-card-body { max-height: 300px; }

.phase-card-body-inner {
  padding: 0 22px 18px 22px;
  border-top: 1px solid var(--border-light);
}

.step-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 10px;
}

.step-preview-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.btn-edit {
  padding: 6px 14px; border-radius: var(--radius-md);
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--primary-bg); border: none;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 5px;
  font-family: inherit;
}

.btn-edit:hover { background: #E8E0FD; }

.step-preview-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.step-preview-item:last-child { border-bottom: none; }

.step-preview-left { display: flex; align-items: center; gap: 12px; }

.step-num {
  font-size: 12px; color: var(--text-tertiary); font-weight: 500;
  width: 20px; text-align: center;
}

.step-preview-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

.step-preview-info h4 { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.step-preview-info p { font-size: 11.5px; color: var(--text-tertiary); }

.step-action-label {
  font-size: 11.5px; color: var(--text-tertiary); font-weight: 500;
  padding: 4px 10px; background: var(--border-light); border-radius: var(--radius-full);
}

/* PHASE CONNECTOR */
.phase-connector {
  display: flex; justify-content: center; padding: 4px 0;
}

.phase-connector-line {
  width: 2px; height: 16px; background: var(--border);
  border-radius: 1px;
}

/* SCREEN: STEP EDITOR */
.editor-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}

.editor-breadcrumb {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}

.editor-breadcrumb a {
  color: var(--primary); text-decoration: none; font-weight: 500;
  cursor: pointer;
}

.editor-breadcrumb a:hover { text-decoration: underline; }

.editor-breadcrumb .separator { color: var(--text-tertiary); }

.editor-phase-name { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }

/* STEP CHAIN */
.step-chain { display: flex; flex-direction: column; align-items: center; }

.step-block {
  width: 100%; max-width: 580px;
  background: var(--bg-white); border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  cursor: pointer;
}

.step-block:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(67,24,209,0.15);
}

.step-block-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.step-block-info { flex: 1; }
.step-block-label { font-size: 11.5px; color: var(--text-tertiary); font-weight: 500; }
.step-block-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }

.step-connector {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 0;
}

.step-connector-line {
  width: 2px; height: 20px;
  background: var(--border); border-radius: 1px;
}

.add-step-between {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px dashed var(--border);
  background: var(--bg-white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 14px;
  transition: var(--transition);
}

.add-step-between:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-bg);
}

.add-step-btn {
  width: 100%; max-width: 580px;
  padding: 14px; border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  background: var(--bg-white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; font-size: 13.5px; font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  font-family: inherit;
}

.add-step-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-bg-subtle);
}

/* TIP BAR */
.tip-bar {
  background: var(--primary-bg);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 13px; color: var(--text-secondary);
  margin-top: 28px;
  display: flex; align-items: flex-start; gap: 10px;
}

.tip-bar strong { color: var(--primary); font-weight: 600; }

/* FOOTER */
.app-footer {
  text-align: center; padding: 40px 0 24px;
  font-size: 12.5px; color: var(--text-tertiary);
}

/* SCREEN VISIBILITY */
.screen { display: none; }
.screen.active { display: block; }

/* TRANSITIONS */
.fade-in { animation: fadeIn 0.3s ease; }

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

/* RESPONSIVE (basic) */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .workflow-grid { grid-template-columns: 1fr; }
  .hero-actions { position: static; margin-top: 16px; }
}

/* PACK CARD ACTION COUNT */
.step-card-actions {
  font-size: 11.5px; color: var(--text-tertiary); margin-top: 4px;
  display: flex; align-items: center; gap: 8px;
}

.step-card-actions span { display: flex; align-items: center; gap: 4px; }

.step-card-desc {
  font-size: 12.5px; color: var(--text-secondary); margin-bottom: 12px;
  line-height: 1.4;
}

/* CONFIGURED INDICATOR */
.configured-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--accent-green);
  margin-left: auto;
}

/* SLIDE PANEL */
.slide-panel-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26,26,46,0.3);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}

.slide-panel-overlay.open {
  opacity: 1; pointer-events: auto;
}

.slide-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 201;
  width: 420px; background: var(--bg-white);
  box-shadow: -8px 0 30px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.slide-panel-overlay.open .slide-panel {
  transform: translateX(0);
}

.slide-panel-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

.slide-panel-title {
  font-size: 17px; font-weight: 600; color: var(--text-primary);
}

.slide-panel-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 16px;
  transition: var(--transition);
}

.slide-panel-close:hover { border-color: var(--accent-coral); color: var(--accent-coral); }

.slide-panel-body {
  flex: 1; overflow-y: auto; padding: 20px 28px;
}

.slide-panel-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border-light);
  display: flex; gap: 10px; align-items: center;
  flex-shrink: 0;
}

.slide-panel-footer .btn-primary { flex: 1; justify-content: center; }

.slide-panel-footer .btn-back {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; background: none; border: none; padding: 9px 14px;
  font-family: inherit;
}

.slide-panel-footer .btn-back:hover { color: var(--primary); }

/* PANEL: Pack Picker */
.panel-search {
  width: 100%; padding: 10px 14px 10px 36px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; color: var(--text-primary);
  background: var(--bg-page) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239CA3AF' viewBox='0 0 24 24'%3E%3Cpath d='M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z' stroke='%239CA3AF' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") 12px center no-repeat;
  outline: none; font-family: inherit; margin-bottom: 16px;
  transition: var(--transition);
}

.panel-search:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(67,24,209,0.08);
}

.panel-category-label {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 8px 0 6px; margin-top: 8px;
}

.panel-pack-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
  border: 1px solid transparent;
}

.panel-pack-item:hover {
  background: var(--primary-bg-subtle); border-color: rgba(67,24,209,0.1);
}

.panel-pack-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}

.panel-pack-info { flex: 1; }
.panel-pack-name { font-size: 13.5px; font-weight: 500; color: var(--text-primary); }
.panel-pack-meta { font-size: 11.5px; color: var(--text-tertiary); margin-top: 1px; }

/* PANEL: Pack Config */
.config-pack-header {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.config-pack-header-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.config-pack-header-info h3 {
  font-size: 15px; font-weight: 600; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}

.config-pack-header-info p {
  font-size: 12.5px; color: var(--text-secondary); margin-top: 2px;
}

.config-field {
  margin-bottom: 20px;
}

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

.config-field input[type="number"],
.config-field select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; color: var(--text-primary);
  background: var(--bg-white); outline: none;
  font-family: inherit;
  transition: var(--transition);
  -webkit-appearance: none;
}

.config-field input[type="number"]:focus,
.config-field select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(67,24,209,0.08);
}

.config-field .helper-text {
  font-size: 11.5px; color: var(--text-tertiary); margin-top: 4px;
}

.config-field-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
}

.config-field-toggle label { margin-bottom: 0; }

.toggle-switch {
  position: relative; width: 44px; height: 24px;
  background: var(--border); border-radius: var(--radius-full);
  cursor: pointer; transition: var(--transition);
  border: none;
}

.toggle-switch.active { background: var(--primary); }

.toggle-switch::after {
  content: ''; position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: white; transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch.active::after { transform: translateX(20px); }

/* TOAST */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 12px 24px; border-radius: var(--radius-md);
  background: var(--text-primary); color: white;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  z-index: 300; opacity: 0;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex; align-items: center; gap: 8px;
}

.toast.visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

.toast-icon { color: var(--accent-green); }

/* PANEL STATE VISIBILITY */
.panel-state { display: none; }
.panel-state.active { display: block; }

/* ── GUIDED TOUR ── */

.guide-badge {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.guide-badge:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  box-shadow: var(--shadow-card-hover);
}

.guide-badge kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.guide-badge.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.guide-badge.active kbd {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
  color: white;
}

.guide-callout {
  position: absolute;
  z-index: 350;
  padding: 14px 18px;
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  max-width: 280px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.guide-callout.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.guide-callout::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--text-primary);
  transform: rotate(45deg);
}

.guide-callout.arrow-bottom::after {
  bottom: -5px;
  left: 24px;
}

.guide-callout.arrow-top::after {
  top: -5px;
  left: 24px;
}

.guide-callout.arrow-left::after {
  left: -5px;
  top: 16px;
}

.guide-callout .guide-step-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}

.guide-callout .guide-text {
  font-weight: 500;
}

.guide-callout .guide-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
}

.guide-pulse {
  position: absolute;
  z-index: 340;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.guide-pulse.visible {
  opacity: 1;
}

.guide-pulse::before,
.guide-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.guide-pulse::before {
  background: var(--primary);
  opacity: 0.25;
  animation: guide-ping 1.8s cubic-bezier(0,0,0.2,1) infinite;
}

.guide-pulse::after {
  inset: 6px;
  background: var(--primary);
  opacity: 0.7;
}

@keyframes guide-ping {
  0% { transform: scale(1); opacity: 0.25; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}
