/* =================================================================
   FilamentColors Compiler v6 – Full-Page Editor Layout
   Specialized for 3D printing with FilamentColors.xyz integration
   Features: Onboarding Tour, Undo/Redo, Help Tooltips
   Last Updated: 2025-12-13
   Version: 6.0.0
   ================================================================= */

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

/* -----------------------------------------------------------------
   CSS Variables - Design Tokens from Figma
----------------------------------------------------------------- */

/* Global design tokens */
:root {
  /* Typography - Spline Sans */
  --fc-font-family: 'Spline Sans', system-ui, -apple-system, sans-serif;
  --fc-font-size-xs: 11px;
  --fc-font-size-sm: 12px;
  --fc-font-size-md: 14px;
  --fc-font-size-lg: 16px;
  --fc-line-height-tight: 16px;
  --fc-line-height-normal: 24px;
  --fc-font-weight-regular: 400;
  --fc-font-weight-medium: 500;
  
  /* Spacing (4pt grid) */
  --fc-space-1: 4px;
  --fc-space-2: 8px;
  --fc-space-3: 12px;
  --fc-space-4: 16px;
  --fc-space-5: 20px;
  --fc-space-6: 24px;
  --fc-space-8: 32px;
  
  /* Radii */
  --fc-radius-sm: 8px;
  --fc-radius-md: 12px;
  --fc-radius-lg: 16px;
  --fc-radius-pill: 999px;
  
  /* Transitions */
  --fc-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --fc-sidebar-width: 300px;
}

.fc-compiler.v3 {
  /* Dark theme (default) - Spline Design System */
  
  /* Background Colors */
  --fc-bg-main: #121316;
  --fc-bg-app: #121316;
  --fc-bg-sidebar: #121316;
  --fc-bg-context: #212226;
  --fc-bg-surface: #191A1D;
  --fc-bg-surface-soft: #202124;
  --fc-bg-input: rgba(255, 255, 255, 0.03);
  --fc-bg-input-hover: rgba(255, 255, 255, 0.06);
  --fc-bg-overlay: rgba(18, 19, 22, 0.95);
  
  /* Elevation layers (opacity-based for dark mode) */
  --fc-elevation-01: rgba(255, 255, 255, 0.03);
  --fc-elevation-02: rgba(255, 255, 255, 0.06);
  --fc-elevation-03: rgba(255, 255, 255, 0.10);
  --fc-elevation-04: rgba(255, 255, 255, 0.20);
  
  /* Elevation layers (opaque alternatives) */
  --fc-elevation-01-opaque: #191A1D;
  --fc-elevation-02-opaque: #202124;
  --fc-elevation-03-opaque: #2A2B2D;
  --fc-elevation-04-opaque: #414245;

  /* Border */
  --fc-border: rgba(255, 255, 255, 0.05);
  --fc-border-subtle: rgba(255, 255, 255, 0.05);
  --fc-border-strong: rgba(255, 255, 255, 0.10);
  --fc-border-focus: #2589FF;

  /* Text Colors */
  --fc-text-opaque: #ffffff;
  --fc-text-primary: rgba(255, 255, 255, 0.9);
  --fc-text-secondary: rgba(255, 255, 255, 0.6);
  --fc-text-muted: rgba(255, 255, 255, 0.6);
  --fc-text-tertiary: rgba(255, 255, 255, 0.6);
  --fc-text-placeholder: rgba(255, 255, 255, 0.4);

  /* Accent Colors */
  --fc-accent-blue: #2589FF;
  --fc-accent-blue-dark: #1F77DE;
  --fc-accent-purple: #915EFF;
  --fc-accent-purple-dark: #7448D4;
  --fc-accent-purple-bright: #D680FF;
  --fc-accent-green: #00A376;
  --fc-accent-green-dark: #008761;
  --fc-accent-green-bright: #38E2B3;
  --fc-accent-red: #FD5B5D;
  --fc-accent-red-dark: #DB4D4F;
  --fc-accent-yellow: #FFB221;
  
  /* Legacy accent mapping */
  --fc-accent: #2589FF;
  --fc-accent-soft: rgba(37, 137, 255, 0.15);
  --fc-accent-strong: #1F77DE;

  /* Component-specific */
  --fc-slider-thumb: #505050;
  --fc-slider-track: #505050;
  --fc-toast-bg: rgba(30, 30, 30, 0.9);

  /* Shadows */
  --fc-shadow-popup: 0 8px 8px rgba(0, 0, 0, 0.4);
  --fc-shadow-menu: 0 4px 24px rgba(0, 0, 0, 0.15);
  --fc-shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --fc-shadow-float: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);

  --fc-swatch-active-ring: #ffffff;
}

/* Light theme - Spline Design System */
.fc-compiler.v3[data-theme="light"] {
  /* Background Colors */
  --fc-bg-main: #ffffff;
  --fc-bg-app: #ffffff;
  --fc-bg-sidebar: #ffffff;
  --fc-bg-context: #212226;
  --fc-bg-surface: #F7F7F7;
  --fc-bg-surface-soft: #F0F0F0;
  --fc-bg-input: rgba(0, 0, 0, 0.03);
  --fc-bg-input-hover: rgba(0, 0, 0, 0.06);
  --fc-bg-overlay: rgba(255, 255, 255, 0.95);

  /* Elevation layers (opacity-based for light mode) */
  --fc-elevation-01: rgba(0, 0, 0, 0.03);
  --fc-elevation-02: rgba(0, 0, 0, 0.06);
  --fc-elevation-03: rgba(0, 0, 0, 0.10);
  --fc-elevation-04: rgba(0, 0, 0, 0.20);
  
  /* Elevation layers (opaque alternatives) */
  --fc-elevation-01-opaque: #F7F7F7;
  --fc-elevation-02-opaque: #F0F0F0;
  --fc-elevation-03-opaque: #E5E5E5;
  --fc-elevation-04-opaque: #CCCCCC;

  /* Border */
  --fc-border: rgba(0, 0, 0, 0.05);
  --fc-border-subtle: rgba(0, 0, 0, 0.05);
  --fc-border-strong: rgba(0, 0, 0, 0.10);

  /* Text Colors */
  --fc-text-opaque: #000000;
  --fc-text-primary: rgba(0, 0, 0, 0.9);
  --fc-text-secondary: rgba(0, 0, 0, 0.6);
  --fc-text-muted: rgba(0, 0, 0, 0.6);
  --fc-text-tertiary: rgba(0, 0, 0, 0.6);
  --fc-text-placeholder: rgba(0, 0, 0, 0.4);

  /* Accent colors stay the same */
  --fc-accent: #2589FF;
  --fc-accent-soft: rgba(37, 137, 255, 0.15);
  --fc-accent-strong: #1F77DE;

  /* Shadows */
  --fc-shadow-popup: 0 8px 8px rgba(0, 0, 0, 0.1);
  --fc-shadow-menu: 0 4px 24px rgba(0, 0, 0, 0.08);
  --fc-shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.08);
  --fc-shadow-float: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);

  --fc-swatch-active-ring: #000000;
}

/* -----------------------------------------------------------------
   Reset & Base
----------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--fc-bg-app);
  font-family: "Spline Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fc-text-primary);
  -webkit-font-smoothing: antialiased;
}

/* -----------------------------------------------------------------
   Main Layout
----------------------------------------------------------------- */
.fc-compiler.v3 {
  position: fixed;
  inset: 0;
  display: flex;
  background: var(--fc-bg-app);
  overflow: hidden;
}

/* -----------------------------------------------------------------
   Sidebar
----------------------------------------------------------------- */
.fc-sidebar {
  position: relative;
  z-index: 100;
  width: var(--fc-sidebar-width);
  height: 100%;
  background: var(--fc-bg-sidebar);
  border-right: 1px solid var(--fc-border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--fc-transition), opacity var(--fc-transition), position 0s;
  will-change: transform, opacity;
}

.fc-compiler.v3[data-sidebar="closed"] .fc-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.fc-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--fc-border-subtle);
  flex-shrink: 0;
}

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

.fc-logo svg {
  color: var(--fc-accent);
}

.fc-logo-badge {
  padding: 2px 8px;
  background: var(--fc-accent-soft);
  border: 1px solid var(--fc-accent);
  border-radius: var(--fc-radius-pill);
  font-size: 10px;
  font-weight: 600;
  color: var(--fc-accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Header actions (theme toggle + close) */
.fc-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Theme toggle button */
.fc-theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--fc-radius-sm);
  border: none;
  background: transparent;
  color: var(--fc-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--fc-transition), color var(--fc-transition);
}

.fc-theme-toggle:hover {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-accent);
}

/* Show sun icon in dark mode, moon in light mode */
.fc-theme-icon-light { display: none; }
.fc-theme-icon-dark { display: block; }

.fc-compiler.v3[data-theme="light"] .fc-theme-icon-light { display: block; }
.fc-compiler.v3[data-theme="light"] .fc-theme-icon-dark { display: none; }

.fc-sidebar-close {
  width: 32px;
  height: 32px;
  border-radius: var(--fc-radius-sm);
  border: none;
  background: transparent;
  color: var(--fc-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--fc-transition), color var(--fc-transition);
}

.fc-sidebar-close:hover {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-primary);
}

.fc-sidebar-scroll {
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 12px 12px 24px;
}

/* -----------------------------------------------------------------
   Sidebar Toggle (when closed)
----------------------------------------------------------------- */
.fc-sidebar-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: var(--fc-radius-md);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface);
  color: var(--fc-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--fc-shadow-float);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  transition: opacity var(--fc-transition), transform var(--fc-transition), background var(--fc-transition);
}

.fc-compiler.v3[data-sidebar="closed"] .fc-sidebar-toggle {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.fc-sidebar-toggle:hover {
  background: var(--fc-bg-surface-soft);
}

/* -----------------------------------------------------------------
   Section styling
----------------------------------------------------------------- */
.fc-section {
  margin-bottom: 12px;
}

/* -----------------------------------------------------------------
   Details / Accordion
----------------------------------------------------------------- */
.fc-details {
  background: var(--fc-bg-surface-soft);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-md);
  margin-bottom: 8px;
  overflow: hidden;
}

.fc-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.fc-chevron {
  color: var(--fc-text-muted);
  transition: transform var(--fc-transition);
}

.fc-details[open] .fc-chevron {
  transform: rotate(180deg);
}

.fc-details-content {
  padding: 0 12px 12px;
  display: grid;
  gap: 10px;
}

/* OG Preview Card */
.fc-og-preview {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.fc-og-preview-image {
  width: 100%;
  aspect-ratio: 1200 / 630;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  overflow: hidden;
  position: relative;
}
.fc-og-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fc-og-preview-image.has-image svg,
.fc-og-preview-image.has-image span {
  display: none;
}
.fc-og-preview-text {
  padding: 12px 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  color: #000000;
}
.fc-og-preview-url {
  font-size: 11px;
  color: #374151;
  text-transform: lowercase;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.fc-og-preview-title {
  font-size: 15px;
  font-weight: 600;
  color: #000000;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fc-og-preview-desc {
  font-size: 13px;
  color: #1f2937;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -----------------------------------------------------------------
   Fields
----------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field.compact {
  gap: 3px;
}

.field > span {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.field .hint {
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fc-text-muted);
}

/* Inputs */
input[type="text"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-input);
  color: var(--fc-text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: background var(--fc-transition), border-color var(--fc-transition), box-shadow var(--fc-transition);
}

input::placeholder {
  color: var(--fc-text-placeholder);
}

input:hover,
select:hover {
  background: var(--fc-bg-input-hover);
}

select:hover {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236c7488' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

input:focus,
select:focus {
  border-color: var(--fc-accent);
  box-shadow: 0 0 0 2px var(--fc-accent-soft);
}

textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236c7488' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* Inline toggles */
.fc-inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fc-text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1.3;
}

/* Hide the actual checkbox */
.fc-inline-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Toggle track (the pill background) */
.fc-inline-toggle .fc-toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: var(--fc-radius-pill);
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-strong);
  flex-shrink: 0;
  transition: background var(--fc-transition), border-color var(--fc-transition);
}

/* Toggle thumb (the sliding circle) */
.fc-inline-toggle .fc-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fc-text-muted);
  transition: transform var(--fc-transition), background var(--fc-transition);
}

/* Checked state */
.fc-inline-toggle input[type="checkbox"]:checked + .fc-toggle-track {
  background: var(--fc-accent-blue);
  border-color: var(--fc-accent-blue);
}

.fc-inline-toggle input[type="checkbox"]:checked + .fc-toggle-track .fc-toggle-thumb {
  transform: translateX(14px);
  background: var(--fc-text-opaque);
}

/* Hover state */
.fc-inline-toggle:hover .fc-toggle-track {
  border-color: var(--fc-border-strong);
  background: var(--fc-elevation-02);
}

.fc-inline-toggle:hover input[type="checkbox"]:checked + .fc-toggle-track {
  background: var(--fc-accent-blue-dark);
  border-color: var(--fc-accent-blue-dark);
}

/* Focus state for accessibility */
.fc-inline-toggle input[type="checkbox"]:focus-visible + .fc-toggle-track {
  outline: 2px solid var(--fc-accent-blue);
  outline-offset: 2px;
}

/* Field row */
.fc-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

/* -----------------------------------------------------------------
   Color Schemes Panel
----------------------------------------------------------------- */
.fc-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--fc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.fc-section-divider {
  height: 1px;
  background: var(--fc-border-subtle);
  margin: 12px 0;
}

.fc-loading {
  font-size: 12px;
  color: var(--fc-text-muted);
  padding: 12px;
  text-align: center;
}

/* Target Object Panel - Shows which object receives new colors */
.fc-target-object-panel {
  background: var(--fc-accent-soft);
  border: 1px solid var(--fc-accent);
  border-radius: var(--fc-radius-md);
  padding: 12px;
  margin-bottom: 4px;
}

.fc-target-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.fc-target-header .fc-section-label {
  margin-bottom: 0;
  color: var(--fc-accent-strong);
}

.fc-target-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-accent);
  background: var(--fc-bg-input);
  color: var(--fc-text-primary);
  font-size: 13px;
  font-weight: 500;
}

.fc-target-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--fc-accent-soft);
}

.fc-target-preview {
  min-height: 40px;
}

.fc-target-empty {
  font-size: 12px;
  color: var(--fc-text-muted);
  font-style: italic;
}

