/* === DESIGN SYSTEM === */
:root {
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* UNIFIED PREMIUM SHADOW SYSTEM */
  --shadow-primary: 0px 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-secondary: 0px 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.02), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0px 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0px 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.08), 0 8px 20px rgba(15, 23, 42, 0.05);
  
  --border-subtle: 1px solid rgba(15, 23, 42, 0.06);
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-subtle: #f8f9ff;
  --primary-muted: #7b7dd0;
  --primary-muted-dark: #6b68c4;
  --success: #10b981;
  --warning: #fef3c7;
  --warning-text: #78350f;
  --danger: #ef4444;
  --danger-subtle: #fee2e2;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --header-height: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  background-color: #fafbfc;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.015) 0%, transparent 50%),
    radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(148, 163, 184, 0.02) 0%, transparent 50%),
    repeating-linear-gradient(60deg, transparent, transparent 60px, rgba(148, 163, 184, 0.05) 60px, rgba(148, 163, 184, 0.05) 61px),
    repeating-linear-gradient(120deg, transparent, transparent 60px, rgba(148, 163, 184, 0.05) 60px, rgba(148, 163, 184, 0.05) 61px),
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(148, 163, 184, 0.05) 60px, rgba(148, 163, 184, 0.05) 61px),
    linear-gradient(135deg, #fafbfc 0%, #f4f6f8 50%, #fafbfc 100%);
  background-attachment: fixed;
  min-height: 100vh;
  letter-spacing: -0.01em;
}
.container { max-width: 1280px; margin: 0 auto; padding: 32px 24px; }
.header { margin-bottom: var(--spacing-md); }
.title { 
  font-size: 1.9rem; 
  font-weight: 700; 
  color: var(--text-primary); 
  margin-bottom: var(--spacing-xs); 
  letter-spacing: -0.03em;
}
.subtitle { color: var(--text-secondary); font-size: 0.9375rem; }

/* Top navigation bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  min-height: var(--header-height);
}
.app-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  min-width: 220px;
}
.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.25);
  display: grid;
  place-items: center;
  color: white;
}
.brand-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-divider {
  color: var(--text-tertiary);
  font-weight: 600;
}
.brand-context {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
}
.header-progress {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.header-actions .btn {
  height: 36px;
}
@media (max-width: 960px) {
  .app-header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions {
    flex-wrap: wrap;
  }
  .header-progress {
    justify-content: flex-start;
  }
}

/* PRIMARY PANELS - Main content areas */
.card { 
  background: var(--bg-primary); 
  border-radius: var(--radius-lg); 
  box-shadow: var(--shadow-primary);
  padding: var(--spacing-xl);
  border: none;
}
#landing-view .card { 
  border: 2px dashed rgba(99, 102, 241, 0.15); 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, #fafbff 0%, #f8fafc 100%);
}
.upload-area { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
  padding: 4rem 2rem; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.upload-area.drag-over { 
  background: var(--primary-subtle);
  border-color: var(--primary); 
  transform: scale(1.01);
}
.upload-icon { 
  width: 112px; 
  height: 112px; 
  background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%); 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(99, 102, 241, 0.08);
  border: 4px solid rgba(255, 255, 255, 0.9);
}
.upload-icon svg { width: 56px; height: 56px; color: var(--primary); }
.upload-title { 
  font-size: 1.5rem; 
  font-weight: 600; 
  color: var(--text-primary); 
  margin-bottom: var(--spacing-xs);
  letter-spacing: -0.02em;
}
.upload-subtitle { 
  font-size: 0.9375rem; 
  color: var(--text-secondary);
  font-weight: 500;
}
.editor-screen { display: grid; grid-template-columns: 1fr 400px; gap: 24px; width: 100%; align-items: start; }
.editor-left { min-width: 0; min-height: 0; padding: 0; background-color: transparent; display: flex; flex-direction: column; height: auto; width: 100%; }
.editor-left-inner { max-width: none; width: 100%; margin: 0; height: auto; min-height: min-content; display: flex; flex-direction: column; flex: 1 0 auto; }
.editor-right { 
  width: 400px; 
  min-width: 400px; 
  background: transparent; 
  border-left: none; 
  box-shadow: none; 
  border-radius: 0; 
  margin: 0; 
  height: fit-content; 
  max-height: calc(100vh - var(--header-height) - 24px);
  position: sticky;
  top: calc(var(--header-height) + 8px);
  overflow-y: auto;
  padding: 0; 
  display: flex; 
  flex-direction: column; 
  gap: 1rem; 
}
.editor-right::-webkit-scrollbar { display: none; }
.editor-right { scrollbar-width: none; }
@media (max-width: 1200px) { .editor-screen { grid-template-columns: 1fr; } .editor-right { max-width: none; min-width: 0; } }
@media (max-width: 1024px) { .editor-screen { grid-template-columns: 1fr; } .editor-left { padding: 0; } .editor-right { width: 100%; min-width: auto; border-left: none; box-shadow: none; } }
.sidebar-panel { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.p-6 { padding: 1.5rem; }
/* === UNIFIED BUTTON SYSTEM === */
.btn { 
  padding: 0.625rem 1.125rem; 
  font-size: 0.875rem; 
  line-height: 1.25rem;
  height: 38px;
  border-radius: var(--radius-sm); 
  border: none; 
  cursor: pointer; 
  font-weight: 600; 
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:hover:not(:disabled) { 
  transform: translateY(-1px); 
  box-shadow: var(--shadow-md);
}
.btn:active:not(:disabled) { 
  transform: translateY(0); 
  box-shadow: var(--shadow-sm);
}
.btn-icon {
  width: 38px;
  padding: 0.5rem;
  gap: 0;
  align-items: center;
  justify-content: center;
}
.btn-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Primary - Bold action (full saturation) */
.btn-primary { 
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
  color: white;
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.08), 0 3px 8px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.06);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.18), 0 4px 12px rgba(99, 102, 241, 0.15), 0 0 0 2px rgba(99, 102, 241, 0.12);
}

