/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* ==========================================================================
   CUSTOM THEME COLORS
   Brand colors from Motion/Cascades design system
   ========================================================================== */
:root {
  --color-blue: #1814F3;
  --color-blue-05: #F2F4FF;
  --color-blue-30: #B3BFFF;
  --color-blue-70: #4D69FF;
  --color-blue-90: #1A3EFF;
  --color-catalina-blue: #343C6A;
  --color-glaucous: #718EBF;
  --color-green-ish: #16DBCC;
  --color-emerald: #16DBCC;
  --color-radical-red: #FE5C73;
  --color-link-water: #DFEAF2;
  --color-yellow-orange: #FFBB38;
  --color-token-green: #00DF81;
  --color-token-yellow: #FFBB38;
  --color-token-orange: #FE8742;
  --color-token-red: #FA3A55;
  --color-token-purple: #9233FE;
  --color-mirage: #0D122D;
  --color-mirage-05: #F3F3F5;
  --color-mirage-80: #3D4157;
  --color-mirage-60: #6E7181;
  --color-mirage-70: #56596C;
  --color-mirage-30: #B6B8C0;
  --color-mirage-20: #CFD0D5;
  --color-portage: #8094FF;
  --color-gray-05: #FAFAFA;
  --color-gray-chateau: #9EA0AB;
  --color-secondary-token-green-light: #D9FAEC;
  --color-secondary-token-yellow-light: #FFF5D9;
  --color-secondary-token-orange-light: #FFEFE5;
  --color-secondary-token-red-light: #FFE0EB;
  --color-secondary-token-purple-light: #F4E9FF;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
}

/* ==========================================================================
   MOTION BRAND FONT CLASSES
   ========================================================================== */
.motion-heading-font {
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-mirage);
  font-size: 28px;
}

.motion-semi-bold-font {
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--color-mirage);
  font-size: 15px;
  line-height: 150%;
}

.motion-regular-font {
  color: var(--color-mirage-80);
  font-family: InterVariable, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 150%;
}

/* ==========================================================================
   BUTTON STYLES
   Primary, Secondary, and Tertiary button variants
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #0029ff;
  border: 1px solid #0029ff;
  border-radius: 9px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: #001fcf;
  border-color: #001fcf;
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.3);
}

.btn-primary svg {
  color: #ffffff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #ffffff;
  border: 1px solid #0029ff;
  border-radius: 9px;
  color: #0029ff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background-color: #f2f4ff;
}

.btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.3);
}

.btn-secondary svg {
  color: #0029ff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 12px;
  background-color: #f2f4ff;
  border: 1px solid #f2f4ff;
  border-radius: 9px;
  color: #0029ff;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tertiary:hover {
  background-color: #e5eaff;
  border-color: #e5eaff;
}

.btn-tertiary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 41, 255, 0.15);
}

.btn-tertiary svg {
  color: #0029ff;
  fill: currentColor;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-0.5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes appear-then-fade {
  0%, 100% {
    opacity: 0;
  }
  5%, 60% {
    opacity: 1;
  }
}

/* ==========================================================================
   FLASH MESSAGES
   ========================================================================== */
.flash {
  position: fixed;
  top: 5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 100%;
  width: max-content;
  padding: 0 1rem;
  z-index: 9999;
}

.flash__message {
  font-size: 1rem;
  color: white;
  padding: 0.5rem 1rem;
  background-color: black;
  animation: appear-then-fade 4s both;
  border-radius: 999px;
}

.flash__notice {
  background-color: #4CAF50;
}

.flash__alert {
  background-color: #FFC107;
}

.flash__error {
  background-color: #F44336;
}

/* ==========================================================================
   TOOLTIP STYLES
   ========================================================================== */
.tooltip {
  position: fixed;
  display: none;
  background-color: #1F2937;
  color: white;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  z-index: 9999;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.group:hover .tooltip {
  display: block;
}

/* ==========================================================================
   DROPDOWN STYLES
   ========================================================================== */
.dropdown-menu {
  display: none;
  min-width: 150px;
  z-index: 50;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 5px;
}

.dropdown-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #1d4ed8;
  background-color: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  text-decoration: none;
  margin-bottom: 0.25rem;
  width: 100%;
}

.dropdown-item:hover {
  background-color: #e5e7eb;
}

.dropdown-menu.show {
  display: block;
}

/* ==========================================================================
   DOCKET TABLE STYLES
   Flex-based table layout matching Motion brand design
   ========================================================================== */