.fc-target-current {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.fc-target-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.fc-target-swatches-label {
  font-size: 10px;
  color: var(--fc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  width: 100%;
  margin-bottom: 2px;
}

.fc-target-chip {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.fc-target-chip:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.fc-target-chip .remove-chip {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fc-accent-red);
  border: none;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fc-target-chip:hover .remove-chip {
  opacity: 1;
}

.fc-target-chip .edit-chip {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fc-accent);
  border: none;
  color: white;
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fc-target-chip:hover .edit-chip {
  opacity: 1;
}

.fc-target-chip.has-extras {
  border-color: var(--fc-accent);
}

.fc-target-chip.has-extras::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--fc-accent);
  border-radius: 50%;
}

.fc-target-add-hint {
  font-size: 11px;
  color: var(--fc-accent-strong);
  padding: 4px 0;
}

/* Recommended Schemes */
.fc-recommended-schemes {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.fc-recommended-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-recommended-item:hover {
  border-color: var(--fc-accent);
  background: var(--fc-bg-input-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fc-scheme-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fc-scheme-desc {
  font-size: 10px;
  color: var(--fc-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-scheme-preview-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fc-transition);
}

.fc-scheme-preview-btn:hover {
  border-color: var(--fc-accent);
  color: var(--fc-accent-strong);
  background: var(--fc-accent-soft);
}

.fc-scheme-apply-btn {
  padding: 5px 10px;
  border-radius: var(--fc-radius-sm);
  border: none;
  background: var(--fc-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-scheme-apply-btn:hover {
  background: var(--fc-accent-strong);
}

/* Scheme Categories */
.fc-scheme-category {
  margin-bottom: 12px;
}

.fc-scheme-category-title {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: var(--fc-accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  padding-left: 2px;
}

.fc-scheme-category-items {
  display: grid;
  gap: 4px;
}

/* Expand button */
.fc-scheme-expand-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: transparent;
  color: var(--fc-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fc-transition);
}

.fc-scheme-expand-btn:hover {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-primary);
}

.fc-scheme-expand-btn.is-expanded {
  background: var(--fc-accent-soft);
  color: var(--fc-accent-strong);
  border-color: var(--fc-accent);
}

.fc-scheme-expand-btn.is-expanded svg {
  transform: rotate(180deg);
}

/* Expanded Panel */
.fc-scheme-expanded {
  background: var(--fc-bg-surface-soft);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  margin: 4px 0 8px;
  padding: 8px;
  overflow: hidden;
}

.fc-scheme-expanded[hidden] {
  display: none;
}

.fc-scheme-expanded-colors {
  display: grid;
  gap: 6px;
}

.fc-expanded-swatch {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-expanded-swatch:hover {
  border-color: var(--fc-accent);
  background: var(--fc-bg-input-hover);
}

.fc-expanded-chip {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.fc-expanded-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.fc-expanded-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--fc-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-expanded-meta {
  font-size: 10px;
  color: var(--fc-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-expanded-hex {
  font-size: 10px;
  color: var(--fc-text-secondary);
  font-family: ui-monospace, monospace;
}

.fc-add-swatch-btn {
  padding: 4px 10px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-accent);
  background: transparent;
  color: var(--fc-accent-strong);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--fc-transition);
  opacity: 0;
  white-space: nowrap;
}

.fc-expanded-swatch:hover .fc-add-swatch-btn {
  opacity: 1;
}

.fc-add-swatch-btn:hover {
  background: var(--fc-accent);
  color: #fff;
}

.fc-add-swatch-btn:disabled {
  background: var(--fc-accent-green);
  border-color: var(--fc-accent-green);
  color: #fff;
  opacity: 1;
}

/* Expanded panel actions */
.fc-scheme-expanded-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--fc-border-subtle);
}

.fc-add-all-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-accent);
  background: var(--fc-accent-soft);
  color: var(--fc-accent-strong);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-add-all-btn:hover {
  background: var(--fc-accent);
  color: #fff;
}

.fc-add-all-btn:disabled {
  background: var(--fc-accent-green);
  border-color: var(--fc-accent-green);
  color: #fff;
}

/* Saved Schemes */
.fc-schemes-list {
  display: grid;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 8px;
}

.fc-schemes-empty {
  font-size: 11px;
  color: var(--fc-text-muted);
  padding: 10px;
  text-align: center;
  background: var(--fc-bg-input);
  border-radius: var(--fc-radius-sm);
  border: 1px dashed var(--fc-border-subtle);
}

.fc-scheme-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  cursor: default;
  transition: all var(--fc-transition);
}

.fc-scheme-item:hover {
  border-color: var(--fc-border-strong);
  background: var(--fc-bg-input-hover);
}

.fc-scheme-colors {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.fc-scheme-chip {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.fc-scheme-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fc-scheme-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fc-text-primary);
}

.fc-scheme-meta {
  font-size: 10px;
  color: var(--fc-text-muted);
}

.fc-scheme-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  opacity: 0;
  transition: opacity var(--fc-transition);
}

.fc-scheme-item:hover .fc-scheme-actions {
  opacity: 1;
}

.fc-scheme-apply {
  padding: 4px 10px;
  border-radius: var(--fc-radius-sm);
  border: none;
  background: var(--fc-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--fc-transition);
}

.fc-scheme-apply:hover {
  background: var(--fc-accent-strong);
}

.fc-scheme-delete {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--fc-transition);
}

.fc-scheme-delete:hover {
  background: var(--fc-accent-red);
  color: #fff;
}

/* Create scheme button */
.fc-create-scheme-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--fc-radius-sm);
  border: 1px dashed var(--fc-border-strong);
  background: transparent;
  color: var(--fc-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-create-scheme-btn:hover {
  border-color: var(--fc-accent);
  color: var(--fc-accent-strong);
  background: var(--fc-accent-soft);
}

/* -----------------------------------------------------------------
   Object list
----------------------------------------------------------------- */
.obj-list {
  display: grid;
  gap: 6px;
}

.obj-item {
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  padding: 8px;
  transition: border-color var(--fc-transition);
  overflow: hidden;
}

.obj-item:hover {
  border-color: var(--fc-border-strong);
}

.obj-item.is-selected {
  border-color: var(--fc-accent);
  background: var(--fc-accent-soft);
}

.obj-item .select-obj {
  padding: 4px 10px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-accent);
  background: transparent;
  color: var(--fc-accent-strong);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.obj-item .select-obj:hover {
  background: var(--fc-accent);
  color: #fff;
}

.obj-item.is-selected .select-obj {
  background: var(--fc-accent);
  color: #fff;
}

.obj-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}

.obj-item-top .obj-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.obj-item .id {
  font-size: 12px;
  font-weight: 600;
  color: var(--fc-text-primary);
  word-break: break-word;
}

.obj-item .sub {
  font-size: 10px;
  color: var(--fc-text-muted);
  word-break: break-word;
}

.obj-item .color-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
}

.obj-item .color-count {
  font-size: 10px;
  color: var(--fc-text-muted);
  white-space: nowrap;
}

.obj-item .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.obj-item .actions button {
  padding: 4px 8px;
  font-size: 10px;
  font-family: var(--fc-font-family);
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-elevation-01);
  color: var(--fc-text-secondary);
  cursor: pointer;
  transition: background var(--fc-transition), border-color var(--fc-transition);
  white-space: nowrap;
}

.obj-item .actions button:hover {
  background: var(--fc-elevation-02);
  border-color: var(--fc-border-strong);
}

.obj-item .actions .edit {
  background: var(--fc-accent);
  border-color: var(--fc-accent);
  color: #fff;
}

.obj-item .actions .edit:hover {
  background: var(--fc-accent-strong);
}

.obj-edit {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--fc-border-subtle);
  gap: 8px;
}

.obj-item.editing .obj-edit {
  display: grid;
}

/* Add object row */
.obj-new {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.obj-new input {
  flex: 1;
}

.obj-new button {
  padding: 0 14px;
  height: 36px;
  font-family: var(--fc-font-family);
  font-size: var(--fc-font-size-sm);
  border-radius: var(--fc-radius-sm);
  border: none;
  background: var(--fc-accent-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--fc-transition);
}

.obj-new button:hover {
  background: var(--fc-accent-blue-dark);
}

/* -----------------------------------------------------------------
   Scene Variables List
----------------------------------------------------------------- */
.fc-variables-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-variable-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
}

.fc-variable-item:hover {
  border-color: var(--fc-border-strong);
}

.fc-variable-name {
  flex: 1;
  font-size: 12px;
  color: var(--fc-text-primary);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc-variable-type {
  font-size: 10px;
  color: var(--fc-text-muted);
  padding: 2px 6px;
  background: var(--fc-elevation-01);
  border-radius: 4px;
  text-transform: uppercase;
}

.fc-variable-input {
  width: 100px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  color: var(--fc-text-primary);
}

.fc-variable-input:focus {
  border-color: var(--fc-accent);
  outline: none;
}

.fc-variable-toggle {
  position: relative;
  width: 36px;
  height: 20px;
}

.fc-variable-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.fc-variable-toggle .toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--fc-elevation-01);
  border-radius: 10px;
  transition: 0.2s;
}

.fc-variable-toggle .toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.fc-variable-toggle input:checked + .toggle-slider {
  background: var(--fc-accent);
}

.fc-variable-toggle input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

.fc-variable-export {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--fc-text-muted);
}

.fc-variable-export input[type="checkbox"] {
  width: 12px;
  height: 12px;
}

/* -----------------------------------------------------------------
   FilamentColors Search Block
----------------------------------------------------------------- */
.fc-search-block {
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface-soft);
}

.fc-search-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fc-search-input {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-strong);
  background: var(--fc-bg-surface);
  color: var(--fc-text-primary);
  font-size: 13px;
  outline: none;
}

.fc-search-input::placeholder {
  color: var(--fc-text-muted);
}

.fc-search-input:focus {
  border-color: var(--fc-accent);
  box-shadow: 0 0 0 2px var(--fc-accent-soft);
  background: var(--fc-bg-surface-soft);
}

.fc-results {
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.fc-result {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--fc-radius-sm);
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-result:hover {
  transform: translateY(-1px);
  border-color: var(--fc-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fc-swatch-chip {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 8px;
  border: 1px solid var(--fc-border-subtle);
}

.fc-result-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fc-result-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--fc-text-primary);
}

.fc-result-meta {
  font-size: 10px;
  color: var(--fc-text-muted);
}

.fc-result-hex {
  font-size: 10px;
  color: var(--fc-text-secondary);
  font-family: ui-monospace, monospace;
}

/* -----------------------------------------------------------------
   Selected Swatch Display
----------------------------------------------------------------- */
.fc-selected-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 10px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  margin-top: 8px;
}

.fc-selected {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.fc-selected-chip {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--fc-border-strong);
  flex-shrink: 0;
}

.fc-selected-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

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

.fc-selected-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.fc-selected-link {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--fc-radius-pill);
  border: 1px solid var(--fc-accent);
  background: var(--fc-accent-soft);
  color: var(--fc-accent-strong);
  text-decoration: none;
  transition: all var(--fc-transition);
}

.fc-selected-link:hover {
  background: var(--fc-accent);
  color: #fff;
}

.fc-selected-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.fc-color-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fc-text-muted);
}

.fc-color-input {
  width: 32px;
  height: 32px;
  padding: 2px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-strong);
  background: transparent;
  cursor: pointer;
}

/* -----------------------------------------------------------------
   Swatch Manager (Add/Delete/Reorder Colors)
----------------------------------------------------------------- */
.fc-swatches-manager {
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface-soft);
}

.fc-swatches-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.fc-add-color-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-accent);
  background: transparent;
  border: 1px solid var(--fc-accent);
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-add-color-btn:hover {
  background: var(--fc-accent);
  color: #fff;
}

.fc-swatches-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.fc-swatches-empty {
  padding: 16px;
  text-align: center;
  color: var(--fc-text-muted);
  font-size: 12px;
}

.fc-swatch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.fc-swatch-item:hover {
  border-color: var(--fc-border-strong);
  background: var(--fc-bg-surface);
}

.fc-swatch-item.active {
  border-color: var(--fc-accent);
  box-shadow: 0 0 0 2px var(--fc-accent-soft);
}

.fc-swatch-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.fc-swatch-item.drag-over {
  border-color: var(--fc-accent);
  border-style: dashed;
}

.fc-swatch-drag {
  color: var(--fc-text-muted);
  font-size: 12px;
  cursor: grab;
  padding: 2px 4px;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.fc-swatch-drag:hover {
  opacity: 1;
}

.fc-swatch-drag:active {
  cursor: grabbing;
}

.fc-swatch-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.fc-swatch-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fc-swatch-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-swatch-hex {
  font-size: 10px;
  color: var(--fc-text-muted);
  font-family: monospace;
}

.fc-swatch-delete {
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--fc-text-muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.15s;
  flex-shrink: 0;
}

.fc-swatch-delete:hover {
  opacity: 1;
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.fc-add-color-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--fc-border-subtle);
  align-items: center;
}

.fc-add-color-row input[type="color"] {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--fc-border-strong);
  border-radius: var(--fc-radius-sm);
  background: transparent;
  cursor: pointer;
}

.fc-add-color-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  background: var(--fc-bg-input);
  color: var(--fc-text-primary);
}

.fc-add-color-row input[type="text"]:focus {
  outline: none;
  border-color: var(--fc-accent);
}

.fc-add-color-confirm,
.fc-add-color-cancel {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.fc-add-color-confirm {
  background: var(--fc-accent);
  color: #fff;
}

.fc-add-color-confirm:hover {
  background: var(--fc-accent-hover);
}

.fc-add-color-cancel {
  background: var(--fc-bg-surface);
  color: var(--fc-text-secondary);
  border: 1px solid var(--fc-border-subtle);
}

.fc-add-color-cancel:hover {
  background: var(--fc-bg-surface-hover);
}

/* -----------------------------------------------------------------
   Linked Objects Section
----------------------------------------------------------------- */
.linked-objects-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--fc-border-subtle);
}

.edit-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.linked-list {
  display: grid;
  gap: 4px;
}

.linked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: var(--fc-bg-surface-soft);
  border-radius: var(--fc-radius-sm);
  font-size: 12px;
  color: var(--fc-text-primary);
}

.linked-remove {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--fc-accent-red);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.linked-empty {
  font-size: 11px;
  color: var(--fc-text-muted);
  font-style: italic;
}

.linked-add-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.linked-add-row input {
  flex: 1;
  height: 32px;
}

.linked-add-btn {
  padding: 0 12px;
  height: 32px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-secondary);
  font-size: 12px;
  cursor: pointer;
}

/* Linked objects autocomplete dropdown */
.linked-autocomplete {
  position: fixed;
  z-index: 10001;
  background: #1a1d24;
  border: 1px solid #3a3f4a;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-height: 240px;
  overflow-y: auto;
  display: none;
}

.linked-autocomplete-item {
  padding: 10px 12px;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linked-autocomplete-item:hover {
  background: rgba(59, 130, 246, 0.2);
}

.linked-autocomplete-item:first-child {
  border-radius: 7px 7px 0 0;
}

.linked-autocomplete-item:last-child {
  border-radius: 0 0 7px 7px;
}

.linked-autocomplete-item:only-child {
  border-radius: 7px;
}

/* -----------------------------------------------------------------
   Output blocks
----------------------------------------------------------------- */
.out-block {
  margin-bottom: 10px;
}

.out-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-text-muted);
  text-transform: uppercase;
}

.out-head button {
  padding: 4px 10px;
  font-size: var(--fc-font-size-xs);
  font-family: var(--fc-font-family);
  border-radius: var(--fc-radius-sm);
  border: none;
  background: var(--fc-accent-blue);
  color: #fff;
  cursor: pointer;
  transition: background var(--fc-transition);
}

.out-head button:hover {
  background: var(--fc-accent-blue-dark);
}

/* -----------------------------------------------------------------
   Export Tabs
----------------------------------------------------------------- */
.fc-export-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  background: var(--fc-bg-input);
  border-radius: var(--fc-radius-sm);
}

.fc-export-tab {
  flex: 1;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fc-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-export-tab:hover {
  color: var(--fc-text-secondary);
}

.fc-export-tab.active {
  background: var(--fc-bg-surface);
  color: var(--fc-text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fc-export-panel {
  display: none;
}

.fc-export-panel.active {
  display: block;
}

/* -----------------------------------------------------------------
   Footer actions
----------------------------------------------------------------- */
.fc-footer-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--fc-border-subtle);
}

.fc-btn-ghost {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: transparent;
  color: var(--fc-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--fc-transition), color var(--fc-transition), border-color var(--fc-transition);
}

.fc-btn-ghost:hover {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-primary);
  border-color: var(--fc-border-strong);
}

/* Danger/Reset button variant */
.fc-btn-ghost.fc-btn-danger,
#fc_reset {
  color: var(--fc-accent-red);
  border-color: rgba(253, 91, 93, 0.3);
}

#fc_reset:hover {
  background: rgba(253, 91, 93, 0.1);
  color: var(--fc-accent-red);
  border-color: var(--fc-accent-red);
}

#fc_reset:active {
  background: rgba(253, 91, 93, 0.15);
  transform: scale(0.98);
}

/* -----------------------------------------------------------------
   Sidebar Attribution Footer
----------------------------------------------------------------- */
.fc-sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--fc-border-subtle);
  overflow: hidden;
}

.fc-footer-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  text-align: center;
  margin-top: 8px;
  margin-bottom: 8px;
}

.fc-footer-link {
  font-size: 11px;
  color: var(--fc-text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--fc-bg);
  border: 1px solid var(--fc-border);
  transition: all 0.15s ease;
}

.fc-footer-link:hover {
  color: var(--fc-accent);
  border-color: var(--fc-accent);
  background: rgba(99, 102, 241, 0.1);
}

.fc-attribution {
  font-size: 11px;
  color: var(--fc-text-muted);
  text-align: center;
  margin-bottom: 12px;
}

.fc-attribution a {
  color: var(--fc-accent);
  text-decoration: none;
  font-weight: 500;
}

.fc-attribution a:hover {
  text-decoration: underline;
}

.fc-powered-by {
  text-align: center;
}

.fc-powered-by > span {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fc-text-muted);
  margin-bottom: 10px;
}

.fc-powered-logos {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  flex-wrap: wrap;
}

.fc-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s ease;
  max-width: 100%;
  overflow: hidden;
}

.fc-logo-link:hover {
  background: var(--fc-bg-input-hover);
  transform: translateY(-1px);
}

.fc-logo-link img {
  display: block;
  height: 48px !important;
  max-height: 48px !important;
  width: auto !important;
  max-width: 160px !important;
  object-fit: contain;
}

/* Light mode attribution fixes */
.fc-compiler.v3[data-theme="light"] .fc-attribution {
  color: #4b5563;
}

.fc-compiler.v3[data-theme="light"] .fc-attribution a {
  color: #6366f1;
}

.fc-compiler.v3[data-theme="light"] .fc-powered-by > span {
  color: #6b7280;
}

.fc-compiler.v3[data-theme="light"] .fc-logo-link {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.fc-compiler.v3[data-theme="light"] .fc-logo-link:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

/* Dark/Light mode logo switching */
.fc-logo-dark,
.fc-logo-light {
  display: none !important;
}

/* Dark mode: show light-on-dark logos */
.fc-compiler.v3[data-theme="dark"] .fc-logo-dark {
  display: block !important;
}

/* Light mode: show dark-on-light logos */
.fc-compiler.v3[data-theme="light"] .fc-logo-light {
  display: block !important;
}

/* Fallback if no theme set - assume dark */
.fc-compiler.v3:not([data-theme]) .fc-logo-dark {
  display: block !important;
}

/* -----------------------------------------------------------------
   Main Preview Area
----------------------------------------------------------------- */
.fc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 32px;
  transition: padding-left var(--fc-transition);
}