/* Primary Muted - For snippet card Download buttons only (opacity-based) */
.btn-primary-muted {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
  color: white;
  opacity: 0.75;
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.08), 0 3px 8px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(99, 102, 241, 0.06);
  border: none;
}
.btn-primary-muted:hover:not(:disabled) {
  opacity: 1;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.18), 0 4px 12px rgba(99, 102, 241, 0.15), 0 0 0 2px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}
.btn-primary-muted:active:not(:disabled) {
  opacity: 0.75;
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(99, 102, 241, 0.08), 0 3px 8px rgba(99, 102, 241, 0.12);
}

/* Secondary - Outline style */
.btn-blue { 
  background: white;
  color: var(--primary);
  border: 1.5px solid rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-sm);
}
.btn-blue:hover:not(:disabled) {
  background: var(--primary-subtle);
  border-color: var(--primary);
}

/* Tertiary - Subtle */
.btn-light-blue { 
  background: var(--primary-subtle);
  color: var(--primary-dark); 
  border: 1px solid rgba(99, 102, 241, 0.15);
  box-shadow: none;
}
.btn-light-blue:hover:not(:disabled) { 
  background: rgba(99, 102, 241, 0.12); 
  border-color: rgba(99, 102, 241, 0.25);
}

/* Success */
.btn-green { 
  background: linear-gradient(135deg, #10b981 0%, #059669 100%); 
  color: white;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12), 0 6px 16px rgba(16, 185, 129, 0.15);
}
.btn-green:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25), 0 8px 24px rgba(16, 185, 129, 0.18);
}

/* Warning */
.btn-amber { 
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); 
  color: white;
  box-shadow: 0 1px 3px rgba(251, 191, 36, 0.12), 0 6px 16px rgba(251, 191, 36, 0.15);
}
.btn-amber:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25), 0 8px 24px rgba(251, 191, 36, 0.18);
}

/* Danger - Outline style (desaturated) */
.btn-red { 
  background: white; 
  color: var(--danger);
  border: 1.5px solid rgba(239, 68, 68, 0.3);
  box-shadow: var(--shadow-sm);
}
.btn-red:hover:not(:disabled) {
  background: var(--danger-subtle);
  border-color: var(--danger);
  box-shadow: var(--shadow-md);
}