.docket-table-header {
  display: flex;
  background-color: var(--color-mirage-05, #F3F3F5);
  padding: 12px 15px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-mirage-80, #3D4157);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docket-table-header a {
  color: inherit;
  text-decoration: none;
}

.docket-table-header a:hover {
  color: inherit;
}

.docket-table-row {
  display: flex;
  padding: 12px 15px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
}

.docket-table-row:last-child {
  border-bottom: none;
}

/* ==========================================================================
   FILTER DROPDOWN STYLES
   Search and filter UI components
   ========================================================================== */
.filter-dropdown {
  background: white;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 9px;
  padding: 16px;
  min-width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.filter-inline {
  background: white;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 39px;
  padding: 0 12px;
  border-radius: 9px;
}

.filter-inline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-inline-select {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  padding: 0;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 6px;
  font-size: 14px;
  color: var(--color-mirage-80, #3D4157);
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-blue-90, #1A3EFF);
  box-shadow: 0 0 0 3px rgba(26, 62, 255, 0.15);
}

.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.filter-divider {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-link-water, #DFEAF2);
}

/* Hidden utility class for Stimulus controllers */
.hidden {
  display: none !important;
}

/* ==========================================================================
   WORKFLOWS UI CUSTOM CLASSES
   Custom width, height, gap, and styling for workflows table
   ========================================================================== */

/* Table column widths */
.col-w-60 { width: 60px; flex-shrink: 0; }
.col-w-80 { width: 80px; flex-shrink: 0; }
.col-w-100 { width: 100px; flex-shrink: 0; }
.col-w-120 { width: 120px; flex-shrink: 0; }
.col-w-150 { width: 150px; flex-shrink: 0; }
.col-code-sm { width: 120px; flex-shrink: 0; }
.col-created { width: 170px; flex-shrink: 0; }

/* Flex columns for name/code - share remaining space */
.col-name {
  flex: 1.1;
  min-width: 0;
}

.col-code {
  flex: 0.9;
  min-width: 0;
}

/* Search bar */
.search-bar {
  background: white;
  border: 1px solid #dfeaf2;
  display: flex;
  gap: 12px;
  height: 39px;
  align-items: center;
  padding: 0 9px;
  border-radius: 9px;
  width: 333px;
}

.search-input {
  width: 100%;
  font-weight: 400;
  font-size: 14px;
  color: #868896;
  line-height: 20px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  background: transparent;
}

.search-input::placeholder {
  color: #868896;
}

.search-input:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.search-btn {
  background: #f7f9fb;
  border: 1px solid #f2f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

/* Filter button */
.filter-btn {
  background: white;
  border: 1px solid #dfeaf2;
  display: flex;
  gap: 12px;
  height: 39px;
  align-items: center;
  padding: 0 9px;
  border-radius: 9px;
  cursor: pointer;
}

.filter-btn:hover {
  background: #f9fafb;
}

.filter-icon-box {
  background: #f7f9fb;
  border: 1px solid #f2f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Icon sizes */
.icon-15 { width: 15px; height: 15px; }
.icon-18 { width: 18px; height: 18px; }
.icon-19 { width: 19px; height: 19px; }

/* Gap utilities */
.gap-15 { gap: 15px; }

/* Colors */
.text-mirage { color: #0D122D; }
.text-mirage-80 { color: #3D4157; }
.text-mirage-70 { color: #56596C; }
.text-mirage-60 { color: #6E7181; }
.text-mirage-30 { color: #B6B8C0; }
.text-muted { color: #868896; }
.text-brand-blue { color: #1a3eff; }
.bg-zebra { background-color: #FAFAFA; }

/* Status badge with dot */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  min-height: 28px;
  box-sizing: border-box;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge-active {
  border: 1px solid #bbf7d0;
}

.status-badge-draft {
  border: 1px solid #e5e7eb;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot-active {
  background-color: #16a34a;
}

.status-dot-draft {
  background-color: #9ca3af;
}

/* Row actions dropdown */
.actions-dropdown {
  position: absolute;
  right: 0;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 100;
  min-width: 180px;
  padding: 4px;
}

.action-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px;
  gap: 12px;
  border-radius: 6px;
  font-size: 14px;
  color: #3D4157;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.action-item:hover {
  background-color: #f9fafb;
}

.action-item-danger {
  color: #dc2626;
}

.action-item-danger:hover {
  background-color: #fef2f2;
}

.action-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
}

.action-toggle {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-mirage-60, #6E7181);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.action-toggle:hover {
  background: #f5f7ff;
  border-color: var(--color-blue-30, #B3BFFF);
  color: var(--color-blue, #1814F3);
}

.action-toggle:focus-visible {
  outline: none;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.15);
}

/* Pagination */
.pagy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-mirage-70, #56596C);
}

.pagy a,
.pagy span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1px solid var(--color-link-water, #DFEAF2);
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
}

.pagy a:hover {
  border-color: var(--color-blue-30, #B3BFFF);
  background: #f5f7ff;
  color: var(--color-blue, #1814F3);
}

.pagy .active {
  background: var(--color-blue, #1814F3);
  border-color: var(--color-blue, #1814F3);
  color: #ffffff;
  font-weight: 600;
}

.pagy .disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagy .gap {
  border-color: transparent;
  background: transparent;
}

/* ==========================================================================
   DISABLED STATES
   ========================================================================== */
a:disabled,
button:disabled,
input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:disabled {
  background-color: #d1d5db;
  color: #6b7280;
}

input:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
}

a.disabled {
  background-color: #d1d5db;
  color: #6b7280;
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tailwind-like utility classes */
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-white { background-color: #ffffff; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-600 { background-color: #16a34a; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-yellow-100 { background-color: #fef3c7; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-gray-400 { background-color: #9ca3af; }

.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-800 { color: #1e40af; }
.text-blue-900 { color: #1e3a8a; }
.text-green-700 { color: #15803d; }
.text-green-800 { color: #166534; }
.text-red-600 { color: #dc2626; }
.text-red-700 { color: #b91c1c; }
.text-red-800 { color: #991b1b; }
.text-red-900 { color: #7f1d1d; }
.text-yellow-800 { color: #92400e; }
.text-purple-800 { color: #6b21a8; }
.text-white { color: #ffffff; }

.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-blue-500 { border-color: #3b82f6; }
.border-green-400 { border-color: #4ade80; }
.border-green-200 { border-color: #bbf7d0; }
.border-amber-400 { border-color: #fbbf24; }
.border-red-200 { border-color: #fecaca; }
.border-transparent { border-color: transparent; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }

.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   DRAWFLOW OVERRIDES
   Custom styling for workflow canvas and nodes
   ========================================================================== */
#drawflow {
  width: 100%;
  height: 100%;
  background: #ffffff;
  background-size: 14px 14px;
  background-image: radial-gradient(#DFEAF2 1px, transparent 1px);
}

/* Original drawflow styles - keep for other visualizations */
.drawflow .drawflow-node {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: #0D122D !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-family: 'Inter', sans-serif !important;
  width: 300px !important;
  min-width: 240px;
}

.drawflow .drawflow-node.selected .custom-node,
.drawflow .drawflow-node.selected .base-node {
  border: 1px solid var(--color-blue-90, #1A3EFF) !important;
}

/* START badge for Event nodes */
.node-start-badge {
  position: absolute;
  top: -10px;
  left: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
  z-index: 10;
}

.node-warning-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  box-sizing: border-box;
}

.node-warning-badge svg {
  width: 18px;
  height: 18px;
}

.node-warning-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0D122D;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.1s ease-out, transform 0.1s ease-out;
}

.node-warning-badge:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.node-warning-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(245, 158, 11, 0.5);
}

.drawflow .drawflow-node .inputs,
.drawflow .drawflow-node .outputs {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.drawflow .drawflow-node .input,
.drawflow .drawflow-node .output {
  border: 0 !important;
  background: none !important;
}

.drawflow .connection .main-path {
  fill: none !important;
  stroke-width: 1.5px !important;
  stroke: #DFEAF2 !important;
  pointer-events: all !important;
}

.drawflow .connection .main-path:hover {
  stroke: var(--color-blue-90, #1A3EFF) !important;
  stroke-width: 2px !important;
}

.drawflow .drawflow-delete {
  background: #ef4444;
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   CUSTOM OUTPUT PORTS
   Circle-style output ports with labels
   ========================================================================== */
.custom-outputs {
  position: absolute;
  right: 0;
  top: 46%;
  transform: translate(50%, -50%);
}

.drawflow-node-output {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 20px;
  height: 20px;
  justify-content: center;
  margin-bottom: 5px;
}

.drawflow-node-output::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  width: 14px;
  height: 14px;
  background: #DFEAF2;
  border-radius: 50%;
  border: 1.5px solid #DFEAF2;
}

.custom-port-label {
  max-width: 40px;
  margin-left: -40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
}

/* ==========================================================================
   CUSTOM INPUT PORT (Arrow style)
   ========================================================================== */
.custom-port-arrow {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-81%, -67%);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   VERTICAL LAYOUT MODE
   Adjustments for vertical workflow orientation
   ========================================================================== */
#drawflow-visualization.vertical .drawflow-node {
  display: block;
}

#drawflow-visualization.vertical .drawflow-node .inputs,
#drawflow-visualization.vertical .drawflow-node .outputs {
  display: flex;
  width: auto;
  justify-content: center;
  align-items: center;
}

#drawflow-visualization.vertical .drawflow .drawflow-node .input {
  top: 10px !important;
  left: 0px !important;
  transform: unset !important;
}

#drawflow-visualization.vertical .drawflow .drawflow-node .output {
  top: -5px !important;
  right: 0px !important;
  margin-bottom: 0 !important;
  margin-right: 5px !important;
  transform: unset !important;
}

#drawflow-visualization.vertical .drawflow-node .custom-outputs {
  bottom: 0;
  top: unset;
  right: 50%;
  transform: translate(50%, 50%);
  display: flex;
}

#drawflow-visualization.vertical .drawflow-node .drawflow-node-output {
  margin-bottom: 0px;
  margin-right: 5px;
  display: block;
}

#drawflow-visualization.vertical .drawflow-node .custom-port-label {
  margin-top: -25px;
  margin-left: 0;
  margin-right: 5px;
  height: 25px;
}

#drawflow-visualization.vertical .drawflow-node .custom-port-arrow {
  left: unset;
  top: -5px;
  right: 50%;
  transform: translate(50%,-50%) rotate(90deg);
}

/* Node drag items */
.node-drag-item {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.node-drag-item:hover {
  transform: translateY(-1px);
}

.node-drag-item:active {
  transform: scale(0.98);
  opacity: 0.8;
}

/* Sidebar transitions */
[data-visualization-ui-target="leftSidebar"],
[data-visualization-ui-target="rightSidebar"] {
  transition: width 0.2s ease, opacity 0.2s ease;
}

[data-visualization-ui-target="leftSidebar"].collapsed,
[data-visualization-ui-target="rightSidebar"].collapsed {
  opacity: 0;
}

/* Form inputs */
input[type="text"],
input[type="url"],
input[type="number"],
input[type="email"],
select:not(.btn-demo-select),
textarea {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #111827;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:not(.btn-demo-select):focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Form input - Motion styled */
.form-input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-mirage, #0D122D);
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

/* Form card */
.form-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-link-water, #DFEAF2);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
  background: linear-gradient(135deg, #f3f6ff 0%, #f7fbf5 55%, #fff7f0 100%);
  position: relative;
  overflow: hidden;
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  color: #0b1227;
}

.auth-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 48px;
  align-items: center;
  max-width: 1100px;
  width: 100%;
}

.auth-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(0);
  opacity: 0.6;
  animation: auth-float 16s ease-in-out infinite;
}

.auth-orb-1 {
  width: 260px;
  height: 260px;
  top: -40px;
  left: -60px;
  background: radial-gradient(circle at 30% 30%, #b9d3ff, transparent 70%);
}

.auth-orb-2 {
  width: 220px;
  height: 220px;
  bottom: -60px;
  right: 15%;
  background: radial-gradient(circle at 50% 50%, #c5f2d8, transparent 70%);
  animation-delay: -4s;
}

.auth-orb-3 {
  width: 180px;
  height: 180px;
  top: 30%;
  right: -40px;
  background: radial-gradient(circle at 40% 40%, #ffd7b0, transparent 70%);
  animation-delay: -8s;
}

@keyframes auth-float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
  100% {
    transform: translateY(0);
  }
}

.auth-side {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.auth-brand {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #1a3eff;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 600;
  margin-bottom: 16px;
}

.auth-subtitle {
  font-size: 15px;
  color: #4b5563;
  margin-bottom: 32px;
}

.auth-metrics {
  display: flex;
  gap: 24px;
}

.auth-metric {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(24, 20, 243, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 140px;
  box-shadow: 0 6px 16px rgba(12, 20, 36, 0.06);
}

.auth-metric-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #0b1227;
}

.auth-metric-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(24, 20, 243, 0.08);
  box-shadow: 0 18px 40px rgba(12, 20, 36, 0.12);
  padding: 28px;
  animation: auth-rise 0.5s ease-out;
}

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

.auth-card-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.auth-card-header p {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-label {
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  display: block;
  margin-bottom: 8px;
}

.auth-field .form-input {
  background: #f5f7ff;
  border-color: #d9e1f7;
}

.auth-field .form-input:focus {
  background: #ffffff;
}

.auth-submit {
  margin-top: 8px;
  height: 44px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 12px;
}

@media (max-width: 900px) {
  .auth-shell {
    padding: 40px 20px;
  }

  .auth-content {
    grid-template-columns: 1fr;
  }

  .auth-side {
    text-align: center;
    margin: 0 auto;
  }

  .auth-metrics {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Workflow badge */
.workflow-badge {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
  border: 1px solid rgba(24, 20, 243, 0.1);
  border-radius: 24px;
  font-size: 13px;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 32px;
}

.workflow-badge strong {
  color: var(--color-blue, #1814F3);
  font-weight: 600;
}

/* Signed-in user chip */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: #f0f4ff;
  border: 1px solid #dfeaf2;
  color: #1a3eff;
  font-size: 12px;
  font-weight: 500;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #1814F3;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-email {
  color: #1a3eff;
}

@media (max-width: 640px) {
  .user-email {
    display: none;
  }
}

/* Goal cards */
.goal-cards-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.goal-cards-container form,
.goal-cards-container button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.goal-card {
  background-color: #ffffff;
  border-radius: 12px;
  border: none !important;
  outline: none !important;
  padding: 20px 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.goal-card:hover {
  box-shadow: 0 8px 24px rgba(24, 20, 243, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.goal-card-custom {
  background-color: #fafafa;
}

/* Goal template text */
.goal-template-text {
  text-decoration: none !important;
}

.goal-icon-container {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   WORKFLOW BUILDER STYLES
   ========================================================================== */

/* Top toolbar */
.builder-toolbar {
  height: 56px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background-color: var(--color-link-water, #DFEAF2);
}

.builder-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--color-mirage-60, #6E7181);
  transition: all 0.2s ease;
  text-decoration: none;
}

.builder-back-btn:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

.builder-workflow-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-workflow-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  margin: 0;
}

.builder-workflow-code {
  font-size: 12px;
  font-family: monospace;
  color: var(--color-mirage-60, #6E7181);
  background-color: var(--color-mirage-05, #F3F3F5);
  padding: 4px 10px;
  border-radius: 6px;
}

.builder-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--color-mirage-05, #F3F3F5);
  border-radius: 8px;
  padding: 4px;
}

.builder-zoom-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-zoom-btn:hover {
  background-color: #ffffff;
  color: var(--color-mirage, #0D122D);
}

.builder-zoom-label {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  cursor: pointer;
  background: none;
  border: none;
}

.builder-zoom-label:hover {
  color: var(--color-mirage, #0D122D);
}

.builder-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-icon-btn:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

/* Left sidebar */
.builder-sidebar {
  width: 280px;
  background-color: #ffffff;
  border-right: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
}

.builder-sidebar.collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
}

/* Sidebar edge toggle - positioned relative to main content area */
.sidebar-edge-toggle {
  position: absolute;
  top: 50%;
  left: 268px;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-left: none;
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: left 0.2s ease, background 0.2s ease;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar-edge-toggle:hover {
  background: #f3f4f6;
}

.sidebar-toggle-icon {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

/* Collapsed state */
.builder-sidebar.collapsed + .sidebar-edge-toggle {
  left: 0;
}

.builder-sidebar.collapsed + .sidebar-edge-toggle .sidebar-toggle-icon {
  transform: rotate(180deg);
}

/* Right Sidebar - Node Configuration */
.builder-right-sidebar {
  width: 320px;
  background-color: #ffffff;
  border-left: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.builder-right-sidebar.hidden {
  display: none;
}

/* Header - matches left sidebar tabs area */
.builder-right-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  background-color: #ffffff;
}

.builder-right-sidebar-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.builder-right-sidebar-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--color-mirage-30, #B6B8C0);
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-right-sidebar-close:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
  color: var(--color-mirage, #0D122D);
}

/* Node info card - matches left sidebar node items */
.builder-right-sidebar-node-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 12px 16px 0 16px;
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.builder-right-sidebar-node-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--node-vendor-color, var(--color-blue, #1814F3));
  border-radius: 10px 0 0 10px;
}

.builder-right-sidebar-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background-color: var(--color-blue-05, #F2F4FF);
  color: var(--color-blue, #1814F3);
}

.builder-right-sidebar-node-icon svg {
  width: 20px;
  height: 20px;
}

.builder-right-sidebar-node-info {
  flex: 1;
  min-width: 0;
}

.builder-right-sidebar-node-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-mirage, #0D122D);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-right-sidebar-node-type {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-mirage-60, #6E7181);
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.builder-right-sidebar-node-type-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Form content area */
.builder-right-sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  box-sizing: border-box;
  max-width: 100%;
}

.builder-right-sidebar-content * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Empty state */
.builder-right-sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-mirage-30, #B6B8C0);
  font-size: 13px;
  text-align: center;
}

/* Form section styling - matches left sidebar groups */
.builder-form-section {
  margin-bottom: 16px;
}

.builder-form-section:last-child {
  margin-bottom: 0;
}

.builder-form-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-30, #B6B8C0);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Form inputs - matches left sidebar search input */
.builder-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-mirage-80, #3D4157);
  margin-bottom: 4px;
}

.builder-form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.builder-form-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-form-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236E7181'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

.builder-form-select:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  resize: vertical;
  min-height: 80px;
}

.builder-form-textarea::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-form-textarea:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

.builder-form-help {
  font-size: 11px;
  color: var(--color-mirage-60, #6E7181);
  margin-top: 3px;
  line-height: 1.4;
}

/* Info boxes in forms */
.builder-form-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: var(--color-blue-05, #F2F4FF);
  border: 1px solid var(--color-blue-30, #B3BFFF);
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-info svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--color-blue, #1814F3);
}

.builder-form-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-warning svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #D97706;
}

.builder-form-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background-color: #ECFDF5;
  border: 1px solid #6EE7B7;
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-mirage-80, #3D4157);
}

.builder-form-success svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #059669;
}

/* Form container */
.builder-form-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Tabs */
.builder-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-tab {
  flex: 1;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  color: var(--color-mirage-60, #6E7181);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.builder-tab:hover {
  color: var(--color-mirage, #0D122D);
}

.builder-tab-active {
  color: var(--color-blue, #1814F3);
  border-bottom-color: var(--color-blue, #1814F3);
}

/* Search */
.builder-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-link-water, #DFEAF2);
}

.builder-search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--color-mirage, #0D122D);
  background-color: var(--color-mirage-05, #F3F3F5);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.builder-search-input::placeholder {
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-search-input:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.1);
}

/* Node list */
.builder-node-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.builder-node-empty {
  color: var(--color-mirage-60, #6E7181);
  font-size: 13px;
  padding: 12px 8px;
  text-align: center;
}

.builder-tab-description {
  font-size: 12px;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 16px;
}

/* Node groups */
.builder-node-group {
  margin-bottom: 20px;
}

.builder-node-group:last-child {
  margin-bottom: 0;
}

.builder-node-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-mirage-60, #6E7181);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.builder-node-group-title:hover {
  background-color: var(--color-mirage-05, #F3F3F5);
}

.builder-group-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--color-mirage-30, #B6B8C0);
}

.builder-group-title-text {
  flex: 1;
  text-align: left;
}

/* Collapsed state */
.builder-node-group[data-collapsed="true"] .builder-group-chevron {
  transform: rotate(-90deg);
}

.builder-node-group[data-collapsed="true"] .builder-node-items {
  display: none;
}

.builder-vendor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.builder-node-count {
  font-weight: 400;
  color: var(--color-mirage-30, #B6B8C0);
  margin-left: auto;
}

/* Node items */
.builder-node-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.builder-node-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background-color: #ffffff;
  border: 1px solid var(--color-link-water, #DFEAF2);
  border-radius: 10px;
  cursor: grab;
  transition: all 0.2s ease;
  min-height: 44px;
  touch-action: none;
  position: relative;
  overflow: hidden;
}

.builder-node-item[data-tooltip] {
  overflow: visible;
}

.builder-node-vendor-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 10px 0 0 10px;
}

.builder-node-item:hover {
  border-color: var(--color-blue-30, #B3BFFF);
  box-shadow: 0 2px 8px rgba(24, 20, 243, 0.08);
}

.builder-node-item:active {
  cursor: grabbing;
  border-color: var(--color-blue, #1814F3);
  box-shadow: 0 4px 12px rgba(24, 20, 243, 0.15);
}

.builder-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.builder-node-icon svg {
  width: 18px;
  height: 18px;
}

.builder-node-content {
  flex: 1;
  min-width: 0;
}

.builder-node-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-mirage, #0D122D);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-node-desc {
  font-size: 11px;
  color: var(--color-mirage-60, #6E7181);
  line-height: 1.3;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.builder-node-configurable-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-blue, #1814F3);
  background-color: var(--color-blue-05, #F2F4FF);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.builder-node-drag-handle {
  color: var(--color-mirage-30, #B6B8C0);
  flex-shrink: 0;
}

/* Node tooltip on hover */
.builder-node-item {
  position: relative;
}

.builder-node-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 12px;
  top: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0D122D;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
  max-width: 240px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.1s ease-out, transform 0.1s ease-out, visibility 0.1s ease-out;
  z-index: 20;
  pointer-events: none;
}

.builder-node-item[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 100%;
  margin-top: 0;
  border: 6px solid transparent;
  border-bottom-color: #0D122D;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.1s ease-out, visibility 0.1s ease-out;
  z-index: 20;
  pointer-events: none;
}

.builder-node-item[data-tooltip]:hover::after,
.builder-node-item[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hide hover effects during drag operations */
.builder-sidebar-dragging .builder-node-item:hover {
  border-color: var(--color-link-water, #DFEAF2);
  box-shadow: none;
}

.builder-sidebar-dragging .builder-node-item[data-tooltip]::after,
.builder-sidebar-dragging .builder-node-item[data-tooltip]::before {
  opacity: 0;
  visibility: hidden;
}

.builder-node-drag-handle svg {
  width: 16px;
  height: 16px;
}

/* Canvas area */
.builder-canvas {
  flex: 1 1 0%;
  min-height: 0; /* Important for flex children to shrink */
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: grab;
  background-color: var(--color-mirage-05, #F3F3F5);
  background-image: radial-gradient(var(--color-mirage-20, #CFD0D5) 1px, transparent 1px);
  background-size: 20px 20px;
}

.builder-canvas:active {
  cursor: grabbing;
}

/* ==========================================================================
   CRITICAL: Drawflow container hierarchy must ALL fill the canvas

   After Drawflow.start(), the structure becomes:
   #drawflow.builder-canvas.parent-drawflow
     └── .drawflow (created by Drawflow - handles pan events)
           └── .precanvas (holds nodes, gets transformed)
   ========================================================================== */

/* The element we initialize Drawflow on - becomes .parent-drawflow */
#drawflow.parent-drawflow,
.builder-canvas.parent-drawflow {
  width: 100% !important;
  height: 100% !important;
  min-height: 400px;
  position: relative !important;
  overflow: hidden !important;
  display: block !important;
}

/* The main drawflow container - THIS handles pan/drag events */
#drawflow.parent-drawflow > .drawflow,
.parent-drawflow > .drawflow {
  width: 100% !important;
  height: 100% !important;
  min-height: inherit !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  cursor: grab !important;
  background: transparent !important;
  overflow: visible !important;
  transform-origin: 0 0 !important;
}

#drawflow.parent-drawflow > .drawflow:active,
.parent-drawflow > .drawflow:active {
  cursor: grabbing !important;
}

/* Drawflow v0.x uses `.drawflow` as the transform layer */

/* Nodes should have move cursor */
.drawflow .drawflow-node {
  cursor: move !important;
}

/* ==========================================================================
   WORKFLOW BUILDER - Drawflow node customizations
   ========================================================================== */

#drawflow .drawflow .drawflow-node {
  background: #ffffff !important;
  border: 1px solid var(--color-link-water, #DFEAF2) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  padding: 0 !important;
  min-width: 220px !important;
  width: auto !important;
}

#drawflow .drawflow .drawflow-node:hover {
  border-color: var(--color-blue-30, #B3BFFF) !important;
  box-shadow: 0 4px 12px rgba(24, 20, 243, 0.08) !important;
}

#drawflow .drawflow .drawflow-node.selected {
  border-color: var(--color-blue, #1814F3) !important;
  box-shadow: 0 0 0 3px rgba(24, 20, 243, 0.15) !important;
}

#drawflow .drawflow .drawflow-node .inputs,
#drawflow .drawflow .drawflow-node .outputs {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#drawflow .drawflow .drawflow-node .input,
#drawflow .drawflow .drawflow-node .output {
  width: 14px !important;
  height: 14px !important;
  background: #ffffff !important;
  border: 2px solid var(--color-mirage-30, #B6B8C0) !important;
  border-radius: 50% !important;
}

#drawflow .drawflow .drawflow-node .input:hover,
#drawflow .drawflow .drawflow-node .output:hover {
  border-color: var(--color-blue, #1814F3) !important;
  background: var(--color-blue-05, #F2F4FF) !important;
}

/* If/Else node output port labels - subtle pill design */
#drawflow .drawflow .drawflow-node.IfElse .output_1::after,
#drawflow .drawflow .drawflow-node.IfElse .output_2::after {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

#drawflow .drawflow .drawflow-node.IfElse .output_1::after {
  content: 'True';
  color: #16a34a;
}

#drawflow .drawflow .drawflow-node.IfElse .output_2::after {
  content: 'False';
  color: #dc2626;
}

/* Connection lines */
#drawflow .drawflow .connection .main-path {
  stroke: var(--color-mirage-30, #B6B8C0) !important;
  stroke-width: 2px !important;
}

#drawflow .drawflow .connection .main-path:hover {
  stroke: var(--color-blue, #1814F3) !important;
  stroke-width: 3px !important;
}

/* Base node styling on canvas */
#drawflow .drawflow .base-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: none !important;
  width: 100%;
  box-sizing: border-box;
}

#drawflow .drawflow .base-node.border-amber-400 {
  background: #fffbeb;
}

#drawflow .drawflow .node-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

#drawflow .drawflow .node-icon-container svg {
  width: 20px;
  height: 20px;
}

/* Buttons */
.cursor-pointer { cursor: pointer; }
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }

/* Layout utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-full { width: 100%; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-2 { height: 0.5rem; }
.w-2 { width: 0.5rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-72 { width: 18rem; }
.w-80 { width: 20rem; }
.w-0 { width: 0; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-6 { padding-top: 1.5rem; }
.pl-2 { padding-left: 0.5rem; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-10 { margin-left: 2.5rem; }
.mr-3 { margin-right: 0.75rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }

.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-l { border-left-width: 1px; }
.border-r { border-right-width: 1px; }

.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-visible { overflow: visible; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.max-w-2xl { max-width: 42rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-table { max-width: 1100px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.shrink-0 { flex-shrink: 0; }

.whitespace-nowrap { white-space: nowrap; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.tracking-wider { letter-spacing: 0.05em; }

.inline-flex { display: inline-flex; }
.divide-y > * + * { border-top-width: 1px; }
.divide-gray-200 > * + * { border-color: #e5e7eb; }

.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }

/* Hover states */
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-white:hover { background-color: #ffffff; }
.hover\:bg-blue-50:hover { background-color: #eff6ff; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-red-50:hover { background-color: #fef2f2; }
.hover\:text-gray-700:hover { color: #374151; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:text-blue-800:hover { color: #1e40af; }
.hover\:text-blue-900:hover { color: #1e3a8a; }
.hover\:text-red-900:hover { color: #7f1d1d; }
.hover\:border-gray-300:hover { border-color: #d1d5db; }
.hover\:shadow-sm:hover { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.no-underline { text-decoration: none; }
.hover\:underline:hover { text-decoration: underline; }

/* Ring utilities */
.ring-2 { box-shadow: 0 0 0 2px var(--tw-ring-color, currentColor); }
.ring-green-100 { --tw-ring-color: rgba(220, 252, 231, 1); }
.ring-amber-100 { --tw-ring-color: rgba(254, 243, 199, 1); }
.ring-blue-200 { --tw-ring-color: rgba(191, 219, 254, 1); }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5); }
.focus\:border-blue-500:focus { border-color: #3b82f6; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
}

@media (min-width: 1024px) {
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Table styles */
table { border-collapse: collapse; }
th, td { padding: 0.75rem 1.5rem; }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
  animation: toast-enter 0.3s ease-out;
  max-width: 380px;
}

.toast-success {
  background-color: #10B981;
  color: white;
}

.toast-error {
  background-color: #EF4444;
  color: white;
}

.toast-warning {
  background-color: #F59E0B;
  color: white;
}

.toast-info {
  background-color: var(--color-blue, #1814F3);
  color: white;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.toast-dismiss:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.toast-exit {
  animation: toast-exit 0.3s ease-in forwards;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ==========================================================================
   DEMO EXECUTION STYLES
   n8n-style workflow execution visualization
   ========================================================================== */

/* Demo button in toolbar */
.btn-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  height: 38px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-demo:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

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

.btn-demo-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 38px;
  margin-left: 8px;
}

.btn-demo-dropdown-toggle:hover {
  background: #e5e7eb;
}

.btn-demo-dropdown-toggle svg {
  width: 14px;
  height: 14px;
  color: #6b7280;
}

/* Info icon with tooltip */
.scenario-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  color: #9ca3af;
  cursor: help;
  position: relative;
}

.scenario-info-icon:hover {
  color: #6b7280;
}

.scenario-info-icon[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 8px 12px;
  background: #1f2937;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  pointer-events: none;
  width: 200px;
  text-align: left;
}

.scenario-info-icon[data-tooltip]::before {
  content: "";
  position: absolute;
  top: calc(100% + 2px);
  right: 4px;
  border: 6px solid transparent;
  border-bottom-color: #1f2937;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
}

.scenario-info-icon[data-tooltip]:hover::after,
.scenario-info-icon[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
}

.scenario-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 100;
  min-width: 120px;
}

.scenario-dropdown.hidden {
  display: none;
}

.scenario-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
}

.scenario-option:hover {
  background: #f3f4f6;
}

.scenario-option:first-child {
  border-bottom: 1px solid #e5e7eb;
}

.btn-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-stop:hover {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

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

/* Demo Modal */
.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-modal.hidden {
  display: none;
}

.demo-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.demo-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 500px;
  margin: 20px;
  animation: modal-enter 0.3s ease-out;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.demo-modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.demo-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-modal-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.demo-modal-body {
  padding: 24px;
}

.demo-modal-description {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 20px 0;
}

.demo-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  border-radius: 0 0 16px 16px;
}

/* Scenario options */
.demo-scenario-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.demo-scenario-option {
  cursor: pointer;
}

.demo-scenario-option input[type="radio"] {
  display: none;
}

.demo-scenario-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.demo-scenario-option input[type="radio"]:checked + .demo-scenario-card {
  border-color: var(--color-blue, #1814F3);
  background-color: #f8faff;
}

.demo-scenario-card:hover {
  border-color: #d1d5db;
}

.demo-scenario-icon {
  flex-shrink: 0;
}

.demo-scenario-info h3 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.demo-scenario-info p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.demo-scenario-result {
  font-weight: 600;
}

/* Speed control */
.demo-speed-control {
  display: flex;
  align-items: center;
  gap: 16px;
}

.demo-speed-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.demo-speed-options {
  display: flex;
  gap: 8px;
}

.demo-speed-option {
  cursor: pointer;
}

.demo-speed-option input[type="radio"] {
  display: none;
}

.demo-speed-option span {
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.demo-speed-option input[type="radio"]:checked + span {
  background: var(--color-blue, #1814F3);
  color: #ffffff;
}

.demo-speed-option span:hover {
  background: #e5e7eb;
}

.demo-speed-option input[type="radio"]:checked + span:hover {
  background: var(--color-blue-90, #1A3EFF);
}

/* Progress Panel */
.demo-progress-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 340px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.demo-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
}

.demo-progress-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-progress-title h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.demo-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.demo-progress-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-progress-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-progress-list {
  padding: 16px 20px;
  max-height: 300px;
  overflow-y: auto;
}

.demo-progress-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.demo-progress-item:last-child {
  border-bottom: none;
}

.demo-progress-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-progress-dot {
  width: 8px;
  height: 8px;
  background: #d1d5db;
  border-radius: 50%;
}

.demo-progress-icon-pending .demo-progress-dot {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

.demo-progress-icon-running svg {
  animation: spin 1s linear infinite;
}

.demo-progress-info {
  flex: 1;
  min-width: 0;
}

.demo-progress-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #111827;
}

.demo-progress-status {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.demo-progress-status-success {
  color: #059669;
}

.demo-progress-status-running {
  color: #2563eb;
}

.demo-progress-status-skipped {
  color: #9ca3af;
}

.demo-progress-footer {
  padding: 12px 20px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.demo-progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6b7280;
}

/* Node states - targets the inner .base-node element */
/* RUNNING STATE - Blue glow with pulsing animation */
.demo-node-running .base-node {
  border: 2px solid #3b82f6 !important;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 4px 20px rgba(59, 130, 246, 0.3) !important;
  animation: node-running-glow 1.5s ease-in-out infinite;
}

/* SUCCESS STATE - Green with solid background */
.demo-node-success .base-node {
  border: 2px solid #10b981 !important;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 4px 12px rgba(16, 185, 129, 0.15) !important;
}

/* FAILED STATE - Red with strong visual feedback */
.demo-node-failed .base-node {
  border: 2px solid #ef4444 !important;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2), 0 4px 12px rgba(239, 68, 68, 0.15) !important;
}

/* PENDING STATE - Yellow/amber waiting indicator with clear "queued" appearance */
.demo-node-pending .base-node {
  border: 2px dashed #f59e0b !important;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15) !important;
  animation: node-pending-pulse 1.5s ease-in-out infinite;
  opacity: 0.85;
}

/* WAITING STATE - Orange with pulsing animation (for Wait nodes) */
.demo-node-waiting .base-node {
  border: 2px solid #f97316 !important;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 4px 20px rgba(249, 115, 22, 0.3) !important;
  animation: node-waiting-glow 1.5s ease-in-out infinite;
}

/* SKIPPED STATE - Grayed out */
.demo-node-skipped .base-node {
  opacity: 0.5;
  border: 1px dashed #9ca3af !important;
  background: #f9fafb !important;
}

/* Running state glow animation */
@keyframes node-running-glow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 4px 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.15), 0 4px 30px rgba(59, 130, 246, 0.4);
  }
}

/* Pending state pulse - more noticeable "waiting in queue" effect */
@keyframes node-pending-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
    opacity: 0.85;
  }
  50% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.08);
    opacity: 0.7;
  }
}

/* Waiting state glow animation */
@keyframes node-waiting-glow {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 4px 20px rgba(249, 115, 22, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(249, 115, 22, 0.15), 0 4px 30px rgba(249, 115, 22, 0.4);
  }
}

/* Waiting countdown overlay on node */
.demo-waiting-countdown {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
  z-index: 15;
  white-space: nowrap;
  animation: countdown-pop-in 0.3s ease-out;
}

@keyframes countdown-pop-in {
  0% {
    transform: translateX(-50%) scale(0);
    opacity: 0;
  }
  60% {
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

/* Status indicator on nodes - badge that appears at top-right */
.demo-status-indicator {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 28px;
  height: 28px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
  border: 2px solid #ffffff;
  animation: badge-pop-in 0.3s ease-out;
}

@keyframes badge-pop-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.demo-status-indicator svg {
  width: 18px;
  height: 18px;
}

/* Running indicator - blue background with spinning icon */
.demo-status-running {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: #3b82f6;
}

.demo-status-running svg {
  color: #ffffff !important;
  animation: status-spin 1s linear infinite;
}

/* Waiting indicator - orange background with spinning icon */
.demo-status-waiting {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border-color: #f97316;
}

.demo-status-waiting svg {
  color: #ffffff !important;
  animation: status-spin 1s linear infinite;
}

@keyframes status-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Success indicator - green background with check */
.demo-status-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
}

.demo-status-success svg {
  color: #ffffff !important;
}

/* Failed indicator - red background */
.demo-status-failed {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #ef4444;
}

.demo-status-failed svg {
  color: #ffffff !important;
}

/* Pending indicator - amber background with subtle pulse */
.demo-status-pending {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #f59e0b;
  animation: status-pending-pulse 1.2s ease-in-out infinite;
}

.demo-status-pending svg {
  color: #ffffff !important;
}

@keyframes status-pending-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.9);
    opacity: 0.7;
  }
}

/* Skipped indicator - gray */
.demo-status-skipped {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.demo-status-skipped svg {
  color: #6b7280 !important;
}

/* Connection animation */
.demo-connection-active .main-path {
  stroke: #10b981 !important;
  stroke-width: 3px !important;
  animation: connection-flow 0.5s ease-out;
}

@keyframes connection-flow {
  0% {
    stroke-dasharray: 10, 10;
    stroke-dashoffset: 20;
  }
  100% {
    stroke-dasharray: 10, 10;
    stroke-dashoffset: 0;
  }
}

/* Spin animation */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

/* Completion Toast - replaces modal for better UX */
.demo-completion-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  max-width: 450px;
  animation: toast-slide-in 0.4s ease-out;
  pointer-events: auto;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.demo-toast-exit {
  animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.demo-toast-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff;
}

.demo-toast-failed {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #ffffff;
}

.demo-toast-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.demo-toast-content {
  flex: 1;
  min-width: 0;
}

.demo-toast-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.demo-toast-subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.demo-toast-action {
  flex-shrink: 0;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-toast-action:hover {
  background: rgba(255, 255, 255, 0.3);
}

.demo-toast-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.demo-toast-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Legacy completion modal - kept for backwards compatibility */
.demo-completion-content {
  text-align: center;
  padding: 40px 24px;
}

.demo-completion-icon {
  margin-bottom: 20px;
}

.demo-completion-icon svg {
  width: 64px;
  height: 64px;
}

.demo-completion-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 24px 0;
}

.demo-completion-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.demo-stat {
  text-align: center;
}

.demo-stat-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.demo-stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

/* Inspector panel */
.demo-inspector-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 400px;
  max-height: 400px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  overflow: hidden;
  animation: slide-in-right 0.3s ease-out;
}

.demo-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1f2937;
  color: #ffffff;
}

.demo-inspector-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.demo-inspector-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-inspector-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.demo-inspector-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
}

.demo-inspector-tab {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.demo-inspector-tab:hover {
  color: #374151;
}

.demo-inspector-tab.active {
  color: var(--color-blue, #1814F3);
  border-bottom-color: var(--color-blue, #1814F3);
}

.demo-inspector-content {
  padding: 16px;
  max-height: 280px;
  overflow-y: auto;
  background: #1f2937;
}

.demo-inspector-content pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.demo-inspector-content code {
  color: #a5f3fc;
  font-family: 'Monaco', 'Menlo', monospace;
}