.fc-compiler.v3[data-sidebar="closed"] .fc-main {
  padding-left: 56px;
  padding-right: 16px;
  width: 100%;
  max-width: 100%;
}

/* Full-width preview when sidebar is closed */
.fc-compiler.v3[data-sidebar="closed"] .fc-resizable-preview {
  max-width: calc(100vw - 72px);
  margin-left: 0;
  margin-right: auto;
}

.fc-compiler.v3[data-sidebar="closed"] .spc_box {
  max-width: 100%;
  width: 100%;
}

.fc-compiler.v3[data-sidebar="closed"] .fc-preview-wrap {
  max-width: 100%;
  width: 100%;
}

.fc-compiler.v3[data-sidebar="closed"] .fc-floating-swatches {
  max-width: calc(100vw - 100px);
}

/* -----------------------------------------------------------------
   Preview Toolbar
----------------------------------------------------------------- */
.fc-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--fc-bg-surface);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-md);
  margin-bottom: 12px;
  gap: 12px;
  flex-shrink: 0;
}

.fc-device-presets {
  display: flex;
  gap: 4px;
}

.fc-device-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--fc-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-device-btn:hover {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-secondary);
}

.fc-device-btn.active {
  background: var(--fc-accent-soft);
  color: var(--fc-accent-strong);
  border-color: var(--fc-accent);
}

.fc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-width-display {
  padding: 4px 10px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: var(--fc-text-secondary);
  width: 60px;
  text-align: center;
  outline: none;
  transition: border-color var(--fc-transition);
}

.fc-width-display:focus {
  border-color: var(--fc-accent);
}

.fc-width-display::after {
  content: 'px';
}

/* Export button */
.fc-export-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--fc-radius-sm);
  border: none;
  background: var(--fc-accent-blue);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-export-btn:hover {
  background: var(--fc-accent-blue-dark);
  transform: translateY(-1px);
}

.fc-export-btn svg {
  flex-shrink: 0;
}

/* Share button */
.fc-share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-accent);
  background: var(--fc-accent-soft);
  color: var(--fc-accent-strong);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-share-btn:hover {
  background: var(--fc-accent);
  color: #fff;
}

.fc-share-btn:active {
  transform: scale(0.97);
}

/* -----------------------------------------------------------------
   Resizable Preview Container
----------------------------------------------------------------- */
.fc-resizable-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 300px;
  max-width: 100%;
  margin: 0 auto;
  transition: width 0.15s ease;
  overflow: visible;
}

/* Disable transitions during resize for smooth dragging */
.fc-resizable-preview.is-resizing {
  transition: none !important;
  contain: layout style;
  will-change: width;
}

.fc-resizable-preview.is-resizing * {
  transition: none !important;
}

/* Optimize canvas during resize to prevent repaints */
.fc-resizable-preview.is-resizing .spc_box {
  contain: strict;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.fc-resizable-preview.is-resizing canvas {
  pointer-events: none;
}

/* Smooth canvas fade back after resize ends */
.fc-resizable-preview:not(.is-resizing) canvas {
  transition: opacity 0.15s ease;
}

/* Prevent swatch panel reflow during resize */
.fc-resizable-preview.is-resizing .fc-floating-swatches {
  contain: layout style;
  transform: translateZ(0);
}

.fc-resizable-preview .fc-preview-wrap {
  flex: 1;
  position: relative;
  display: flex;
  min-height: 300px;
}

/* Resize handle (right side only) */
.fc-resize-handle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  cursor: grab;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fc-bg-surface);
  border: 1px solid var(--fc-border-strong);
  border-radius: 6px;
  color: var(--fc-text-muted);
  transition: all 0.15s ease;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fc-resize-handle:hover {
  background: var(--fc-bg-surface-soft);
  border-color: var(--fc-accent);
  color: var(--fc-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: grab;
}

.fc-resize-handle:active,
.fc-resize-handle.is-dragging {
  background: var(--fc-accent);
  border-color: var(--fc-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
  cursor: grabbing;
}

.fc-resize-handle svg {
  width: 8px;
  height: 16px;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.fc-resize-handle:hover svg,
.fc-resize-handle.is-dragging svg {
  opacity: 1;
}

.fc-resize-right {
  right: -12px;
}

/* Ensure parent doesn't clip handles */
.fc-resizable-preview {
  overflow: visible !important;
}

/* Scene box */
.spc_box {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 300px;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  border-radius: var(--fc-radius-lg);
  overflow: hidden;
  background: #05060b;
  border: 1px solid var(--fc-border-subtle);
  box-shadow: var(--fc-shadow-lg);
}

#fc_canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 300px;
  min-height: 200px;
  display: block;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  place-content: center;
  gap: 12px;
  text-align: center;
  color: var(--fc-text-muted);
  font-size: 14px;
}

.preview-empty-icon {
  opacity: 0.4;
}

/* -----------------------------------------------------------------
   Floating Swatches - Compact Edition
----------------------------------------------------------------- */
.fc-floating-swatches {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overflow-x: hidden;
  /* Panel styling via CSS vars (set by JS) - using fallbacks */
  background: var(--spc-panel-bg, var(--fc-bg-overlay));
  backdrop-filter: blur(var(--spc-panel-blur, 16px));
  -webkit-backdrop-filter: blur(var(--spc-panel-blur, 16px));
  border-color: var(--spc-panel-border, var(--fc-border-subtle));
  border-style: solid;
  border-width: var(--spc-panel-border-width, 1px);
  border-radius: var(--spc-panel-radius, 12px);
  padding: var(--spc-panel-padding, 8px);
  padding-top: calc(var(--spc-panel-padding, 8px) + 24px); /* Space for toggle button */
  box-shadow: var(--spc-panel-shadow, var(--fc-shadow-float));
  max-height: calc(100% - 32px);
  overflow: visible; /* Allow toggle to show outside */
}

.fc-floating-swatches .spc_groups {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Grab handle on group headers in floating panels */
.fc-floating-swatches .spc_group > .spc_label {
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-floating-swatches .spc_group > .spc_label::before {
  content: '';
  display: inline-block;
  width: 0px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='6' cy='2' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='2' cy='7' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='6' cy='7' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='2' cy='12' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='6' cy='12' r='1.5' fill='%236b7280'/%3E%3C/svg%3E") no-repeat center;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.15s ease;
  flex-shrink: 0;
  overflow: hidden;
}

.fc-floating-swatches .spc_group:hover > .spc_label::before {
  width: 10px;
  opacity: 0.5;
}

.fc-floating-swatches .spc_group > .spc_label:hover::before {
  width: 10px;
  opacity: 0.8;
}

.fc-floating-swatches .spc_group > .spc_label:active {
  cursor: grabbing;
}

/* Light panel background - invert handle to dark */
.fc-floating-swatches[data-panel-theme="light"] .spc_group > .spc_label::before {
  filter: invert(1) brightness(0.3);
}

.fc-floating-swatches:empty,
.fc-floating-swatches:has(.spc_groups:empty) {
  display: none;
}

/* Compact scrollbar */
.fc-floating-swatches .spc_groups::-webkit-scrollbar {
  width: 4px;
}
.fc-floating-swatches .spc_groups::-webkit-scrollbar-track {
  background: transparent;
}
.fc-floating-swatches .spc_groups::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

/* Swatch Visibility Toggle Button - Prominent */
.fc-floating-swatches .spc_toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface);
  color: var(--fc-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all var(--fc-transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-size: 14px;
}

.fc-floating-swatches .spc_toggle:hover {
  background: var(--fc-accent);
  color: #fff;
  border-color: var(--fc-accent);
}

.fc-floating-swatches .spc_toggle .spc_icon_show {
  display: none;
}

.fc-floating-swatches .spc_toggle .spc_icon_hide {
  display: block;
}

/* Collapsed state */
.fc-floating-swatches.is-collapsed {
  padding: 8px 12px;
  min-width: auto;
  max-width: none;
  transform: none;
  left: auto;
  right: 24px;
  bottom: 24px;
}

.fc-floating-swatches.is-collapsed .spc_groups {
  display: none;
}

.fc-floating-swatches.is-collapsed .spc_toggle {
  position: static;
  top: auto;
  right: auto;
}

.fc-floating-swatches.is-collapsed .spc_toggle .spc_icon_show {
  display: block;
}

.fc-floating-swatches.is-collapsed .spc_toggle .spc_icon_hide {
  display: none;
}

/* Hidden variant for groups (used by JS) */
.spc_groups.is-hidden {
  display: none !important;
}

/* Collapsed inline swatches - scene takes full width */
.fc-floating-swatches.is-collapsed[data-position="inline-left"],
.fc-floating-swatches.is-collapsed[data-position="inline-right"] {
  position: absolute;
  width: auto;
  min-width: auto;
  max-width: none;
  margin: 0;
  top: 16px;
  right: 16px;
  bottom: auto;
  left: auto;
}

/* When inline swatches collapse, preview wrap goes back to column layout */
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches.is-collapsed[data-position="inline-left"]),
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches.is-collapsed[data-position="inline-right"]) {
  flex-direction: column !important;
}

/* Scene expands when inline swatches are collapsed */
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches.is-collapsed) .spc_box {
  flex: 1;
  max-width: 100%;
  width: 100%;
}

/* -----------------------------------------------------------------
   Swatch Position Variants
----------------------------------------------------------------- */

/* Bottom positions (default is bottom-center) */
.fc-floating-swatches[data-position="bottom-center"] {
  bottom: 24px;
  left: 50%;
  right: auto;
  top: auto;
  transform: translateX(-50%);
}

.fc-floating-swatches[data-position="bottom-left"] {
  bottom: 24px;
  left: 24px;
  right: auto;
  top: auto;
  transform: none;
}

.fc-floating-swatches[data-position="bottom-right"] {
  bottom: 24px;
  right: 24px;
  left: auto;
  top: auto;
  transform: none;
}

/* Top positions */
.fc-floating-swatches[data-position="top-center"] {
  top: 24px;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translateX(-50%);
}

.fc-floating-swatches[data-position="top-left"] {
  top: 24px;
  left: 24px;
  right: auto;
  bottom: auto;
  transform: none;
}

.fc-floating-swatches[data-position="top-right"] {
  top: 24px;
  right: 24px;
  left: auto;
  bottom: auto;
  transform: none;
}

/* Side positions */
.fc-floating-swatches[data-position="left"] {
  top: 50%;
  left: 24px;
  right: auto;
  bottom: auto;
  transform: translateY(-50%);
}

.fc-floating-swatches[data-position="right"] {
  top: 50%;
  right: 24px;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
}

/* Inline positions (outside the scene box - stacked) */
.fc-floating-swatches[data-position="above"],
.fc-floating-swatches[data-position="below"] {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  max-width: 100%;
  width: 100%;
  margin: 0;
}

.fc-floating-swatches[data-position="above"] {
  order: -1;
  margin-bottom: 12px;
}

.fc-floating-swatches[data-position="below"] {
  order: 1;
  margin-top: 12px;
}

/* Inline positions (beside the scene - side by side) */
.fc-floating-swatches[data-position="inline-left"],
.fc-floating-swatches[data-position="inline-right"] {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  width: 220px;
  min-width: 180px;
  max-width: 280px;
  max-height: 100%;
  overflow-y: auto;
  flex-shrink: 0;
  margin: 0;
  align-self: stretch;
}

.fc-floating-swatches[data-position="inline-left"] {
  order: -1;
  margin-right: 12px;
  border-radius: 12px 0 0 12px;
}

.fc-floating-swatches[data-position="inline-right"] {
  order: 2;
  margin-left: 12px;
  border-radius: 0 12px 12px 0;
}

/* Preview container becomes flex when inline positions used */
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches[data-position="inline-left"]),
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches[data-position="inline-right"]) {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch;
}

/* Preview container column layout for stacked (above/below) positions */
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches[data-position="above"]),
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches[data-position="below"]) {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch;
}

.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches[data-position="inline-left"]) .spc_box,
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches[data-position="inline-right"]) .spc_box {
  flex: 1;
  min-width: 0;
  order: 0;
}

/* Left of scene: swatches order -1 (before scene which is order 0) */
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches[data-position="inline-left"]) .fc-floating-swatches {
  order: -1;
}

/* Right of scene: scene order 0, swatches order 2 (after scene) */
.fc-resizable-preview .fc-preview-wrap:has(.fc-floating-swatches[data-position="inline-right"]) .fc-floating-swatches {
  order: 2;
}

/* Inline swatches: stack content vertically */
.fc-floating-swatches[data-position="inline-left"] .spc_groups,
.fc-floating-swatches[data-position="inline-right"] .spc_groups {
  flex-direction: column;
  gap: 12px;
}

.fc-floating-swatches[data-position="inline-left"] .spc_group,
.fc-floating-swatches[data-position="inline-right"] .spc_group {
  width: 100%;
}

.fc-floating-swatches[data-position="inline-left"] .spc_swatches,
.fc-floating-swatches[data-position="inline-right"] .spc_swatches {
  flex-wrap: wrap;
  justify-content: flex-start;
}

/* -----------------------------------------------------------------
   Overlay Positions (inside scene, on edge)
----------------------------------------------------------------- */

/* Overlay positions - absolute inside scene container */
.fc-floating-swatches[data-position="overlay-left"],
.fc-floating-swatches[data-position="overlay-right"],
.fc-floating-swatches[data-position="overlay-top"],
.fc-floating-swatches[data-position="overlay-bottom"] {
  position: absolute;
  z-index: 50;
  background: var(--fc-bg-overlay);
  backdrop-filter: blur(var(--spc-panel-blur, 16px));
  -webkit-backdrop-filter: blur(var(--spc-panel-blur, 16px));
}

/* Overlay Left - Full height strip on left edge */
.fc-floating-swatches[data-position="overlay-left"] {
  top: 0;
  left: 0;
  bottom: 0;
  right: auto;
  width: 200px;
  max-width: 30%;
  transform: none;
  border-radius: 0 12px 12px 0;
  overflow-y: auto;
}

/* Overlay Right - Full height strip on right edge */
.fc-floating-swatches[data-position="overlay-right"] {
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: 200px;
  max-width: 30%;
  transform: none;
  border-radius: 12px 0 0 12px;
  overflow-y: auto;
}

/* Overlay Top - Full width strip on top edge */
.fc-floating-swatches[data-position="overlay-top"] {
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  max-width: 100%;
  max-height: 40%;
  transform: none;
  border-radius: 0 0 12px 12px;
  overflow-x: auto;
}

/* Overlay Bottom - Full width strip on bottom edge */
.fc-floating-swatches[data-position="overlay-bottom"] {
  bottom: 0;
  left: 0;
  right: 0;
  top: auto;
  width: 100%;
  max-width: 100%;
  max-height: 40%;
  transform: none;
  border-radius: 12px 12px 0 0;
  overflow-x: auto;
}

/* Overlay left/right: stack swatches vertically */
.fc-floating-swatches[data-position="overlay-left"] .spc_groups,
.fc-floating-swatches[data-position="overlay-right"] .spc_groups {
  flex-direction: column;
  gap: 10px;
}

/* Overlay top/bottom: horizontal scroll */
.fc-floating-swatches[data-position="overlay-top"] .spc_groups,
.fc-floating-swatches[data-position="overlay-bottom"] .spc_groups {
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fc-floating-swatches[data-position="overlay-top"] .spc_group,
.fc-floating-swatches[data-position="overlay-bottom"] .spc_group {
  flex-shrink: 0;
  min-width: 150px;
}

/* Collapsed overlay swatches */
.fc-floating-swatches.is-collapsed[data-position="overlay-left"],
.fc-floating-swatches.is-collapsed[data-position="overlay-right"],
.fc-floating-swatches.is-collapsed[data-position="overlay-top"],
.fc-floating-swatches.is-collapsed[data-position="overlay-bottom"] {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  top: 16px;
  right: 16px;
  left: auto;
  bottom: auto;
  border-radius: 50%;
}

/* -----------------------------------------------------------------
   Swatch Info Panel & Search (Preview)
----------------------------------------------------------------- */

/* Search input per object - Compact */
.spc_search {
  position: relative;
  margin-bottom: 6px;
}

.spc_search_input {
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--fc-border-strong);
  background: var(--fc-bg-surface);
  font-size: 16px; /* Prevents iOS zoom on focus */
  color: var(--fc-text-primary);
  font-size: 11px;
  outline: none;
}

.spc_search_input:focus {
  border-color: var(--fc-accent);
  box-shadow: 0 0 0 2px var(--fc-accent-soft);
  background: var(--fc-bg-surface-soft);
}

.spc_search_input::placeholder {
  color: var(--fc-text-muted);
  opacity: 0.7;
}