/* Danger Outline - Ghost button for card actions (softened) */
.btn-red-outline { 
  background: transparent;
  color: #dc2626; 
  border: 1px solid #f4b4bb;
  box-shadow: none;
  opacity: 0.85;
  padding: 0.375rem 0.75rem;
}
.btn-red-outline:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
  opacity: 1;
}

/* Ghost - Minimal */
.btn-gray { 
  background: var(--bg-secondary);
  color: var(--text-secondary); 
  border: var(--border-subtle);
  box-shadow: none;
}
.btn-gray:hover:not(:disabled) { 
  background: var(--bg-tertiary);
  border-color: rgba(15, 23, 42, 0.1);
}

.btn-white { 
  background: white; 
  color: var(--text-secondary); 
  border: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.btn-white:hover:not(:disabled) { 
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
}

.btn-sm svg {
  transition: transform 0.2s ease;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}
.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-sm { 
  padding: 0.375rem 0.875rem; 
  font-size: 0.8125rem; 
  height: 32px;
}
.section-title { 
  font-size: 1.25rem; 
  font-weight: 700; 
  color: var(--text-primary); 
  letter-spacing: -0.02em;
}
.text-sm { font-size: 0.875rem; color: var(--text-secondary); }
.text-xs { font-size: 0.75rem; }
.text-gray-500 { color: var(--text-secondary); }
.text-gray-400 { color: var(--text-tertiary); }
.canvas-container { 
  border: var(--border-subtle); 
  border-radius: var(--radius-md); 
  overflow: visible; 
  background: var(--bg-secondary); 
  cursor: default; 
  transition: opacity 0.2s; 
  display: flex; 
  justify-content: center; 
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  width: 100%;
  min-height: 420px;
}
#canvas-wrapper { 
  flex: 1 0 auto; 
  width: 100% !important; 
  min-height: 420px; 
  height: auto;
  margin-bottom: 1.5rem; 
  display: flex; 
  justify-content: center; 
  align-items: center;
}
.canvas-viewport {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: 100%;
  overflow: visible;
  user-select: none;
}
.canvas-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.overlay-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.guide-layer { 
  pointer-events: auto; 
  z-index: 2;
  cursor: crosshair;
}
.guide-layer.interactive { pointer-events: auto; }
.guide-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed transparent;
  pointer-events: none;
}
.guide-line.snap-line {
  border-top-color: #ec4899;
  opacity: 0.7;
}
.guide-line.detected-line {
  border-top: 3px dashed #10b981;
  cursor: pointer;
  pointer-events: auto;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.02));
}
.guide-label {
  position: absolute;
  left: 12px;
  top: -14px;
  background: #10b981;
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.guide-instructions {
  position: absolute;
  top: 12px;
  left: 16px;
  background: rgba(16, 185, 129, 0.12);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.footer-overlay {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.55);
  border-top: 3px dashed #7c3aed;
  color: #f8fafc;
  display: flex;
  align-items: flex-start;
  padding: 10px 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.footer-overlay .footer-label {
  background: #5b21b6;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
}
.snippet-layer { 
  pointer-events: auto; 
  z-index: 3;
  cursor: crosshair;
}
.snippet-box { 
  position: absolute; 
  border: 3px solid #3B82F6; 
  background: transparent; 
  border-radius: 10px; 
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.08); 
  pointer-events: auto;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.3s ease;
  will-change: top, height;
}
.snippet-box.excluded {
  border-color: #64748b;
  background: rgba(15, 23, 42, 0.5);
  opacity: 0.4;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
}
.snippet-label {
  position: absolute;
  top: 10px;
  left: 12px;
  background: #3B82F6;
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  transition: background 0.3s ease;
}
.snippet-box.excluded .snippet-label {
  background: #64748b;
  opacity: 0.7;
}
.snippet-delete-btn {
  position: absolute;
  top: 50%;
  right: -36px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.95);
  color: #c2410c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
}
.snippet-box:hover .snippet-delete-btn {
  opacity: 1;
}
.snippet-delete-btn:hover {
  transform: translateY(-1px);
  border-color: #fca5a5;
  background: #fff1f2;
}
.resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}
.resize-handle::before {
  content: '';
  width: 36px;
  height: 4px;
  background: white;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  opacity: 0.9;
}
.resize-handle.handle-top { top: -10px; }
.resize-handle.handle-bottom { bottom: -10px; }
.footer-handle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.footer-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed 0%, #a855f7 100%);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.2);
  pointer-events: none;
}
.footer-handle {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #7c3aed;
  color: white;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.18);
  cursor: ns-resize;
  pointer-events: auto;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.footer-handle.snapped {
  background: #22c55e;
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}
.footer-handle-notch {
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
}
.snippet-list { max-height: 600px; overflow-y: auto; }
.snippet-card { 
  border: 1px solid #e1e6ef; 
  border-radius: 16px; 
  padding: 12px 24px; 
  transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1); 
  margin-bottom: 8px;
  background: #fbfdff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}