.spc_search_results {
  position: fixed;
  z-index: 10001;
  /* Explicit colors since this element gets moved to body (outside themed container) */
  background: #1a1d24;
  border: 1px solid #3a3f4a;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  color: #fff;
}

.spc_search_result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  color: #fff;
}

.spc_search_result:hover {
  background: rgba(255, 255, 255, 0.1);
}

.spc_result_chip {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.spc_result_name {
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-text-primary);
  flex: 1;
}

.spc_result_brand {
  font-size: 10px;
  color: var(--fc-text-muted);
}

.spc_no_results {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--fc-text-muted);
}

/* Info panel showing selected swatch details - Compact */
.spc_info {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--fc-bg-surface-soft);
  border: 1px solid var(--fc-border-subtle);
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.spc_info_label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-text-primary);
}

.spc_info_brand {
  font-size: 10px;
  color: var(--fc-text-muted);
}

.spc_info_links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}

.spc_link_amazon,
.spc_link_mfr {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.spc_link_amazon {
  background: #FF9900;
  color: #000;
}

.spc_link_amazon:hover {
  background: #FFB84D;
}

.spc_link_mfr {
  background: var(--fc-accent-soft);
  color: var(--fc-accent-strong);
  border: 1px solid var(--fc-accent);
}

.spc_link_mfr:hover {
  background: var(--fc-accent);
  color: #fff;
  transform: translateY(-1px);
}

/* Empty state for links */
.spc_info_links:empty {
  display: none;
}

/* Custom color picker swatch */
.spc_swatch.spc_custom {
  position: relative;
}

.spc_swatch.spc_custom > span.custom-span {
  background: conic-gradient(from 90deg, #ff5a6a, #f59e0b, #22c55e, #06b6d4, #4f46e5, #a855f7, #ff5a6a);
  border-style: dashed;
  border-color: rgba(255,255,255,0.3);
}

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

/* Swatch groups styling - Compact */
.spc_groups {
  display: flex;
  flex-direction: column; /* Groups always stack vertically */
  gap: 16px;
  --spc-size: 36px;
  --spc-radius: 8px;
  --spc-gap: 5px;
  width: 100%;
}

/* Ensure all groups are visible regardless of style */
.spc_group,
fieldset.spc_group {
  display: block !important;
  width: 100%;
  flex-shrink: 0;
  padding: 2px !important;
  margin: 0 !important;
  border: none !important;
}

/* Group labels / headers - use CSS vars set by JS */
.spc_group > .spc_label {
  display: block;
  margin-bottom: 8px;
  font-size: var(--spc-header-size, 14px);
  color: var(--spc-header-color, var(--fc-text-secondary));
  background: var(--spc-header-bg, transparent);
  padding: 4px 0;
}

/* Hide group headers when data attribute says so */
.spc_groups[data-header-show="false"] .spc_group > .spc_label {
  display: none;
}

/* Individual swatch labels (NOT group headers) - use CSS variables set by JS */
.spc_swatches .spc_label,
.spc_swatch .spc_label,
.spc_name,
.spc_groups .spc_name,
.spc_swatches .spc_name {
  font-size: var(--spc-label-size, 11px) !important;
  font-weight: 500;
  color: var(--spc-label-color, var(--fc-text-muted)) !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Group header labels (object names) - highest specificity for customization */
.spc_groups .spc_group > .spc_label,
.spc_group > .spc_label {
  font-size: var(--spc-header-size, 14px) !important;
  color: var(--spc-header-color, #ffffff) !important;
  background: var(--spc-header-bg, transparent) !important;
  padding: 4px 0;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

/* Hide swatch labels when data attribute says so */
.spc_groups[data-label-show="false"] .spc_name,
.spc_groups[data-label-show="false"] .spc_swatch .spc_name {
  display: none !important;
}

.spc_swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spc-gap);
  padding: 4px;
}

.spc_swatch {
  position: relative;
  display: block;
  border-radius: var(--spc-radius);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.spc_swatch:hover {
  transform: translateY(-2px);
}

.spc_swatch > input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.spc_swatch > span {
  display: block;
  width: var(--spc-size);
  height: var(--spc-size);
  border-radius: var(--spc-radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.spc_swatch > input:checked + span {
  border-color: var(--fc-swatch-active-ring);
  box-shadow: 0 0 0 var(--spc-ring-width, 3px) var(--fc-swatch-active-ring), 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Allow tooltips to overflow - prevent clipping */
.spc_swatches {
  overflow: visible !important;
}

.spc_group {
  overflow: visible !important;
}

/* ============================================
   Variable Groups in Preview Panel
   ============================================ */
.spc_variable_group {
  display: block !important;
  width: 100%;
  flex-shrink: 0;
  padding: 8px !important;
  margin: 0 !important;
  border: none !important;
}

.spc_variable_group > .spc_label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.spc_variable_group .spc_var_name {
  flex: 1;
  font-size: var(--spc-header-size, 14px);
  font-weight: 500;
  color: var(--spc-header-color, rgba(255, 255, 255, 0.8));
}

.spc_variable_group .spc_var_type {
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  text-transform: uppercase;
  color: var(--spc-header-color, rgba(255, 255, 255, 0.6));
  font-weight: 500;
}

.spc_var_input_wrap {
  width: 100%;
}

.spc_var_input_wrap .spc_var_input {
  width: 100%;
  min-height: 16px;
  padding: 10px 12px;
  font-size: 16px; /* Prevents iOS zoom on focus */
  font-family: inherit;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: inherit;
  box-sizing: border-box;
}

.spc_var_input_wrap .spc_var_input:focus {
  border-color: var(--spc-ring, #5046e5);
  outline: none;
}

.spc_var_input_wrap .spc_var_input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Boolean toggle switch */
.spc_var_input_wrap .spc_var_toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.spc_var_input_wrap .spc_var_toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.spc_var_input_wrap .spc_toggle_slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  transition: background 0.2s ease;
}

.spc_var_input_wrap .spc_toggle_slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.spc_var_input_wrap .spc_var_toggle input:checked + .spc_toggle_slider {
  background: var(--spc-ring, #5046e5);
}

.spc_var_input_wrap .spc_var_toggle input:checked + .spc_toggle_slider:before {
  transform: translateX(20px);
}

/* Light panel theme adjustments */
.fc-floating-swatches[data-panel-theme="light"] .spc_var_input,
.fc-editor-preview[data-panel-theme="light"] .spc_var_input {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  color: #333;
}

.fc-floating-swatches[data-panel-theme="light"] .spc_var_input::placeholder,
.fc-editor-preview[data-panel-theme="light"] .spc_var_input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.fc-floating-swatches[data-panel-theme="light"] .spc_toggle_slider,
.fc-editor-preview[data-panel-theme="light"] .spc_toggle_slider {
  background: rgba(0, 0, 0, 0.15);
}

/* Variable Select Dropdown */
.spc_var_select {
  width: 100%;
  min-height: 16px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.spc_var_select:focus {
  border-color: var(--spc-ring, #5046e5);
  outline: none;
}

/* Variable Radio Group */
.spc_var_radio_group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spc_var_radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.spc_var_radio:hover {
  background: rgba(0, 0, 0, 0.25);
}

.spc_var_radio input {
  margin: 0;
  width: 16px;
  height: 16px;
}

.spc_var_radio span {
  font-size: 13px;
  color: var(--spc-label-color, rgba(255, 255, 255, 0.8));
}

/* Variable Options (Pills & Buttons) */
.spc_var_options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spc_var_option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.spc_var_option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.spc_var_option span {
  font-size: 13px;
  color: var(--spc-label-color, rgba(255, 255, 255, 0.8));
}

/* Pills display type */
.spc_var_pills .spc_var_option {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
}

.spc_var_pills .spc_var_option:hover {
  background: rgba(255, 255, 255, 0.15);
}

.spc_var_pills .spc_var_option.is-selected {
  background: var(--spc-ring, #5046e5);
  border-color: var(--spc-ring, #5046e5);
}

.spc_var_pills .spc_var_option.is-selected span {
  color: #fff;
}

/* Buttons display type */
.spc_var_buttons {
  gap: 0;
}

.spc_var_buttons .spc_var_option {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-left: -1px;
}

.spc_var_buttons .spc_var_option:first-child {
  margin-left: 0;
  border-radius: 6px 0 0 6px;
}

.spc_var_buttons .spc_var_option:last-child {
  border-radius: 0 6px 6px 0;
}

.spc_var_buttons .spc_var_option:hover {
  background: rgba(255, 255, 255, 0.15);
  z-index: 1;
}

.spc_var_buttons .spc_var_option.is-selected {
  background: var(--spc-ring, #5046e5);
  border-color: var(--spc-ring, #5046e5);
  z-index: 2;
}

.spc_var_buttons .spc_var_option.is-selected span {
  color: #fff;
}

/* ============================================
   Sidebar Variable List
   ============================================ */
.fc-var-item {
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.fc-var-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.fc-var-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-text-primary);
}

.fc-var-type-badge {
  font-size: 9px;
  padding: 2px 6px;
  background: var(--fc-accent);
  color: #fff;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 500;
}

.fc-var-config {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--fc-text-muted);
  margin-bottom: 8px;
}

.fc-var-input-type {
  color: var(--fc-text-secondary);
}

.fc-var-options-count {
  color: var(--fc-accent-strong);
}

.fc-var-actions {
  display: flex;
  gap: 6px;
}

.fc-var-actions button {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-elevation-01);
  color: var(--fc-text-secondary);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-var-actions button:hover {
  background: var(--fc-elevation-02);
  border-color: var(--fc-border-strong);
}

.fc-var-edit {
  background: var(--fc-accent) !important;
  border-color: var(--fc-accent) !important;
  color: #fff !important;
}

.fc-var-remove:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

/* ============================================
   Drag & Drop Reordering (Editor Only)
   ============================================ */

/* Drag handle for groups - integrated into header */
.spc_group-drag-handle {
  display: none; /* Hidden in exports, shown in editor */
}

/* Editor-only: Make group headers draggable with grip icon */
.fc-editor-preview .spc_group > .spc_label {
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-editor-preview .spc_group > .spc_label::before {
  content: '';
  display: inline-block;
  width: 0px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg width='8' height='14' viewBox='0 0 8 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='6' cy='2' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='2' cy='7' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='6' cy='7' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='2' cy='12' r='1.5' fill='%236b7280'/%3E%3Ccircle cx='6' cy='12' r='1.5' fill='%236b7280'/%3E%3C/svg%3E") no-repeat center;
  opacity: 0;
  transition: width 0.15s ease, opacity 0.15s ease;
  flex-shrink: 0;
  overflow: hidden;
}

.fc-editor-preview .spc_group:hover > .spc_label::before {
  width: 10px;
  opacity: 0.5;
}

.fc-editor-preview .spc_group > .spc_label:hover::before {
  width: 10px;
  opacity: 0.8;
}

.fc-editor-preview .spc_group > .spc_label:active {
  cursor: grabbing;
}

/* Light panel background - invert handle to dark (editor preview) */
.fc-editor-preview[data-panel-theme="light"] .spc_group > .spc_label::before {
  filter: invert(1) brightness(0.3);
}

/* Drag handle for individual swatches */
.spc_swatch-drag-handle {
  display: none; /* Hidden by default */
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 10px;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%236b7280'/%3E%3Ccircle cx='6' cy='2' r='1' fill='%236b7280'/%3E%3Ccircle cx='2' cy='6' r='1' fill='%236b7280'/%3E%3Ccircle cx='6' cy='6' r='1' fill='%236b7280'/%3E%3C/svg%3E") no-repeat center;
  z-index: 10;
}

/* Show handles in editor preview on hover */
.fc-editor-preview .spc_group {
  position: relative;
}

/* Swatch drag handles show on hover */
.fc-editor-preview .spc_swatch:hover .spc_swatch-drag-handle {
  display: block;
  opacity: 0.6;
}

.fc-editor-preview .spc_swatch-drag-handle:hover {
  opacity: 1;
}

/* Dragging state */
.spc_group.is-dragging,
.spc_swatch.is-dragging {
  opacity: 0.5;
  cursor: grabbing !important;
}

.spc_group-drag-handle:active,
.spc_swatch-drag-handle:active {
  cursor: grabbing;
}

/* Drop zone indicator */
.spc_group.drag-over,
.spc_swatch.drag-over {
  outline: 2px dashed var(--fc-accent, #5046e5);
  outline-offset: 2px;
}

.spc_drop-indicator {
  height: 3px;
  background: var(--fc-accent, #5046e5);
  border-radius: 2px;
  margin: 4px 0;
  animation: dropIndicatorPulse 0.8s ease infinite;
}

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

/* Tooltip - uses customizable label colors */
.spc_swatch::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: var(--spc-tooltip-size, 11px);
  font-weight: 500;
  background: var(--spc-tooltip-bg, rgba(15, 23, 42, 0.98));
  color: var(--spc-tooltip-color, var(--spc-label-color, #ffffff));
  border: 1px solid var(--spc-tooltip-border, rgba(255, 255, 255, 0.15));
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Tooltip arrow */
.spc_swatch::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--spc-tooltip-bg, rgba(15, 23, 42, 0.98));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 9999;
}

.spc_swatch:hover::before,
.spc_swatch:hover::after {
  opacity: 1;
  transform: translate(-50%, -10px);
}

/* Edit/Remove buttons */
.spc_swatch .edit-mini {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--fc-accent);
  color: #fff;
  border: none;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.8);
  cursor: pointer;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 2;
}

.spc_swatch:hover .edit-mini {
  opacity: 1;
  transform: scale(1);
}

.spc_swatch .rm-mini {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--fc-accent-red);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  padding-bottom: 2px;
  opacity: 0;
  transform: scale(0.8);
  cursor: pointer;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 2;
}

.spc_swatch:hover .rm-mini {
  opacity: 1;
  transform: scale(1);
}

/* -----------------------------------------------------------------
   Swatch Style Variants
----------------------------------------------------------------- */

/* Grid (default) */
.spc_groups.spc-style-grid .spc_swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spc-gap, 11px);
}

/* Grid Compact */
.spc_groups.spc-style-grid-compact .spc_swatches {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spc-gap, 11px) * 0.6);
}

.spc_groups.spc-style-grid-compact .spc_swatch > span {
  width: calc(var(--spc-size, 60px) * 0.7);
  height: calc(var(--spc-size, 60px) * 0.7);
}

/* Pill */
.spc_groups.spc-style-pill .spc_swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spc-gap, 11px);
}

.spc_groups.spc-style-pill .spc_swatch > span {
  width: auto;
  min-width: calc(var(--spc-size, 60px) * 1.6);
  height: calc(var(--spc-size, 60px) * 0.75);
  border-radius: 999px;
}

/* Pill Justified */
.spc_groups.spc-style-pill-justified .spc_swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(calc(var(--spc-size, 60px) * 1.8), 1fr));
  gap: var(--spc-gap, 11px);
}

.spc_groups.spc-style-pill-justified .spc_swatch > span {
  width: 100%;
  height: calc(var(--spc-size, 60px) * 0.75);
  border-radius: 999px;
}

/* List */
.spc_groups.spc-style-list .spc_swatches {
  display: flex;
  flex-direction: column;
  gap: var(--spc-gap, 11px);
}

.spc_groups.spc-style-list .spc_swatch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spc_groups.spc-style-list .spc_swatch::after {
  position: static;
  transform: none;
  opacity: 1;
  background: transparent;
  padding: 0;
  font-size: 12px;
  color: var(--fc-text-primary);
}

/* Dots */
.spc_groups.spc-style-dot .spc_swatches {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spc-gap, 11px) * 0.6);
}

.spc_groups.spc-style-dot .spc_swatch > span {
  width: calc(var(--spc-size, 60px) * 0.4);
  height: calc(var(--spc-size, 60px) * 0.4);
  border-radius: 999px;
}

/* Columns */
.spc_groups.spc-style-columns .spc_swatches {
  display: block;
  column-count: var(--spc-columns, 2);
  column-gap: var(--spc-gap, 11px);
}

.spc_groups.spc-style-columns .spc_swatch {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: var(--spc-gap, 11px);
}

.spc_groups.spc-style-columns .spc_swatch > span {
  width: 100%;
}

/* Selection Ring Color */
.spc_groups .spc_swatch input:checked + span {
  border-color: var(--spc-ring, var(--fc-swatch-active-ring, #fff));
  box-shadow: 0 0 0 var(--spc-ring-width, 3px) var(--spc-ring, var(--fc-swatch-active-ring, #fff)), 0 4px 12px rgba(0,0,0,0.3);
}

/* -----------------------------------------------------------------
   Swatch Edit Popover (Canvas Preview)
----------------------------------------------------------------- */

/* Pencil icon overlay on swatch hover */
.spc_swatch_edit_btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fc-bg-surface);
  border: 1px solid var(--fc-border-strong);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.spc_swatch_edit_btn svg {
  width: 10px;
  height: 10px;
  color: var(--fc-text-secondary);
}

.spc_swatch:hover .spc_swatch_edit_btn,
.spc_swatch_edit_btn:focus {
  opacity: 1;
  transform: scale(1);
}

.spc_swatch_edit_btn:hover {
  background: var(--fc-accent);
  border-color: var(--fc-accent);
}

.spc_swatch_edit_btn:hover svg {
  color: #fff;
}

/* Delete button on swatch hover */
.spc_swatch_delete_btn {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fc-danger, #ef4444);
  border: 1px solid var(--fc-danger, #ef4444);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  z-index: 10;
}

.spc_swatch_delete_btn svg {
  width: 10px;
  height: 10px;
  color: #fff;
}

.spc_swatch:hover .spc_swatch_delete_btn,
.spc_swatch_delete_btn:focus {
  opacity: 1;
  transform: scale(1);
}

.spc_swatch_delete_btn:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* -----------------------------------------------------------------
   Responsive
----------------------------------------------------------------- */
@media (max-width: 768px) {
  .fc-compiler.v3 {
    flex-direction: column;
  }

  .fc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    box-shadow: var(--fc-shadow-lg);
  }

  .fc-compiler.v3[data-sidebar="closed"] .fc-sidebar {
    transform: translateX(-100%);
  }

  .fc-sidebar-toggle {
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
  }

  .fc-compiler.v3[data-sidebar="closed"] .fc-main {
    padding-left: 16px;
  }

  .fc-main {
    padding: 12px;
    padding-top: 64px;
  }

  .fc-floating-swatches {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    max-width: 100%;
    margin-top: 12px;
    background: var(--fc-bg-surface);
  }

  .spc_groups {
    --spc-size: 44px;
    --spc-gap: 6px;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding: 8px 4px 12px 4px;
    scroll-behavior: smooth;
  }
  
  .spc_group {
    scroll-snap-align: center;
    flex-shrink: 0;
    min-width: 85vw;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px !important;
  }
  
  /* Hide scrollbar but keep functionality */
  .spc_groups::-webkit-scrollbar {
    height: 4px;
  }
  
  .spc_groups::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
  }
  
  .spc_groups::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
  }
  
  /* Mobile scroll indicators - subtle gradient fade on edges */
  .fc-floating-swatches::before,
  .fc-floating-swatches::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 10;
  }
  
  .fc-floating-swatches::before {
    left: 0;
    background: linear-gradient(to right, var(--spc-panel-bg, rgba(26, 29, 36, 0.95)), transparent);
  }
  
  .fc-floating-swatches::after {
    right: 0;
    background: linear-gradient(to left, var(--spc-panel-bg, rgba(26, 29, 36, 0.95)), transparent);
  }
  
  /* Mobile: Force opaque high-contrast for above/below positions */
  .fc-floating-swatches[data-position="above"],
  .fc-floating-swatches[data-position="below"] {
    --spc-panel-bg: rgba(26, 29, 36, 1) !important;
    --spc-panel-border: rgba(59, 130, 246, 0.5) !important;
    --spc-panel-blur: 0px !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--spc-panel-bg) !important;
  }
  
  .fc-floating-swatches[data-position="above"] .spc_label,
  .fc-floating-swatches[data-position="below"] .spc_label,
  .fc-floating-swatches[data-position="above"] .spc_name,
  .fc-floating-swatches[data-position="below"] .spc_name {
    color: #ffffff !important;
    opacity: 1 !important;
  }
  
  /* Light mode mobile high contrast */
  .fc-compiler.v3[data-theme="light"] .fc-floating-swatches[data-position="above"],
  .fc-compiler.v3[data-theme="light"] .fc-floating-swatches[data-position="below"] {
    --spc-panel-bg: rgba(255, 255, 255, 1) !important;
    --spc-panel-border: rgba(0, 0, 0, 0.15) !important;
  }
  
  .fc-compiler.v3[data-theme="light"] .fc-floating-swatches[data-position="above"] .spc_label,
  .fc-compiler.v3[data-theme="light"] .fc-floating-swatches[data-position="below"] .spc_label,
  .fc-compiler.v3[data-theme="light"] .fc-floating-swatches[data-position="above"] .spc_name,
  .fc-compiler.v3[data-theme="light"] .fc-floating-swatches[data-position="below"] .spc_name {
    color: #1a1d24 !important;
  }
}

/* -----------------------------------------------------------------
   Edit Swatch Popover
----------------------------------------------------------------- */
.add-pop {
  position: fixed;
  z-index: 9999;
  width: 280px;
  padding: 14px;
  background: #151821;
  border: 1px solid #2d3650;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05);
  display: grid;
  gap: 10px;
}

.add-pop .row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.add-pop input[type="text"] {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  background: #181b25;
  border: 1px solid #25293a;
  border-radius: 8px;
  color: #f9fafb;
  font-size: 13px;
}

.add-pop input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid #2d3650;
  background: #181b25;
  cursor: pointer;
}