.snippet-card:hover { 
  border-color: #d2d9e6; 
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.snippet-card.snippet-card-active {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.08);
  background: #f7f8ff;
}
.snippet-card.excluded {
  background: #f8f9fa;
  border-color: #e1e6ef;
  opacity: 0.6;
}
.snippet-card.excluded .snippet-title {
  color: #94a3b8;
}
.snippet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.snippet-title {
  font-weight: 700;
  color: #334155;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.snippet-subtitle { display: none; }
.snippet-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.snippet-size-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
  font-size: 0.78rem;
  min-width: 68px;
  text-align: center;
}
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #c53030;
  padding: 0;
}
.icon-btn:hover {
  background: #fef2f2;
  border-color: #fecdd3;
  color: #b91c1c;
  transform: translateY(-1px);
}
.icon-btn-primary {
  color: var(--primary);
}
.icon-btn-primary:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.icon-btn.toggle-exclude {
  color: #475569;
}
.icon-btn.toggle-exclude:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}
.icon-btn.toggle-exclude.excluded {
  color: #ef4444;
  background: #fef2f2;
  border-color: #fecaca;
}
.icon-btn.toggle-exclude.excluded:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}
.split-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.split-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 6px;
}
.split-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.2s ease;
  display: inline-flex;
  align-items: center;
}
.split-arrow.expanded { transform: rotate(180deg); }
.split-options { display: none; }
.tab-btn { border: none; }
.tab-btn.active { background: white; color: var(--text-primary); box-shadow: var(--shadow-sm); }
.tab-btn:not(.active) { background: transparent; color: var(--text-secondary); }
.split-pill-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  background: #f6f8fb;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 3px 4px;
}
.split-pill {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  border-radius: 12px;
  padding: 8px 0;
  height: 34px;
  font-weight: 600;
  font-size: 0.90rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: none;
}
.split-pill:hover {
  color: #4f46e5;
}
.split-pill.active {
  background: white;
  border-color: rgba(99, 102, 241, 0.3);
  color: #3162f0;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.12);
}
.snippet-download-btn {
  width: 100%;
  height: 40px;
  margin-top: 4px;
  border-radius: 12px;
  background: white;
  border: 1.5px solid #d7dde8;
  color: #334155;
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.snippet-download-btn:hover {
  border-color: rgba(99, 102, 241, 0.45);
  color: #4f46e5;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.12);
  transform: translateY(-1px);
}
.group-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.group-chip {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.8rem;
}
.child-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.snippet-child-card {
  background: #ffffff;
}
.info-box { 
  background: var(--primary-subtle);
  border-radius: var(--radius-md); 
  padding: var(--spacing-lg);
  border: none;
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
.info-button { 
  background: transparent; 
  border: none; 
  width: 24px; 
  height: 24px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
  color: var(--text-tertiary); 
  transition: all 0.2s; 
  padding: 0; 
}
.info-button:hover { color: var(--primary); transform: scale(1.1); }
.info-button-small { 
  background: transparent; 
  border: none; 
  width: 18px; 
  height: 18px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer; 
  transition: all 0.2s; 
  padding: 0; 
}
.info-button { color: var(--primary); }
.info-button:hover { color: var(--primary-dark); transform: scale(1.15); }
.info-popup { 
  position: absolute; 
  left: 0; 
  top: 100%; 
  margin-top: var(--spacing-xs); 
  background: var(--primary-subtle);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-md); 
  padding: var(--spacing-md); 
  box-shadow: var(--shadow-secondary); 
  z-index: 100; 
  min-width: 280px; 
  max-width: 320px; 
  animation: popupSlide 0.2s ease-out; 
}
@keyframes popupSlide { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.info-panel { 
  background: var(--primary-subtle);
  border-radius: var(--radius-md); 
  padding: var(--spacing-lg); 
  margin-bottom: var(--spacing-lg); 
  animation: slideDown 0.3s ease-out;
  border: none;
  border-left: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
@keyframes slideDown { from { opacity: 0; max-height: 0; padding: 0 var(--spacing-lg); } to { opacity: 1; max-height: 500px; padding: var(--spacing-lg); } }
@keyframes slideInNotif { from { opacity: 0; transform: translateX(100px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOutNotif { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100px); } }
@keyframes spinning { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spinning { animation: spinning 1s linear infinite; }
.disabled-group { opacity: 0.5; pointer-events: none; filter: grayscale(1); transition: opacity 0.3s; }
.pulse-highlight { animation: pulse-purple 1s ease; }
@keyframes pulse-purple { 
  0% { transform: scale(1); background: var(--primary); }
  50% { transform: scale(1.1); background: var(--primary-light); }
  100% { transform: scale(1); background: var(--primary); }
}
@keyframes btn-pulse-loop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
.attention-grabber { animation: btn-pulse-loop 2s infinite; border-color: var(--primary); color: var(--primary); }
.handle-attention {
  background-color: #818cf8 !important;
  border: 2px solid white !important;
  z-index: 50 !important;
}
.handle-attention::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.7);
  animation: pulse-ring-only 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
  z-index: -1;
  pointer-events: none;
}
@keyframes pulse-ring-only {
  0% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.7); }
  70% { box-shadow: 0 0 0 20px rgba(129, 140, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); }
}

.info-title { 
  font-weight: 600; 
  color: var(--primary-dark); 
  font-size: 0.9375rem; 
  margin-bottom: var(--spacing-md);
  letter-spacing: -0.01em;
}
.info-list { font-size: 0.8125rem; color: var(--primary); list-style: none; }
.info-list li { margin-bottom: 0.25rem; }
.empty-state { 
  text-align: center; 
  padding: 4rem 1.5rem;
}
.empty-icon { 
  width: 88px; 
  height: 88px; 
  background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%); 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin: 0 auto var(--spacing-lg);
  border: 1px solid rgba(99, 102, 241, 0.08);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.1), 0 2px 8px rgba(99, 102, 241, 0.06);
}
.empty-icon svg { 
  width: 44px; 
  height: 44px; 
  color: var(--primary); 
}
input[type="file"] { display: none; }
.hidden { display: none; }
#landing-view { display: block; }
#editor-screen { display: none; }
.footer-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 1200px) {
  .footer-split-grid {
    grid-template-columns: 1fr;
  }
}
.exclusion-controls { 
  background: var(--primary-subtle);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-md); 
  padding: var(--spacing-lg); 
  box-shadow: var(--shadow-secondary);
  position: relative;
}
.exclusion-title { 
  font-weight: 600; 
  color: var(--text-primary); 
  margin-bottom: var(--spacing-md); 
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}
.input-group { display: flex; gap: var(--spacing-xs); align-items: center; flex-wrap: wrap; }
.input-group input { 
  padding: 0.625rem; 
  border: var(--border-subtle); 
  border-radius: var(--radius-sm); 
  width: 100px; 
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s;
}
.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.input-group label { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }

.slider-container { display: flex; flex-direction: column; gap: 0.5rem; }
.slider-container input[type="range"] { width: 100%; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.panel-meta { display: flex; align-items: center; gap: 10px; }
.panel-body { margin-top: 0.75rem; }
.panel-chevron { width: 18px; height: 18px; color: var(--text-tertiary); transition: transform 0.2s ease, color 0.2s ease; }
.panel-pill { background: white; border: 1px solid rgba(15, 23, 42, 0.08); color: var(--text-secondary); font-size: 0.75rem; padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.panel-collapsed { padding-bottom: 1rem; }
.panel-collapsed .panel-body { display: none; }
.panel-collapsed .panel-chevron { transform: rotate(0deg); color: var(--text-tertiary); opacity: 0.7; }
.panel-collapsed .panel-header { opacity: 0.65; }
#export-settings .input-group,
#export-settings .input-group input,
#export-settings .input-group label,
#export-settings .input-group span,
#export-settings .quality-label {
  font-size: 13px;
}
#export-settings .input-group input {
  height: 32px;
  line-height: 1.4;
}
.panel-activated .panel-meta { display: none; }
.panel-preupload { background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.05)); border: 1px solid rgba(99, 102, 241, 0.16); box-shadow: inset 0 1px 3px rgba(99, 102, 241, 0.1); padding: 12px 16px !important; }
.panel-preupload .panel-header { color: var(--text-secondary); }
.panel-preupload .panel-header svg { color: var(--text-secondary); }
.panel-preupload .panel-meta { display: flex; }
.panel-preupload .info-button-small { display: none; }
.inactive-block { position: relative; opacity: 0.55; pointer-events: none; filter: grayscale(0.1); }
.inactive-overlay { 
  position: absolute; 
  inset: 0; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.8));
  color: var(--text-secondary); 
  font-weight: 600; 
  font-size: 0.875rem; 
  text-align: center; 
  padding: 1rem; 
  border-radius: inherit;
}
.inactive-block .inactive-overlay { display: flex; }
.snippets-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 24px 24px 18px;
  background: var(--bg-primary);
  box-shadow: var(--shadow-primary);
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: var(--radius-lg);
}
.canvas-empty-state {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.25rem;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.03), rgba(148, 163, 184, 0.05));
  border: 1.5px dashed rgba(99, 102, 241, 0.2);
  border-radius: inherit;
  text-align: center;
}
.canvas-empty-state .upload-area { width: min(520px, 88%); padding: 4rem 3rem; background: white; border-radius: 14px; border: 1px solid rgba(99, 102, 241, 0.15); box-shadow: var(--shadow-lg); }
.canvas-empty-state .upload-icon { width: 88px; height: 88px; box-shadow: 0 10px 26px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(99, 102, 241, 0.08); }
.canvas-empty-state .upload-title { font-size: 1.35rem; }
.canvas-empty-state .upload-subtitle { color: var(--text-secondary); }