.add-pop button {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: #4f46e5;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.add-pop button:hover {
  background: #7c73fa;
}

.edit-swatch-pop {
  width: 300px;
}

.edit-swatch-pop .pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #25293a;
}

.edit-swatch-pop .pop-title {
  font-size: 14px;
  font-weight: 600;
  color: #f9fafb;
}

.edit-swatch-pop .swatch-preview {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.15);
}

.edit-swatch-pop .custom-fields {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #25293a;
}

.edit-swatch-pop .custom-fields-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.edit-swatch-pop .custom-fields-header span {
  font-size: 11px;
  font-weight: 600;
  color: #6c7488;
  text-transform: uppercase;
}

.edit-swatch-pop .add-field {
  width: auto;
  padding: 5px 10px;
  height: auto;
  font-size: 11px;
  background: #1a1e28;
  border: 1px solid #2d3650;
  border-radius: 6px;
  color: #a3adc2;
}

.edit-swatch-pop .custom-fields-list {
  display: grid;
  gap: 8px;
}

.edit-swatch-pop .custom-field-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 32px;
  gap: 6px;
  align-items: center;
}

.edit-swatch-pop .custom-field-row input {
  height: 32px;
  font-size: 12px;
  padding: 0 4px;
  background: #181b25;
  border: 1px solid #25293a;
  border-radius: 6px;
  color: #f9fafb;
}

.edit-swatch-pop .rm-field {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff5a6a;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
}

.edit-swatch-pop .save {
  margin-top: 12px;
}

/* -----------------------------------------------------------------
   Scrollbar styling
----------------------------------------------------------------- */
.fc-sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.fc-sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.fc-sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--fc-border-subtle);
  border-radius: 3px;
}

.fc-sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--fc-border-strong);
}

/* -----------------------------------------------------------------
   iOS safe areas
----------------------------------------------------------------- */
@supports (padding: env(safe-area-inset-bottom)) {
  .fc-floating-swatches {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* =================================================================
   Dark Mode Text Fixes - Ensure all text is properly visible
   ================================================================= */

/* Base text color inheritance */
.fc-compiler.v3 {
  color: var(--fc-text-primary);
}

/* All labels, spans, paragraphs should inherit or use theme colors */
.fc-compiler.v3 label,
.fc-compiler.v3 span,
.fc-compiler.v3 p,
.fc-compiler.v3 div {
  color: inherit;
}

/* Field labels (uppercase labels) */
.fc-compiler.v3 .field > span,
.fc-compiler.v3 .field > span:first-child,
.fc-compiler.v3 label.field > span {
  color: var(--fc-text-muted) !important;
}

/* Hint text */
.fc-compiler.v3 .hint,
.fc-compiler.v3 span.hint,
.fc-compiler.v3 .field .hint {
  color: #8b95a8 !important;
}

.fc-compiler.v3[data-theme="light"] .hint,
.fc-compiler.v3[data-theme="light"] span.hint,
.fc-compiler.v3[data-theme="light"] .field .hint {
  color: #6b7280 !important;
}

/* Inline toggle labels */
.fc-compiler.v3 .fc-inline-toggle,
.fc-compiler.v3 .fc-inline-toggle span,
.fc-compiler.v3 .fc-inline-toggle > span {
  color: var(--fc-text-secondary) !important;
}

/* Details/accordion summary text */
.fc-compiler.v3 .fc-details summary,
.fc-compiler.v3 .fc-details summary span {
  color: var(--fc-text-primary) !important;
}

/* Object item text */
.fc-compiler.v3 .obj-item .id {
  color: var(--fc-text-primary) !important;
}

.fc-compiler.v3 .obj-item .sub {
  color: var(--fc-text-muted) !important;
}

/* Edit head labels */
.fc-compiler.v3 .edit-head {
  color: var(--fc-text-muted) !important;
}

/* Output block headers */
.fc-compiler.v3 .out-head,
.fc-compiler.v3 .out-head span {
  color: var(--fc-text-muted) !important;
}

/* Search labels */
.fc-compiler.v3 .fc-search-label {
  color: var(--fc-text-muted) !important;
}

/* Result text */
.fc-compiler.v3 .fc-result-name {
  color: var(--fc-text-primary) !important;
}

.fc-compiler.v3 .fc-result-meta {
  color: var(--fc-text-muted) !important;
}

.fc-compiler.v3 .fc-result-hex {
  color: var(--fc-text-secondary) !important;
}

/* Selected swatch text */
.fc-compiler.v3 .fc-selected-name {
  color: var(--fc-text-primary) !important;
}

.fc-compiler.v3 .fc-selected-meta {
  color: var(--fc-text-muted) !important;
}

/* Linked objects */
.fc-compiler.v3 .linked-item {
  color: var(--fc-text-primary) !important;
}

.fc-compiler.v3 .linked-empty {
  color: var(--fc-text-muted) !important;
}

/* Scheme items */
.fc-compiler.v3 .fc-scheme-name {
  color: var(--fc-text-primary) !important;
}

.fc-compiler.v3 .fc-scheme-meta {
  color: var(--fc-text-muted) !important;
}

.fc-compiler.v3 .fc-schemes-empty {
  color: var(--fc-text-muted) !important;
}

/* Device buttons */
.fc-compiler.v3 .fc-device-btn {
  color: var(--fc-text-muted) !important;
}

.fc-compiler.v3 .fc-device-btn:hover {
  color: var(--fc-text-secondary) !important;
}

.fc-compiler.v3 .fc-device-btn.active {
  color: var(--fc-accent-strong) !important;
}

/* Export tabs */
.fc-compiler.v3 .fc-export-tab {
  color: var(--fc-text-muted) !important;
}

.fc-compiler.v3 .fc-export-tab.active {
  color: var(--fc-text-primary) !important;
}

/* Logo */
.fc-compiler.v3 .fc-logo,
.fc-compiler.v3 .fc-logo span {
  color: var(--fc-text-primary) !important;
}

.fc-compiler.v3 .fc-logo-badge {
  color: var(--fc-accent-strong) !important;
}

/* Button text */
.fc-compiler.v3 .fc-btn-ghost {
  color: var(--fc-text-muted) !important;
}

.fc-compiler.v3 .fc-btn-ghost:hover {
  color: var(--fc-text-primary) !important;
}

/* Toolbar width display */
.fc-compiler.v3 .fc-width-display {
  color: var(--fc-text-secondary) !important;
}

/* Preview empty text */
.fc-compiler.v3 .preview-empty {
  color: var(--fc-text-muted) !important;
}

.fc-compiler.v3 .preview-empty strong {
  color: var(--fc-text-secondary) !important;
}

/* Swatch labels in preview - but NOT group headers */
.fc-compiler.v3 .spc_swatches .spc_label,
.fc-compiler.v3 .spc_swatch .spc_label {
  color: var(--fc-text-muted) !important;
}

/* Group header labels - use the CSS variable for customization */
.fc-compiler.v3 .spc_group > .spc_label,
.fc-compiler.v3 .spc_groups > .spc_group > .spc_label,
.fc-floating-swatches .spc_group > .spc_label,
#fc_previewGroups .spc_group > .spc_label,
.spc_groups .spc_group > .spc_label {
  color: var(--spc-header-color, var(--fc-text-secondary)) !important;
  font-size: var(--spc-header-size, 14px) !important;
  background: transparent !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}

/* Color picker label */
.fc-compiler.v3 .fc-color-picker-label {
  color: var(--fc-text-muted) !important;
}

/* Radio/Checkbox labels inline */
.fc-compiler.v3 input[type="radio"] + span,
.fc-compiler.v3 input[type="checkbox"] + span {
  color: var(--fc-text-secondary);
}

/* Ensure textareas have proper colors */
.fc-compiler.v3 textarea {
  color: var(--fc-text-primary);
  background: var(--fc-bg-input);
}

/* Action buttons text */
.fc-compiler.v3 .obj-item .actions button {
  color: var(--fc-text-secondary);
}

.fc-compiler.v3 .obj-item .actions .edit {
  color: #fff !important;
}

/* Create scheme button */
.fc-compiler.v3 .fc-create-scheme-btn {
  color: var(--fc-text-muted);
}

.fc-compiler.v3 .fc-create-scheme-btn:hover {
  color: var(--fc-accent-strong);
}

/* -----------------------------------------------------------------
   Toast Notifications
----------------------------------------------------------------- */
.fc-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.fc-toast {
  padding: 12px 20px;
  background: var(--fc-bg-surface);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-md);
  box-shadow: var(--fc-shadow-lg);
  color: var(--fc-text-primary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: fc-toast-in 0.25s ease;
  max-width: 400px;
}

.fc-toast.is-leaving {
  animation: fc-toast-out 0.2s ease forwards;
}

.fc-toast-success {
  border-color: var(--fc-accent-green);
}

.fc-toast-success::before {
  content: "✓";
  color: var(--fc-accent-green);
  font-weight: bold;
}

.fc-toast-error {
  border-color: var(--fc-accent-red);
}

.fc-toast-error::before {
  content: "✕";
  color: var(--fc-accent-red);
  font-weight: bold;
}

.fc-toast-info {
  border-color: var(--fc-accent);
}

.fc-toast-info::before {
  content: "ℹ";
  color: var(--fc-accent);
  font-weight: bold;
}

@keyframes fc-toast-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* Section reset buttons */
.fc-section-reset {
  padding: 2px 8px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: transparent;
  color: var(--fc-text-muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: all var(--fc-transition);
  margin-left: auto;
  margin-right: 8px;
  white-space: nowrap;
}

.fc-details:hover .fc-section-reset,
.fc-details[open] .fc-section-reset {
  opacity: 0.7;
}

.fc-section-reset:hover {
  opacity: 1;
  background: var(--fc-bg-surface-soft);
  color: var(--fc-accent-red);
  border-color: var(--fc-accent-red);
}

.fc-section-reset:active {
  transform: scale(0.97);
}

/* -----------------------------------------------------------------
   Webflow Export Panel
----------------------------------------------------------------- */
.fc-webflow-intro {
  padding: 10px 12px;
  background: var(--fc-accent-soft);
  border: 1px solid var(--fc-accent);
  border-radius: var(--fc-radius-sm);
  margin-bottom: 12px;
}

.fc-webflow-intro p {
  font-size: 12px;
  color: var(--fc-accent-strong);
  margin: 0;
}

.fc-webflow-hint {
  font-size: 10px;
  color: var(--fc-text-muted);
  font-weight: 400;
  text-transform: none;
  margin-left: auto;
  margin-right: 8px;
}

.fc-webflow-alt {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--fc-border-subtle);
}

.fc-webflow-alt .hint {
  font-size: 11px;
  margin-bottom: 10px;
}

/* -----------------------------------------------------------------
   Filament Provider UI
----------------------------------------------------------------- */
.fc-provider-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.fc-provider-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-provider-item:hover {
  border-color: var(--fc-accent);
  background: var(--fc-accent-soft);
}

/* Toggle Switch */
.fc-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.fc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.fc-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-pill);
  transition: all var(--fc-transition);
}

.fc-toggle-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--fc-slider-thumb, #505050);
  border-radius: 50%;
  transition: all var(--fc-transition);
}

.fc-toggle input:checked + .fc-toggle-slider {
  background: var(--fc-accent-blue);
  border-color: var(--fc-accent-blue);
}

.fc-toggle input:checked + .fc-toggle-slider::before {
  transform: translateX(18px);
  background: var(--fc-text-opaque);
}

.fc-toggle input:focus + .fc-toggle-slider {
  box-shadow: 0 0 0 2px var(--fc-accent-soft);
}

/* -----------------------------------------------------------------
   Filament Mode Toggle
----------------------------------------------------------------- */
.fc-filament-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--fc-bg-surface-soft);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-md);
}

.fc-filament-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  color: var(--fc-text-muted);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-filament-settings-btn:hover:not(:disabled) {
  background: var(--fc-accent-soft);
  border-color: var(--fc-accent);
  color: var(--fc-accent);
}

.fc-filament-settings-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* -----------------------------------------------------------------
   Palette Browser
----------------------------------------------------------------- */
.fc-palette-browser {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fc-palette-tabs {
  display: flex;
  gap: 4px;
  background: var(--fc-bg-surface-soft);
  padding: 4px;
  border-radius: var(--fc-radius-md);
}

.fc-palette-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-palette-tab:hover {
  color: var(--fc-text-primary);
  background: var(--fc-bg-surface);
}

.fc-palette-tab.active {
  color: var(--fc-text-opaque);
  background: var(--fc-accent);
}

.fc-palette-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Palette Card */
.fc-palette-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--fc-bg-surface-soft);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-md);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-palette-card:hover {
  border-color: var(--fc-accent);
  background: var(--fc-accent-soft);
}

.fc-palette-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fc-palette-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--fc-text-primary);
}

.fc-palette-card-count {
  font-size: 10px;
  color: var(--fc-text-muted);
  background: var(--fc-bg-input);
  padding: 2px 6px;
  border-radius: var(--fc-radius-pill);
}

.fc-palette-card-colors {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.fc-palette-card-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.fc-palette-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.fc-palette-card-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-palette-card-btn.primary {
  background: var(--fc-accent);
  color: white;
}

.fc-palette-card-btn.primary:hover {
  background: var(--fc-accent-strong);
}

.fc-palette-card-btn.secondary {
  background: var(--fc-bg-input);
  color: var(--fc-text-primary);
  border: 1px solid var(--fc-border-subtle);
}

.fc-palette-card-btn.secondary:hover {
  background: var(--fc-bg-input-hover);
  border-color: var(--fc-border-strong);
}

/* Palette Empty State */
.fc-palette-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--fc-text-muted);
  text-align: center;
}

.fc-palette-empty svg {
  opacity: 0.5;
}

.fc-palette-empty span {
  font-size: 12px;
}

/* -----------------------------------------------------------------
   Swatch Edit Modal
----------------------------------------------------------------- */
.fc-swatch-edit-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 340px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1000;
  background: var(--fc-bg-sidebar);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-lg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.fc-swatch-edit-color {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.fc-swatch-edit-color input[type="color"] {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-md);
  cursor: pointer;
}

.fc-swatch-edit-color input[type="text"] {
  flex: 1;
  font-family: monospace;
  font-size: 14px;
  text-transform: uppercase;
}

.fc-swatch-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--fc-border-subtle);
}

.fc-swatch-edit-actions button {
  flex: 1;
}

/* Custom Attributes */
.fc-custom-attributes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.fc-attribute-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fc-attribute-row input {
  flex: 1;
  min-width: 0;
}

.fc-attribute-row input:first-child {
  max-width: 100px;
}

.fc-attribute-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--fc-text-muted);
  cursor: pointer;
  border-radius: var(--fc-radius-sm);
  transition: all var(--fc-transition);
}

.fc-attribute-delete:hover {
  background: var(--fc-error-bg);
  color: var(--fc-error);
}

.fc-add-attribute-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  font-size: 12px;
  color: var(--fc-accent);
  background: var(--fc-accent-soft);
  border: 1px dashed var(--fc-accent);
  border-radius: var(--fc-radius-sm);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-add-attribute-btn:hover {
  background: var(--fc-accent);
  color: white;
  border-style: solid;
}

/* -----------------------------------------------------------------
   Slider Controls (v1-style)
----------------------------------------------------------------- */
/* Slider Row Container */
.fc-slider-row {
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--fc-bg-surface-soft);
  border: 1px solid var(--fc-border-subtle);
  display: grid;
  gap: 8px;
  min-width: 0;
}

.fc-slider-row.compact {
  padding: 8px 10px;
  border-radius: 14px;
}

/* Slider Header */
.fc-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fc-slider-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-text-secondary);
}

.fc-slider-value {
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: var(--fc-text-primary);
  font-weight: 500;
}

/* Slider Controls Container */
.fc-slider-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

/* Number Input - compact pill style */
.fc-slider-input {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 24px !important;
  padding: 0 4px !important;
  border-radius: var(--fc-radius-pill) !important;
  border: 1px solid var(--fc-border-subtle) !important;
  background: var(--fc-elevation-01) !important;
  color: var(--fc-text-secondary) !important;
  font-size: var(--fc-font-size-xs) !important;
  font-family: var(--fc-font-family) !important;
  line-height: 22px !important;
  text-align: center !important;
  outline: none !important;
  flex: 0 0 44px !important;
  font-family: inherit !important;
  -moz-appearance: textfield !important;
}

/* Hide spinner buttons */
.fc-slider-input::-webkit-outer-spin-button,
.fc-slider-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fc-slider-input:focus {
  color: var(--fc-text-primary) !important;
  border-color: var(--fc-accent) !important;
  box-shadow: 0 0 0 1px var(--fc-accent) !important;
}

/* Light mode input - uses theme variables automatically */
.fc-compiler.v3[data-theme="light"] .fc-slider-input {
  background: var(--fc-elevation-01) !important;
  color: var(--fc-text-secondary) !important;
}

.fc-compiler.v3[data-theme="light"] .fc-slider-input:focus {
  color: var(--fc-text-primary) !important;
}

/* Range Slider - pill track with fill effect */
.fc-slider {
  appearance: none;
  -webkit-appearance: none;
  height: 24px;
  width: 100%;
  min-width: 80px;
  border-radius: 999px;
  background: transparent;
  outline: none;
  flex: 1 1 auto;
  position: relative;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

/* WebKit Track */
.fc-slider::-webkit-slider-runnable-track {
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--fc-elevation-02) 0%,
    var(--fc-elevation-02) var(--fc-slider-pct, 0%),
    var(--fc-elevation-01) var(--fc-slider-pct, 0%),
    var(--fc-elevation-01) 100%
  );
  border: 1px solid var(--fc-border-subtle);
}

/* Firefox Track */
.fc-slider::-moz-range-track {
  height: 24px;
  border-radius: 999px;
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-subtle);
}

.fc-slider::-moz-range-progress {
  height: 24px;
  border-radius: 999px;
  background: var(--fc-elevation-02);
}

/* Thumb - pill shaped, solid opaque color */
.fc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 22px;
  border-radius: 999px;
  background: #505050; /* Solid dark gray - always opaque */
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 0;
  cursor: pointer;
  transition: background 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.fc-slider::-moz-range-thumb {
  width: 16px;
  height: 22px;
  border-radius: 999px;
  background: #505050; /* Solid dark gray - always opaque */
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.fc-slider:hover::-webkit-slider-thumb {
  background: #666666; /* Lighter on hover */
}

.fc-slider:hover::-moz-range-thumb {
  background: #666666; /* Lighter on hover */
}

/* Light mode slider - uses same design tokens, values adjust via theme variables */
.fc-compiler.v3[data-theme="light"] .fc-slider::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    var(--fc-elevation-02) 0%,
    var(--fc-elevation-02) var(--fc-slider-pct, 0%),
    var(--fc-elevation-01) var(--fc-slider-pct, 0%),
    var(--fc-elevation-01) 100%
  );
}

.fc-compiler.v3[data-theme="light"] .fc-slider::-webkit-slider-thumb {
  background: #505050;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.fc-compiler.v3[data-theme="light"] .fc-slider:hover::-webkit-slider-thumb {
  background: #666666;
}

.fc-compiler.v3[data-theme="light"] .fc-slider::-moz-range-track {
  background: var(--fc-elevation-01);
}

.fc-compiler.v3[data-theme="light"] .fc-slider::-moz-range-progress {
  background: var(--fc-elevation-02);
}

.fc-compiler.v3[data-theme="light"] .fc-slider::-moz-range-thumb {
  background: #505050;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.fc-compiler.v3[data-theme="light"] .fc-slider:hover::-moz-range-thumb {
  background: #666666;
}

/* Single column slider layout */
.fc-row-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

/* Color input row */
.fc-color-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

/* Color + Opacity row */
.fc-color-opacity-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: flex-end;
}

.fc-color-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 60px;
}

.fc-color-field span {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-text-muted);
}

.fc-color-field input[type="color"] {
  width: 100%;
  height: 32px;
  padding: 2px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: transparent;
  cursor: pointer;
}

.fc-color-field input[type="color"]:hover {
  border-color: var(--fc-border-strong);
}

/* Opacity field */
.fc-opacity-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 80px;
}

.fc-opacity-field > span {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-text-muted);
}

.fc-opacity-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Opacity slider - pill style matching other sliders */
.fc-opacity-slider {
  flex: 1;
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border-radius: var(--fc-radius-pill);
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.fc-opacity-slider::-webkit-slider-runnable-track {
  height: 24px;
  border-radius: var(--fc-radius-pill);
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-subtle);
}

.fc-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 24px;
  border-radius: var(--fc-radius-pill);
  background: var(--fc-slider-thumb, #505050);
  border: 1px solid var(--fc-elevation-03);
  cursor: pointer;
  margin-top: 0;
  transition: background 0.15s ease;
}

.fc-opacity-slider::-moz-range-track {
  height: 24px;
  border-radius: var(--fc-radius-pill);
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-subtle);
}

.fc-opacity-slider::-moz-range-thumb {
  width: 16px;
  height: 24px;
  border-radius: var(--fc-radius-pill);
  background: var(--fc-slider-thumb, #505050);
  border: 1px solid var(--fc-elevation-03);
  cursor: pointer;
}

.fc-opacity-slider:hover::-webkit-slider-thumb {
  background: var(--fc-elevation-04);
}

.fc-opacity-slider:hover::-moz-range-thumb {
  background: var(--fc-elevation-04);
}

.fc-opacity-value {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-text-secondary);
  min-width: 32px;
  text-align: right;
}

/* Section labels and dividers */
.fc-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.fc-section-divider {
  height: 1px;
  background: var(--fc-border-subtle);
  margin: 16px 0;
}

/* Fallback: Style ALL range inputs in fc-compiler */
.fc-compiler input[type="range"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: transparent !important;
  outline: none !important;
  cursor: pointer !important;
  margin: 0 !important;
}

.fc-compiler input[type="range"]::-webkit-slider-runnable-track {
  height: 24px !important;
  border-radius: 999px !important;
  background: linear-gradient(to right, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.08) var(--fc-slider-pct,50%), rgba(255,255,255,0.03) var(--fc-slider-pct,50%), rgba(255,255,255,0.03) 100%) !important;
  border: 1px solid var(--fc-border-subtle) !important;
}

.fc-compiler input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 16px !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: #505050 !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  margin-top: 0 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.fc-compiler input[type="range"]::-moz-range-track {
  height: 24px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--fc-border-subtle) !important;
}

.fc-compiler input[type="range"]::-moz-range-thumb {
  width: 16px !important;
  height: 24px !important;
  border-radius: 999px !important;
  background: #505050 !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.fc-compiler input[type="range"]:hover::-webkit-slider-thumb {
  background: #666666 !important;
}

.fc-compiler input[type="range"]:hover::-moz-range-thumb {
  background: #666666 !important;
}

/* Light mode range */
.fc-compiler.v3[data-theme="light"] input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(to right, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.1) var(--fc-slider-pct,50%), rgba(0,0,0,0.04) var(--fc-slider-pct,50%), rgba(0,0,0,0.04) 100%) !important;
}

.fc-compiler.v3[data-theme="light"] input[type="range"]::-webkit-slider-thumb {
  background: #505050 !important;
  border-color: rgba(0,0,0,0.15) !important;
}

.fc-compiler.v3[data-theme="light"] input[type="range"]::-moz-range-thumb {
  background: #505050 !important;
  border-color: rgba(0,0,0,0.15) !important;
}

/* Compact number inputs */
.fc-compiler .field.compact input[type="number"] {
  width: 52px !important;
  max-width: 52px !important;
  height: 28px !important;
  padding: 0 6px !important;
  border-radius: 999px !important;
  border: 1px solid var(--fc-border-subtle) !important;
  background: rgba(255,255,255,0.04) !important;
  color: var(--fc-text-secondary) !important;
  font-size: 12px !important;
  text-align: center !important;
  -moz-appearance: textfield !important;
}

.fc-compiler .field.compact input[type="number"]::-webkit-outer-spin-button,
.fc-compiler .field.compact input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

.fc-compiler.v3[data-theme="light"] .field.compact input[type="number"] {
  background: rgba(0,0,0,0.04) !important;
}

.fc-provider-item:has(input:checked) .fc-provider-name {
  color: var(--fc-accent-strong);
}

.fc-provider-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-provider-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-text-primary);
}

.fc-provider-count {
  font-size: 11px;
  color: var(--fc-text-muted);
  background: var(--fc-bg-surface-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.fc-provider-options {
  padding: 10px 0;
  border-top: 1px solid var(--fc-border-subtle);
}

/* Sub-details for custom API */
.fc-sub-details {
  margin-top: 10px;
  border-top: 1px solid var(--fc-border-subtle);
  padding-top: 10px;
}

.fc-sub-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fc-text-muted);
  cursor: pointer;
  padding: 4px 0;
}

.fc-sub-summary:hover {
  color: var(--fc-text-primary);
}

.fc-sub-summary svg {
  transition: transform var(--fc-transition);
}

.fc-sub-details[open] .fc-sub-summary svg {
  transform: rotate(180deg);
}

.fc-sub-content {
  padding: 10px 0 0;
}

/* -----------------------------------------------------------------
   Error States
----------------------------------------------------------------- */
.fc-input-error {
  border-color: var(--fc-accent-red) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.fc-input-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3) !important;
}

/* -----------------------------------------------------------------
   Light Mode - Button and UI Fixes
----------------------------------------------------------------- */
/* Copy buttons */
.fc-compiler.v3[data-theme="light"] .out-head button {
  background: var(--fc-accent);
  color: #fff;
}

.fc-compiler.v3[data-theme="light"] .out-head button:hover {
  background: var(--fc-accent-blue-dark);
}

/* Share button */
.fc-compiler.v3[data-theme="light"] .fc-share-btn {
  background: var(--fc-accent-soft);
  border-color: var(--fc-accent);
  color: var(--fc-accent-strong);
}

.fc-compiler.v3[data-theme="light"] .fc-share-btn:hover {
  background: var(--fc-accent);
  color: #fff;
}

/* Device selector buttons */
.fc-compiler.v3[data-theme="light"] .fc-device-btn {
  background: transparent;
  border-color: var(--fc-border-subtle);
  color: var(--fc-text-secondary);
}

.fc-compiler.v3[data-theme="light"] .fc-device-btn:hover {
  background: var(--fc-bg-surface-soft);
  border-color: var(--fc-border-strong);
  color: var(--fc-text-primary);
}

.fc-compiler.v3[data-theme="light"] .fc-device-btn.active {
  background: var(--fc-accent);
  border-color: var(--fc-accent);
  color: #fff;
}

/* Object item action buttons - light mode */
.fc-compiler.v3[data-theme="light"] .obj-item .actions button {
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-subtle);
  color: var(--fc-text-secondary);
}

.fc-compiler.v3[data-theme="light"] .obj-item .actions button:hover {
  background: var(--fc-elevation-02);
  border-color: var(--fc-border-strong);
  color: var(--fc-text-primary);
}

.fc-compiler.v3[data-theme="light"] .obj-item .actions .edit {
  background: var(--fc-accent-blue) !important;
  border-color: var(--fc-accent-blue) !important;
  color: #fff !important;
}

.fc-compiler.v3[data-theme="light"] .obj-item .actions .edit:hover {
  background: var(--fc-accent-blue-dark) !important;
}

/* Add button - light mode */
.fc-compiler.v3[data-theme="light"] .obj-new button {
  background: var(--fc-accent-blue);
  color: #fff;
}

.fc-compiler.v3[data-theme="light"] .obj-new button:hover {
  background: var(--fc-accent-blue-dark);
}

/* Randomize button and ghost buttons - light mode */
.fc-compiler.v3[data-theme="light"] .fc-btn-ghost {
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-subtle);
  color: var(--fc-text-secondary);
}

.fc-compiler.v3[data-theme="light"] .fc-btn-ghost:hover {
  background: var(--fc-elevation-02);
  border-color: var(--fc-border-strong);
  color: var(--fc-text-primary);
}

/* Reset button danger styling - light mode */
.fc-compiler.v3[data-theme="light"] #fc_reset {
  background: transparent;
  color: var(--fc-accent-red);
  border-color: rgba(219, 77, 79, 0.3);
}

.fc-compiler.v3[data-theme="light"] #fc_reset:hover {
  background: rgba(219, 77, 79, 0.08);
  border-color: var(--fc-accent-red-dark);
  color: var(--fc-accent-red-dark);
}

/* Search inputs - light mode high contrast */
.fc-compiler.v3[data-theme="light"] .fc-search-input,
.fc-compiler.v3[data-theme="light"] .spc_search_input,
.fc-compiler.v3[data-theme="light"] .fc-modal-search input {
  background: #fff;
  border-color: var(--fc-border-strong);
}

.fc-compiler.v3[data-theme="light"] .fc-search-input:focus,
.fc-compiler.v3[data-theme="light"] .spc_search_input:focus,
.fc-compiler.v3[data-theme="light"] .fc-modal-search input:focus {
  background: #fff;
}