/* Compact Workflow Stepper */
.progress-dots { 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  gap: 2rem;
  position: relative;
}

.progress-step { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
  font-size: 0.8125rem; 
  color: var(--text-tertiary); 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  position: relative;
  white-space: nowrap;
}
.progress-step.active { color: var(--primary); font-weight: 600; }
.progress-step.complete { color: var(--text-secondary); }
.progress-dot { 
  width: 32px; 
  height: 32px; 
  border-radius: 50%; 
  background: #ffffff;
  border: 2px solid #e2e8f0;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-weight: 600; 
  font-size: 0.75rem; 
  color: #94a3b8;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  flex-shrink: 0;
}
.progress-step.active .progress-dot { 
  background: var(--primary); 
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  transform: scale(1.08);
}
.progress-step.complete .progress-dot { 
  background: #10b981; 
  color: white;
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}
.app-header .progress-dots {
  gap: 1rem;
}
.app-header .progress-dots::before {
  content: '';
  position: absolute;
  left: 32px;
  right: 32px;
  height: 1px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.14));
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}
.app-header .progress-step {
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.app-header .progress-dot {
  width: 28px;
  height: 28px;
}

/* Clickable progress-footer step */
#progress-footer.clickable {
  cursor: pointer;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#progress-footer.clickable:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
#progress-footer.clickable:active {
  transform: translateY(0);
}
#progress-footer.attention-grabber {
  animation: btn-pulse-loop 2s infinite;
}

.zoom-controls { display: flex; gap: var(--spacing-xs); align-items: center; margin-bottom: var(--spacing-lg); justify-content: center; }
.zoom-btn { 
  width: 36px; 
  height: 36px; 
  border-radius: var(--radius-sm); 
  border: var(--border-subtle); 
  background: var(--bg-primary); 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-weight: 600; 
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
}
.zoom-btn:hover:not(:disabled) { 
  background: var(--bg-secondary); 
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--primary);
}
.zoom-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.zoom-level { 
  font-size: 0.875rem; 
  color: var(--text-secondary); 
  min-width: 60px; 
  text-align: center; 
  font-weight: 600;
}

.snap-toggle-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-left: var(--spacing-md);
  padding-left: var(--spacing-md);
  border-left: 1px solid var(--border-color);
}

.snap-toggle-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.snap-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background-color: #e2e8f0;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.snap-toggle:hover {
  background-color: #cbd5e1;
}

.snap-toggle.active {
  background-color: #dbeafe;
  border-color: #93c5fd;
}

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

.snap-toggle.active::after {
  transform: translateX(22px);
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}
.quality-label { 
  font-size: 0.875rem; 
  color: var(--primary); 
  display: flex; 
  justify-content: space-between;
  font-weight: 600;
}
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-lg); margin-bottom: var(--spacing-lg); }
@media (max-width: 768px) { .controls-grid { grid-template-columns: 1fr; } }
/* Segmented Control for Radio Buttons */
.segmented-control {
  display: flex;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
  width: 100%;
  position: relative;
  border: 1px solid #e2e8f0;
}

.segmented-control label {
  flex: 1;
  text-align: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
  margin: 0;
}

.segmented-control input[type="radio"] {
  display: none;
}

.segmented-control span {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segmented-control input[type="radio"]:checked + span {
  background-color: white;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.segmented-control label:hover span:not(.active) {
  color: var(--text-primary);
}

/* --- LANDING PAGE STYLES --- */
.hero-section {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - var(--header-height));
  padding: clamp(56px, 8vh, 96px) 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
}

.hero-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0) 65%);
  filter: blur(100px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
  animation: pulse-glow 12s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { opacity: 0.65; transform: translate(-50%, -50%) scale(0.95); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

.hero-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1.06fr;
  gap: 52px;
  align-items: center;
}

.hero-left {
  max-width: 640px;
}

.hero-title {
  font-size: clamp(2.25rem, 3.4vw, 3.25rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.05;
  max-width: 18ch;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  max-width: 58ch;
  line-height: 1.6;
}

.hero-compat {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}

.hero-compat-label {
  color: var(--text-tertiary);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
}

.hero-compat-items {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
}

.hero-compat-dot {
  color: var(--text-tertiary);
  font-weight: 800;
}

.hero-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.hero-upload {
  width: 100%;
  background: white;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
  border-radius: 18px;
}

.hero-upload.upload-area {
  padding: 4.5rem 2.5rem;
}

.hero-upload .upload-icon {
  width: 124px;
  height: 124px;
}

.hero-upload .upload-icon svg {
  width: 60px;
  height: 60px;
}

.hero-upload:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.10), 0 10px 24px rgba(15, 23, 42, 0.06);
  border-color: rgba(99, 102, 241, 0.22);
}

.hero-upload:active {
  transform: translateY(-2px);
}

.hero-upload-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 0.875rem;
}

.hero-upload-sep {
  opacity: 0.7;
}

.scroll-hint {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 0.875rem;
  animation: bounce 2s infinite;
  text-decoration: none;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border-radius: 12px;
  padding: 10px 12px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.scroll-hint:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-secondary);
  transform: translateY(-1px);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.landing-section-header {
  margin: 0 auto 28px;
  max-width: 920px;
  text-align: center;
}

.landing-section-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.landing-section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.features-section {
  background: transparent;
  padding: 64px 0 72px;
  border-top: none;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  backdrop-filter: blur(6px);
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  border-color: rgba(99, 102, 241, 0.22);
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.06) 100%);
  color: var(--primary-dark);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(99, 102, 241, 0.16);
}

.workflow-section {
  padding: 80px 0;
  background: radial-gradient(circle at 10% 0%, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0) 55%),
              radial-gradient(circle at 90% 70%, rgba(148, 163, 184, 0.10) 0%, rgba(148, 163, 184, 0) 55%);
  border-top: none;
  border-radius: 24px;
}