/* Create scheme button - light mode */
.fc-compiler.v3[data-theme="light"] .fc-create-scheme-btn {
  background: transparent;
  border: 1px dashed var(--fc-border-strong);
  color: var(--fc-text-muted);
}

.fc-compiler.v3[data-theme="light"] .fc-create-scheme-btn:hover {
  background: var(--fc-elevation-01);
  border-color: var(--fc-accent-blue);
  color: var(--fc-accent-blue);
}

/* Import button - light mode */
.fc-compiler.v3[data-theme="light"] .fc-import-btn {
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-subtle);
  color: var(--fc-text-secondary);
}

.fc-compiler.v3[data-theme="light"] .fc-import-btn:hover {
  background: var(--fc-elevation-02);
  border-color: var(--fc-accent-blue);
  color: var(--fc-accent-blue);
}

/* Export tabs */
.fc-compiler.v3[data-theme="light"] .fc-export-tab {
  background: transparent;
  color: var(--fc-text-secondary);
}

.fc-compiler.v3[data-theme="light"] .fc-export-tab:hover {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-primary);
}

.fc-compiler.v3[data-theme="light"] .fc-export-tab.active {
  background: var(--fc-accent);
  color: #fff;
}

/* Section reset buttons */
.fc-compiler.v3[data-theme="light"] .fc-section-reset {
  color: var(--fc-text-muted);
}

.fc-compiler.v3[data-theme="light"] .fc-section-reset:hover {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-accent-red);
}

/* Provider toggle switches */
.fc-compiler.v3[data-theme="light"] .fc-toggle-slider {
  background: var(--fc-bg-input);
  border-color: var(--fc-border-subtle);
}

.fc-compiler.v3[data-theme="light"] .fc-toggle-slider::before {
  background: var(--fc-text-muted);
}

.fc-compiler.v3[data-theme="light"] .fc-toggle input:checked + .fc-toggle-slider {
  background: var(--fc-accent-blue);
  border-color: var(--fc-accent-blue);
}

.fc-compiler.v3[data-theme="light"] .fc-toggle input:checked + .fc-toggle-slider::before {
  background: #fff;
}

/* Inline toggle - light mode */
.fc-compiler.v3[data-theme="light"] .fc-inline-toggle .fc-toggle-track {
  background: var(--fc-elevation-01);
  border-color: var(--fc-border-subtle);
}

.fc-compiler.v3[data-theme="light"] .fc-inline-toggle .fc-toggle-thumb {
  background: var(--fc-slider-thumb);
}

.fc-compiler.v3[data-theme="light"] .fc-inline-toggle input[type="checkbox"]:checked + .fc-toggle-track {
  background: var(--fc-accent-blue);
  border-color: var(--fc-accent-blue);
}

.fc-compiler.v3[data-theme="light"] .fc-inline-toggle input[type="checkbox"]:checked + .fc-toggle-track .fc-toggle-thumb {
  background: #fff;
}

.fc-compiler.v3[data-theme="light"] .fc-inline-toggle:hover .fc-toggle-track {
  background: var(--fc-elevation-02);
  border-color: var(--fc-border-strong);
}

/* Provider items */
.fc-compiler.v3[data-theme="light"] .fc-provider-item {
  background: var(--fc-bg-input);
  border-color: var(--fc-border-subtle);
}

.fc-compiler.v3[data-theme="light"] .fc-provider-item:hover {
  background: var(--fc-accent-soft);
  border-color: var(--fc-accent);
}

.fc-compiler.v3[data-theme="light"] .fc-provider-name {
  color: var(--fc-text-primary);
}

.fc-compiler.v3[data-theme="light"] .fc-provider-count {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-muted);
}

/* Toast notifications */
.fc-compiler.v3[data-theme="light"] .fc-toast {
  background: var(--fc-bg-surface);
  border-color: var(--fc-border-subtle);
  color: var(--fc-text-primary);
  box-shadow: var(--fc-shadow-lg);
}

/* Webflow intro box */
.fc-compiler.v3[data-theme="light"] .fc-webflow-intro {
  background: var(--fc-accent-soft);
  border-color: var(--fc-accent);
}

.fc-compiler.v3[data-theme="light"] .fc-webflow-intro p {
  color: var(--fc-accent-strong);
}

/* Sidebar toggle button */
.fc-compiler.v3[data-theme="light"] .fc-sidebar-toggle {
  background: var(--fc-bg-surface);
  border-color: var(--fc-border-subtle);
  color: var(--fc-text-secondary);
}

.fc-compiler.v3[data-theme="light"] .fc-sidebar-toggle:hover {
  background: var(--fc-bg-surface-soft);
  border-color: var(--fc-border-strong);
  color: var(--fc-text-primary);
}

/* Sub-details toggle */
.fc-compiler.v3[data-theme="light"] .fc-sub-summary {
  color: var(--fc-text-muted);
}

.fc-compiler.v3[data-theme="light"] .fc-sub-summary:hover {
  color: var(--fc-text-primary);
}

/* Search result source label */
.fc-result-source {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  background: var(--fc-accent-soft);
  color: var(--fc-accent-strong);
  border-radius: 4px;
  margin-left: auto;
}

.fc-no-results,
.spc_no_results {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--fc-text-muted);
}

/* -----------------------------------------------------------------
   Import from Scene Button & Modal
----------------------------------------------------------------- */

/* Import from Scene button */
.fc-import-scene-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: 8px;
  border-radius: var(--fc-radius-sm);
  border: 1px dashed var(--fc-accent);
  background: var(--fc-accent-soft);
  color: var(--fc-accent-strong);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-import-scene-btn:hover {
  background: var(--fc-accent);
  border-style: solid;
  color: #fff;
}

.fc-import-scene-btn svg {
  flex-shrink: 0;
}

/* Randomize Colors Button */
.fc-randomize-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  margin: 12px 0;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-strong);
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-randomize-btn:hover {
  background: var(--fc-accent);
  border-color: var(--fc-accent);
  color: #fff;
}

.fc-randomize-btn svg {
  flex-shrink: 0;
}

/* Randomize button - light mode */
.fc-compiler.v3[data-theme="light"] .fc-randomize-btn {
  background: var(--fc-elevation-01);
  border: 1px solid var(--fc-border-subtle);
  color: var(--fc-text-secondary);
}

.fc-compiler.v3[data-theme="light"] .fc-randomize-btn:hover {
  background: var(--fc-accent-blue);
  border-color: var(--fc-accent-blue);
  color: #fff;
}

/* Modal Overlay */
.fc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* Modal Container */
.fc-modal {
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  background: var(--fc-bg-sidebar);
  border: 1px solid var(--fc-border-strong);
  border-radius: var(--fc-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Modal Header */
.fc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fc-border-subtle);
}

.fc-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fc-text-primary);
}

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

.fc-modal-close:hover {
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-primary);
}

/* Modal Search */
.fc-modal-search {
  padding: 12px 20px;
  border-bottom: 1px solid var(--fc-border-subtle);
}

.fc-modal-search input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-strong);
  background: var(--fc-bg-surface);
  color: var(--fc-text-primary);
  font-size: 13px;
}

.fc-modal-search input::placeholder {
  color: var(--fc-text-muted);
}

.fc-modal-search input:focus {
  outline: none;
  border-color: var(--fc-accent);
  box-shadow: 0 0 0 2px var(--fc-accent-soft);
  background: var(--fc-bg-surface-soft);
}

/* Modal Body */
.fc-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

/* Import List */
.fc-import-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fc-import-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-input);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-import-item:hover {
  background: var(--fc-bg-input-hover);
  border-color: var(--fc-border-strong);
}

.fc-import-item:has(input:checked) {
  background: var(--fc-accent-soft);
  border-color: var(--fc-accent);
}

.fc-import-item:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}

.fc-import-item.has-color {
  background: rgba(var(--fc-accent-rgb, 99, 102, 241), 0.08);
}

.fc-import-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--fc-accent);
  flex-shrink: 0;
}

.fc-import-color {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

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

.fc-import-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-import-type {
  font-size: 11px;
  color: var(--fc-text-muted);
  text-transform: capitalize;
}

.fc-import-added {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  background: var(--fc-bg-surface-soft);
  color: var(--fc-text-muted);
  border-radius: 4px;
}

/* Modal Footer */
.fc-modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--fc-border-subtle);
}

.fc-import-count {
  font-size: 12px;
  color: var(--fc-text-muted);
  margin-right: auto;
}

.fc-btn-secondary {
  padding: 8px 16px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-strong);
  background: transparent;
  color: var(--fc-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

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

.fc-btn-primary {
  padding: 8px 16px;
  border-radius: var(--fc-radius-sm);
  border: none;
  background: var(--fc-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-btn-primary:hover {
  background: var(--fc-accent-strong);
}

.fc-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Suggestion chips for manual entry modal */
.fc-suggestion-chip {
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface);
  color: var(--fc-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-suggestion-chip:hover {
  background: var(--fc-accent-soft);
  border-color: var(--fc-accent);
  color: var(--fc-accent-strong);
}

/* Light mode overrides for modal */
.fc-compiler.v3[data-theme="light"] .fc-modal-overlay {
  background: rgba(0, 0, 0, 0.4);
}

.fc-compiler.v3[data-theme="light"] .fc-modal {
  background: var(--fc-bg-sidebar);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.fc-compiler.v3[data-theme="light"] .fc-import-item {
  background: var(--fc-bg-surface);
}

.fc-compiler.v3[data-theme="light"] .fc-import-item:hover {
  background: var(--fc-bg-surface-soft);
}

.fc-compiler.v3[data-theme="light"] .fc-import-color {
  border-color: rgba(0, 0, 0, 0.1);
}

/* -----------------------------------------------------------------
   Recent Colors
----------------------------------------------------------------- */

.fc-recent-colors {
  margin-bottom: 12px;
}

.fc-recent-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.fc-recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fc-recent-chip {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--fc-border-subtle);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: all var(--fc-transition);
  overflow: hidden;
}

.fc-recent-chip span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.fc-recent-chip:hover {
  border-color: var(--fc-accent);
  transform: scale(1.1);
}

.fc-recent-chip:active {
  transform: scale(0.95);
}

/* -----------------------------------------------------------------
   Export Modal
----------------------------------------------------------------- */
.fc-export-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.fc-export-modal.open {
  display: flex;
}

.fc-export-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.fc-export-modal-content {
  position: relative;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  background: var(--fc-bg-surface);
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-lg);
  box-shadow: var(--fc-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fc-export-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface-soft);
}

.fc-export-modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fc-text-primary);
}

.fc-export-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--fc-radius-sm);
  border: none;
  background: transparent;
  color: var(--fc-text-muted);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-export-modal-close:hover {
  background: var(--fc-elevation-02);
  color: var(--fc-text-primary);
}

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

/* Export tabs in modal */
.fc-export-modal .fc-export-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--fc-elevation-01);
  border-radius: var(--fc-radius-sm);
}

.fc-export-modal .fc-export-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--fc-text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-export-modal .fc-export-tab:hover {
  background: var(--fc-elevation-02);
  color: var(--fc-text-primary);
}

.fc-export-modal .fc-export-tab.active {
  background: var(--fc-accent-blue);
  color: #fff;
}

/* Output blocks in modal */
.fc-export-modal .out-block {
  margin-bottom: 16px;
}

.fc-export-modal .out-block:last-child {
  margin-bottom: 0;
}

.fc-export-modal .out-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.fc-export-modal .out-head span:first-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--fc-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fc-export-modal .out-head button {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  background: var(--fc-accent-blue);
  color: #fff;
  cursor: pointer;
  transition: background var(--fc-transition);
}

.fc-export-modal .out-head button:hover {
  background: var(--fc-accent-blue-dark);
}

.fc-export-modal textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-elevation-01);
  color: var(--fc-text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}

.fc-export-modal textarea:focus {
  outline: none;
  border-color: var(--fc-accent-blue);
}

.fc-export-modal .fc-webflow-hint {
  font-size: 10px;
  color: var(--fc-text-muted);
  font-style: italic;
}

.fc-export-modal .fc-webflow-intro p {
  font-size: 13px;
  color: var(--fc-text-secondary);
  margin: 0 0 16px 0;
}

.fc-export-modal .fc-webflow-alt {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--fc-border-subtle);
}

/* CDN Compact panel */
.fc-cdn-note {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--fc-radius-sm);
}

.fc-cdn-note small {
  font-size: 11px;
  color: rgba(34, 197, 94, 0.9);
}

.fc-export-modal .fc-webflow-alt .hint {
  font-size: 12px;
  color: var(--fc-text-muted);
  margin: 4px 0 12px 0;
}

/* Light mode for export modal */
.fc-compiler.v3[data-theme="light"] .fc-export-modal-backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.fc-compiler.v3[data-theme="light"] .fc-export-modal-content {
  background: var(--fc-bg-surface);
  border-color: var(--fc-border-subtle);
}

/* -----------------------------------------------------------------
   Position Picker - Icon Buttons
----------------------------------------------------------------- */
.fc-position-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  margin-top: 8px;
}

.fc-position-picker.compact {
  padding: 6px;
  gap: 4px;
}

.fc-position-row {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 8px;
}

.fc-position-row.hidden {
  display: none;
}

.fc-position-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  min-width: 55px;
  flex-shrink: 0;
}

.fc-position-divider {
  width: 1px;
  height: 20px;
  background: var(--fc-border-subtle);
  margin: 0 4px;
}

.fc-position-buttons {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: var(--fc-radius-sm);
}

.fc-position-buttons.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.fc-pos-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--fc-text-muted);
  transition: all var(--fc-transition);
}

.fc-pos-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fc-text-primary);
}

.fc-pos-btn.active {
  background: var(--fc-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

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

/* Text mode buttons (Inside/Outside) */
.fc-pos-btn.text {
  width: auto;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--fc-radius-sm);
}



/* Light mode */
.fc-compiler.v3[data-theme="light"] .fc-position-picker {
  background: rgba(0, 0, 0, 0.03);
}

.fc-compiler.v3[data-theme="light"] .fc-position-buttons {
  background: rgba(0, 0, 0, 0.06);
}

.fc-compiler.v3[data-theme="light"] .fc-pos-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.fc-compiler.v3[data-theme="light"] .fc-pos-btn.active {
  background: var(--fc-accent);
  color: #fff;
}

/* -----------------------------------------------------------------
   Appearance Button Grid
------------------------------------------------------------------ */
.fc-appearance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

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

.fc-appearance-grid.fc-appearance-grid-3x2 {
  grid-template-columns: repeat(3, 1fr);
}

/* Code Preview Block */
.fc-code-preview {
  padding: 10px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: 6px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

/* Breakpoint Tabs */
.fc-breakpoint-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-input);
}

.fc-breakpoint-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: var(--fc-radius-sm);
  background: transparent;
  color: var(--fc-text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-breakpoint-tab:hover {
  background: var(--fc-bg-hover);
  color: var(--fc-text-primary);
}

.fc-breakpoint-tab.active {
  background: var(--fc-accent);
  color: #fff;
}

.fc-breakpoint-tab svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Inherit Toggle */
.fc-inherit-toggle {
  padding: 10px 12px;
  background: var(--fc-bg-elevated);
  border-bottom: 1px solid var(--fc-border-subtle);
  margin: 0 -12px 12px -12px;
}

/* Breakpoint Content */
.fc-breakpoint-content {
  display: grid;
  gap: 12px;
}

.fc-breakpoint-content.inheriting {
  opacity: 0.5;
  pointer-events: none;
}

.fc-breakpoint-content.inheriting::before {
  content: 'Inheriting from previous breakpoint';
  display: block;
  text-align: center;
  padding: 20px;
  color: var(--fc-text-muted);
  font-size: 12px;
  font-style: italic;
}

.fc-appearance-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: var(--fc-radius-sm);
  border: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-input);
  color: var(--fc-text-secondary);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-appearance-btn:hover {
  background: var(--fc-bg-input-hover);
  border-color: var(--fc-border-strong);
  color: var(--fc-text-primary);
}

.fc-appearance-btn.active {
  background: var(--fc-accent);
  border-color: var(--fc-accent);
  color: #fff;
}

.fc-appearance-btn svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.fc-appearance-btn:hover svg,
.fc-appearance-btn.active svg {
  opacity: 1;
}

/* -----------------------------------------------------------------
   Style Modals (Floating Panels)
------------------------------------------------------------------ */
.fc-style-modal {
  position: fixed;
  left: calc(var(--fc-sidebar-width) + 12px);
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  max-height: 80vh;
  background: var(--fc-bg-surface);
  border: 1px solid var(--fc-border-strong);
  border-radius: var(--fc-radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fc-modal-appear 0.15s ease-out;
}

/* When modal has been dragged, remove transform to use absolute positioning */
.fc-style-modal.is-dragged {
  transform: none;
  animation: none;
}

@keyframes fc-modal-appear {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

.fc-style-modal.open {
  display: flex;
}

.fc-style-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-surface-soft);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}

.fc-style-modal-header:active {
  cursor: grabbing;
}

.fc-style-modal-header span {
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-style-modal-header span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%236b7280'/%3E%3Ccircle cx='6' cy='2' r='1' fill='%236b7280'/%3E%3Ccircle cx='2' cy='6' r='1' fill='%236b7280'/%3E%3Ccircle cx='6' cy='6' r='1' fill='%236b7280'/%3E%3C/svg%3E") no-repeat center;
  opacity: 0.5;
}

.fc-style-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--fc-radius-sm);
  border: none;
  background: transparent;
  color: var(--fc-text-muted);
  cursor: pointer;
  transition: all var(--fc-transition);
}

.fc-style-modal-close:hover {
  background: var(--fc-elevation-02);
  color: var(--fc-text-primary);
}

.fc-style-modal-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  gap: 10px;
}

/* Ensure controls inside modals inherit proper spacing */
.fc-style-modal-body .fc-section-divider {
  margin: 4px 0;
}

.fc-style-modal-body .fc-section-label {
  font-size: 10px;
  margin-bottom: 4px;
}

.fc-style-modal-body .fc-slider-row.compact {
  margin-bottom: 0;
}

.fc-style-modal-body .field.compact {
  margin-bottom: 0;
}

.fc-style-modal-body .fc-inline-toggle {
  margin-bottom: 0;
}

.fc-style-modal-body .fc-color-field {
  margin-bottom: 0;
}

.fc-style-modal-body .hint {
  font-size: 11px;
  color: var(--fc-text-muted);
  margin-top: -4px;
}

/* Large modal variant for consolidated panels */
.fc-style-modal.fc-style-modal-large {
  width: 320px;
  max-height: 85vh;
}

/* Sharing modal */
.fc-style-modal.fc-sharing-modal {
  width: 420px;
  max-height: 90vh;
}

.fc-sharing-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 16px !important;
}

.fc-sharing-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fc-sharing-section {
  background: var(--fc-bg);
  border: 1px solid var(--fc-border);
  border-radius: 8px;
  padding: 12px;
}

.fc-sharing-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.fc-sharing-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.fc-sharing-row > * {
  flex: 1;
  min-width: 70px;
}

.fc-sharing-row .fc-color-field,
.fc-sharing-row .field.compact {
  margin: 0;
}

.fc-sharing-row input[type="number"] {
  width: 100%;
}

.fc-sharing-row + .fc-sharing-row {
  margin-top: 8px;
}

/* Preview column */
.fc-sharing-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-sharing-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fc-sharing-preview-header > span {
  font-size: 11px;
  font-weight: 600;
  color: var(--fc-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fc-btn-tiny {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--fc-text-secondary);
  background: var(--fc-bg);
  border: 1px solid var(--fc-border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-btn-tiny:hover {
  color: var(--fc-accent);
  border-color: var(--fc-accent);
  background: rgba(99, 102, 241, 0.1);
}

.fc-sharing-preview-hint {
  font-size: 10px;
  color: var(--fc-text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Logo upload UI */
.fc-logo-input-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.fc-logo-or {
  font-size: 10px;
  color: var(--fc-text-muted);
  padding-bottom: 8px;
}

.fc-logo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--fc-text-secondary);
  background: var(--fc-bg);
  border: 1px solid var(--fc-border);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fc-logo-upload-btn:hover {
  color: var(--fc-accent);
  border-color: var(--fc-accent);
  background: rgba(99, 102, 241, 0.1);
}

.fc-logo-upload-status {
  font-size: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.fc-logo-upload-status.uploading {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.fc-logo-upload-status.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.fc-logo-upload-status.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Opacity field with value display */
.fc-opacity-field span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-opacity-value {
  font-weight: 500;
  color: var(--fc-accent);
  font-size: 10px;
}

/* Style range inputs in sharing modal */
.fc-sharing-section input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--fc-border);
  border-radius: 3px;
  cursor: pointer;
}

.fc-sharing-section input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--fc-accent);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.fc-sharing-section input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.fc-sharing-section input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--fc-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* Modal Accordion Sections */
.fc-modal-accordion {
  border: 1px solid var(--fc-border-subtle);
  border-radius: var(--fc-radius-sm);
  background: var(--fc-bg-input);
  margin-bottom: 8px;
}

.fc-modal-accordion:last-child {
  margin-bottom: 0;
}

.fc-modal-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--fc-text-primary);
  user-select: none;
  list-style: none;
}

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

.fc-modal-accordion summary::after {
  content: "";
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.fc-modal-accordion[open] summary::after {
  transform: rotate(180deg);
}

.fc-modal-accordion summary:hover {
  background: var(--fc-bg-input-hover);
}

.fc-modal-accordion-content {
  padding: 0 12px 12px;
  display: grid;
  gap: 8px;
}

.fc-modal-accordion-content .fc-section-divider {
  margin: 4px 0;
}

.fc-modal-accordion-content .fc-section-label {
  margin-bottom: 2px;
}

/* Position picker inside modal */
.fc-style-modal-body .fc-position-picker {
  margin: 0;
  padding: 8px;
}

/* Light mode for style modals */
.fc-compiler.v3[data-theme="light"] .fc-style-modal {
  background: var(--fc-bg-surface);
  border-color: var(--fc-border-strong);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.fc-compiler.v3[data-theme="light"] .fc-style-modal-header {
  background: var(--fc-bg-surface-soft);
  border-color: var(--fc-border-subtle);
}

/* Responsive: Stack modals below sidebar on narrow screens */
@media (max-width: 900px) {
  .fc-style-modal {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 32px);
    max-width: 320px;
  }

  @keyframes fc-modal-appear {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
}

/* Modal backdrop (optional, for click-outside-to-close) */
.fc-style-modal-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 999;
  display: none;
}

.fc-style-modal-backdrop.open {
  display: block;
}

/* ============================================
   Edit Color Modal Styles
   ============================================ */

.fc-edit-color-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1100;
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.fc-edit-color-modal .fc-style-modal-body {
  max-height: calc(85vh - 120px);
  overflow-y: auto;
}

.fc-edit-color-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fc-border-subtle);
}

.fc-edit-color-preview {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 2px solid var(--fc-border-subtle);
  flex-shrink: 0;
}

.fc-edit-color-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Attributes List */
.fc-attributes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.fc-attribute-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fc-attribute-row input {
  flex: 1;
  padding: 8px 10px;
  background: var(--fc-bg-input);
  border: 1px solid var(--fc-border-subtle);
  border-radius: 6px;
  color: var(--fc-text-primary);
  font-size: 13px;
}

.fc-attribute-row input:first-child {
  max-width: 120px;
}

.fc-attribute-row input:focus {
  border-color: var(--fc-accent);
  outline: none;
}

.fc-attribute-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--fc-text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.fc-attribute-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.fc-add-attribute-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--fc-border-subtle);
  background: transparent;
  color: var(--fc-text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
}

.fc-add-attribute-btn:hover {
  border-color: var(--fc-accent);
  color: var(--fc-accent);
  background: rgba(79, 70, 229, 0.05);
}

/* Modal Footer */
.fc-style-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--fc-border-subtle);
  background: var(--fc-bg-elevated);
  border-radius: 0 0 12px 12px;
}

.fc-btn-ghost {
  padding: 8px 16px;
  border: 1px solid var(--fc-border-subtle);
  background: transparent;
  color: var(--fc-text-secondary);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-btn-ghost:hover {
  background: var(--fc-bg-input-hover);
  border-color: var(--fc-border-strong);
  color: var(--fc-text-primary);
}

.fc-btn-primary {
  padding: 8px 16px;
  border: none;
  background: var(--fc-accent);
  color: white;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-btn-primary:hover {
  background: var(--fc-accent-strong);
}

/* Price Badge Styles (for swatches) */
.spc_price-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 9px;
  border-radius: 3px;
  font-weight: 500;
}

.spc_out-of-stock {
  opacity: 0.4;
  pointer-events: none;
}

/* Total Price Display */
.spc_total-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 12px;
  font-size: 14px;
}

.spc_total-label {
  color: var(--spc-label-color, rgba(255, 255, 255, 0.7));
  font-weight: 500;
}

.spc_total-value {
  color: var(--spc-header-color, #fff);
  font-weight: 700;
  font-size: 16px;
}

/* Add to Cart Button */
.spc_add-to-cart {
  display: block;
  width: 100%;
  padding: 12px 20px;
  margin-top: 12px;
  background: var(--fc-accent, #4f46e5);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.spc_add-to-cart:hover {
  background: var(--fc-accent-strong, #4338ca);
  transform: translateY(-1px);
}

.spc_add-to-cart:active {
  transform: translateY(0);
}

/* =================================================================
   Help Tooltips - V6 Onboarding
   ================================================================= */

.fc-help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--fc-text-muted, #8a9199);
  cursor: help;
  margin-left: 4px;
  position: relative;
  vertical-align: middle;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.fc-help-tooltip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--fc-text, #e4e5e6);
}

.fc-help-tooltip:focus {
  outline: 2px solid var(--fc-accent, #5046e5);
  outline-offset: 2px;
}

.fc-tooltip-content {
  display: none;
  position: fixed;
  width: 240px;
  padding: 8px 12px;
  background: #1a1d24;
  border: 1px solid #3a3f4a;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #e0e0e0;
  z-index: 100001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  white-space: normal;
  text-align: left;
}

.fc-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1d24;
}

.fc-help-tooltip:hover .fc-tooltip-content,
.fc-help-tooltip:focus .fc-tooltip-content {
  display: block;
}

/* Light theme adjustments */
.fc-compiler[data-theme="light"] .fc-help-tooltip {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--fc-text-muted);
}

.fc-compiler[data-theme="light"] .fc-help-tooltip:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}

.fc-compiler[data-theme="light"] .fc-tooltip-content {
  background: #ffffff;
  border-color: #e0e0e0;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fc-compiler[data-theme="light"] .fc-tooltip-content::after {
  border-top-color: #ffffff;
}

/* =================================================================
   Tour Overlay - V6 Onboarding
   ================================================================= */

.fc-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: auto;
}

.fc-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.fc-tour-highlight {
  position: absolute;
  border: 2px solid var(--fc-accent, #5046e5);
  border-radius: 8px;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 100001;
}

.fc-tour-tooltip {
  position: absolute;
  width: 320px;
  background: var(--fc-bg-sidebar, #12151c);
  border: 1px solid var(--fc-border-strong, #2a2f3a);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 100002;
  pointer-events: auto;
}

.fc-tour-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--fc-text-muted, #8a9199);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-tour-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fc-text, #e4e5e6);
}

.fc-tour-content {
  margin-bottom: 16px;
}

.fc-tour-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fc-text-primary, #ffffff);
  margin: 0 0 8px 0;
}

.fc-tour-description {
  font-size: 13px;
  line-height: 1.5;
  color: var(--fc-text-secondary, #c0c4cc);
  margin: 0;
}

.fc-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fc-tour-prev,
.fc-tour-next {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.fc-tour-prev {
  background: transparent;
  color: var(--fc-text-muted, #8a9199);
}

.fc-tour-prev:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fc-text, #e4e5e6);
}

.fc-tour-next {
  background: var(--fc-accent, #5046e5);
  color: white;
}

.fc-tour-next:hover {
  background: var(--fc-accent-strong, #4338ca);
}

.fc-tour-progress {
  font-size: 12px;
  color: var(--fc-text-muted, #8a9199);
}

.fc-tour-replay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fc-text-muted, #8a9199);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-tour-replay:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--fc-text, #e4e5e6);
}

/* =================================================================
   Undo/Redo Buttons - V6
   ================================================================= */

.fc-undo-btn,
.fc-redo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 4px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fc-text-muted, #8a9199);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--fc-font-family);
}

.fc-undo-btn span,
.fc-redo-btn span {
  line-height: 1;
}

.fc-undo-btn:hover:not(:disabled),
.fc-redo-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--fc-text, #e4e5e6);
}

.fc-undo-btn:disabled,
.fc-redo-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fc-compiler[data-theme="light"] .fc-undo-btn,
.fc-compiler[data-theme="light"] .fc-redo-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--fc-text-muted);
}

.fc-compiler[data-theme="light"] .fc-undo-btn:hover:not(:disabled),
.fc-compiler[data-theme="light"] .fc-redo-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--fc-text);
}

/* Danger button style for Reset */
.fc-btn-danger {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.fc-btn-danger:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* =================================================================
   Help Tooltips - V5 Onboarding
   ================================================================= */

.fc-help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--fc-text-muted, #8a9199);
  cursor: help;
  margin-left: 4px;
  position: relative;
  vertical-align: middle;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.fc-help-tooltip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--fc-text, #e4e5e6);
}

.fc-help-tooltip:focus {
  outline: 2px solid var(--fc-accent, #5046e5);
  outline-offset: 2px;
}

.fc-tooltip-content {
  display: none;
  position: fixed;
  width: 240px;
  padding: 8px 12px;
  background: #1a1d24;
  border: 1px solid #3a3f4a;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #e0e0e0;
  z-index: 100001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  text-align: left;
  font-weight: 400;
  white-space: normal;
  pointer-events: none;
}

.fc-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1d24;
}

.fc-help-tooltip:hover .fc-tooltip-content,
.fc-help-tooltip:focus .fc-tooltip-content {
  display: block;
}

/* Tooltip positioning is handled by JavaScript for fixed positioning */

/* Light theme adjustments */
.fc-compiler[data-theme="light"] .fc-help-tooltip {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--fc-text-muted);
}

.fc-compiler[data-theme="light"] .fc-help-tooltip:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
}

.fc-compiler[data-theme="light"] .fc-tooltip-content {
  background: #ffffff;
  border-color: #e0e0e0;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fc-compiler[data-theme="light"] .fc-tooltip-content::after {
  border-top-color: #ffffff;
}

/* =================================================================
   Tour Overlay - V5 Onboarding
   ================================================================= */

.fc-tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: auto;
}

.fc-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.fc-tour-highlight {
  position: absolute;
  border: 2px solid var(--fc-accent, #5046e5);
  border-radius: 8px;
  box-shadow: 
    0 0 0 4px rgba(80, 70, 229, 0.3),
    0 0 20px rgba(80, 70, 229, 0.4);
  background: transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 100001;
}

.fc-tour-tooltip {
  position: absolute;
  z-index: 100002;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fc-tour-content {
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 0;
  width: fit-content;
  max-width: calc(100vw - 32px);
  box-shadow: none;
}

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

.fc-tour-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.fc-tour-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: #8a9199;
  cursor: pointer;
  margin: -4px -4px 0 0;
  transition: all 0.15s ease;
}

.fc-tour-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.fc-tour-content p {
  margin: 0 0 20px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #b0b5bb;
}

.fc-tour-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.fc-tour-actions .fc-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #b0b5bb;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-tour-actions .fc-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.fc-tour-actions .fc-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  border-radius: 6px;
  background: var(--fc-accent, #5046e5);
  border: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-tour-actions .fc-btn-primary:hover {
  background: var(--fc-accent-strong, #4338ca);
}

.fc-tour-progress {
  text-align: center;
  margin-top: 0;
  padding-top: 8px;
  height: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 1);
}

.fc-tour-progress span {
  font-weight: 500;
}

/* Tour tooltip arrow positions */
.fc-tour-tooltip[data-position="bottom"]::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: #1a1d24;
}

.fc-tour-tooltip[data-position="top"]::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #1a1d24;
}

.fc-tour-tooltip[data-position="left"]::before {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: #1a1d24;
}

.fc-tour-tooltip[data-position="right"]::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: #1a1d24;
}

/* Replay Tour Button */
.fc-tour-replay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--fc-text-muted, #8a9199);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fc-tour-replay:hover {
  background: rgba(80, 70, 229, 0.2);
  border-color: rgba(80, 70, 229, 0.4);
  color: var(--fc-accent, #5046e5);
}

.fc-compiler[data-theme="light"] .fc-tour-replay {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.fc-compiler[data-theme="light"] .fc-tour-replay:hover {
  background: rgba(80, 70, 229, 0.1);
  border-color: rgba(80, 70, 229, 0.3);
}

/* =================================================================
   Undo/Redo Buttons - V5
   ================================================================= */

.fc-undo-btn,
.fc-redo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 4px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fc-text-muted, #8a9199);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--fc-font-family);
}

.fc-undo-btn span,
.fc-redo-btn span {
  line-height: 1;
}

.fc-undo-btn:hover:not(:disabled),
.fc-redo-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--fc-text, #e4e5e6);
}

.fc-undo-btn:disabled,
.fc-redo-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fc-compiler[data-theme="light"] .fc-undo-btn,
.fc-compiler[data-theme="light"] .fc-redo-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--fc-text-muted);
}

.fc-compiler[data-theme="light"] .fc-undo-btn:hover:not(:disabled),
.fc-compiler[data-theme="light"] .fc-redo-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--fc-text);
}