.workflow-content {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px;
  align-items: center;
}

.workflow-text h2 {
  font-size: 2.1rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.workflow-text p {
  margin-bottom: 2rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.workflow-list li {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

.workflow-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 800;
}

.workflow-image {
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.03);
  background: white;
  transform: perspective(1000px) rotateY(-2deg);
  transition: transform 0.3s ease;
}

.workflow-image:hover {
  transform: perspective(1000px) rotateY(0deg);
}

.cta-section {
  padding: 86px 0 52px;
  background: transparent;
}

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.92) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.cta-copy h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.cta-copy p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1.05rem;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.cta-actions .btn,
.cta-actions label.btn {
  height: 46px;
  font-size: 0.95rem;
  padding: 0 20px;
}

.cta-btn {
  border-radius: 999px;
  padding-left: 22px;
  padding-right: 22px;
}

.cta-secondary {
  border-radius: 999px;
}

.faq-section {
  padding: 56px 0 96px;
  background: transparent;
}

.faq-grid {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s ease;
}

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

.faq-item summary::after {
  content: "＋";
  color: var(--text-tertiary);
  font-weight: 900;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "－";
}

.faq-item summary:hover {
  background: rgba(248, 250, 252, 0.9);
}

.faq-content {
  padding: 0 16px 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.95rem;
}

.faq-content p strong {
  color: var(--text-primary);
}

/* Focus-visible: keep interactions keyboard-friendly */
.upload-area:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.hero-upload:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18), var(--shadow-xl);
}

.scroll-hint:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-secondary);
}

.faq-item summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px rgba(99, 102, 241, 0.22);
  background: rgba(248, 250, 252, 0.9);
}

@media (prefers-reduced-motion: reduce) {
  .hero-glow,
  .scroll-hint {
    animation: none !important;
  }
  .hero-upload,
  .feature-card,
  .workflow-image,
  .scroll-hint {
    transition: none !important;
  }
  .hero-upload:hover,
  .feature-card:hover,
  .scroll-hint:hover,
  .workflow-image:hover {
    transform: none !important;
  }
}

@media (max-width: 960px) {
  .hero-section {
    text-align: center;
    padding-top: 56px;
  }
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hero-left {
    max-width: none;
  }
  .hero-title {
    max-width: none;
  }
  .hero-compat {
    justify-content: center;
  }
  .workflow-content {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .cta-card {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .cta-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

/* --- FOOTER / DOCK STYLES --- */
.site-footer {
  padding: 1.5rem 0;
  background: white;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.875rem;
  z-index: 100;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  padding-top: 0;
  padding-bottom: 0;
}
.footer-left a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}
.footer-left a:hover { color: var(--primary); }
.sep { margin: 0 8px; color: var(--text-tertiary); }

/* --- EDITOR MODE STYLES --- */
body.editor-mode #landing-view {
  display: none !important;
}
body.editor-mode #editor-screen {
  display: grid; 
  height: auto;
  min-height: 100vh;
  overflow: visible;
  padding-bottom: 0;
}

/* Make the left side (Canvas) grow naturally */
body.editor-mode .editor-left {
  height: auto;
  overflow: visible;
  padding-right: 0;
  scroll-behavior: auto;
}

/* Make the right side (Settings) sticky */
body.editor-mode .editor-right {
  position: sticky;
  top: 80px; /* Header height + padding */
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 4px;
  height: fit-content;
}

body.editor-mode .site-footer {
  position: relative;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: white;
  padding: 24px 0;
  margin-top: 0;
  width: 100%;
}

/* --- HISTORY MODAL STYLES --- */
.history-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
  position: relative;
}
.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}
.history-item .history-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.15s ease;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.history-item:hover .history-delete-btn {
  opacity: 1;
  transform: scale(1);
}
.history-item .history-delete-btn:hover {
  background: #fef2f2;
  border-color: #fecaca;
}
.history-item .history-delete-btn:hover svg {
  color: #dc2626;
}
.history-item .history-delete-btn svg {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  transition: color 0.15s ease;
}
.history-thumb {
  height: 120px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.history-meta {
  padding: 12px;
}
.history-name {
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-date {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 4px;
}

