:root {
    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --primary-light: rgba(139, 92, 246, 0.12);
    --accent: #06b6d4;
    --accent-hover: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --bg-app: #0c0a1d;
    --bg-sidebar: #110e24;
    --bg-toolbar: #13102a;
    --bg-panel: #0f0c20;
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-input-hover: rgba(255, 255, 255, 0.08);
    --bg-canvas: #080612;
    --bg-elevated: #1a1635;
    --text-primary: #f4f4f5;
    --text-secondary: rgba(244, 244, 245, 0.7);
    --text-muted: rgba(244, 244, 245, 0.4);
    --text-disabled: rgba(244, 244, 245, 0.25);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-focus: var(--primary);
    --selection: #0d99ff;
    --sidebar-width: 280px;
    --toolbar-height: 56px;
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px var(--primary-glow);
    --transition-fast: 0.1s ease;
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
  }
  
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  html { font-size: 14px; -webkit-font-smoothing: antialiased; }
  .hero {display: none !important;}
  .navbar{position:relative !important}
  body { font-family: 'Space Grotesk', -apple-system, sans-serif; background: var(--bg-app); color: var(--text-primary); overflow: hidden; line-height: 1.5; }
  .hidden { display: none !important; }
  input, select, button, textarea { font-family: inherit; font-size: inherit; }
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }
  
  /* TOP TOOLBAR */
  .top-toolbar { height: var(--toolbar-height); background: var(--bg-toolbar); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; position: relative; z-index: 100; backdrop-filter: blur(20px); }
  .top-toolbar::before { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--primary-glow), transparent); opacity: 0.5; }
  .toolbar-left, .toolbar-center, .toolbar-right { display: flex; align-items: center; gap: 0.75rem; }
  .file-name { padding: 0.5rem 0.875rem; background: var(--bg-input); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; cursor: text; transition: all var(--transition); min-width: 120px; }
  .file-name:hover { border-color: var(--border-hover); background: var(--bg-input-hover); }
  .file-name:focus { outline: none; border-color: var(--primary); color: var(--text-primary); }
  
  .generator-selector { display: flex; align-items: center; gap: 2px; background: var(--bg-input); border-radius: var(--radius-md); padding: 4px; }
  .generator-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; transition: all var(--transition); position: relative; }
  .generator-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
  .generator-btn.active { background: var(--primary); color: white; box-shadow: 0 0 20px var(--primary-glow); }
  .generator-btn::after { content: attr(title); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 0.4rem 0.6rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xs); font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--transition); z-index: 1000; }
  .generator-btn:hover::after { opacity: 1; }
  
  .zoom-controls { display: flex; align-items: center; gap: 0.25rem; background: var(--bg-input); border-radius: var(--radius-md); padding: 4px; }
  .zoom-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
  .zoom-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
  .zoom-value { min-width: 55px; text-align: center; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }
  .separator { width: 1px; height: 28px; background: var(--border); margin: 0 0.5rem; }
  
  .action-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border: none; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
  .action-btn.secondary { background: var(--bg-input); color: var(--text-secondary); padding: 0.5rem; }
  .action-btn.secondary:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
  .action-btn.secondary.disabled, .action-btn.secondary:disabled { opacity: 0.35; cursor: not-allowed; }
  .action-btn.accent { background: linear-gradient(135deg, var(--accent), #0891b2); color: white; box-shadow: 0 4px 15px var(--accent-glow); }
  .action-btn.accent:hover { background: linear-gradient(135deg, var(--accent-hover), #06b6d4); transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
  .action-btn.primary { background: linear-gradient(135deg, var(--primary), #7c3aed); color: white; box-shadow: 0 4px 15px var(--primary-glow); }
  .action-btn.primary:hover { background: linear-gradient(135deg, var(--primary-hover), #8b5cf6); transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }
  
  /* EDITOR LAYOUT */
  .editor-layout { display: flex; height: calc(100vh - var(--toolbar-height)); }
  
  /* LEFT SIDEBAR */
  .left-sidebar { width: var(--sidebar-width); background: var(--bg-sidebar); border-right: 1px solid var(--border);overflow: scroll; }
  .sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--border); }
  .sidebar-header h3 { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
  .layer-actions-main { display: flex; gap: 4px; }
  .add-layer-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
  .add-layer-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
  
  .layers-list { flex: 1; padding: 0.5rem; }
  .layer-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; background: transparent; border: 2px solid transparent; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition); margin-bottom: 4px; position: relative; }
  .layer-item:hover { background: var(--bg-input); }
  .layer-item.selected { background: var(--primary-light); border-color: var(--primary); }
  .layer-item.dragging { opacity: 0.5; }
  .layer-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.04); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.85rem; flex-shrink: 0; }
  .layer-item.selected .layer-icon { background: var(--primary); color: white; }
  .layer-icon.gradient-icon { background: linear-gradient(135deg, var(--primary), var(--accent)); }
  .layer-info { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
  .layer-name { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .layer-preview { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .layer-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
  .layer-item:hover .layer-actions { opacity: 1; }
  .layer-action-btn { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: var(--radius-xs); color: var(--text-muted); cursor: pointer; transition: all var(--transition); }
  .layer-action-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
  .layer-action-btn.hidden-layer { color: var(--text-disabled); }
  
  .drawing-tools { padding: 1rem; border-top: 1px solid var(--border); }
  .drawing-tools h3 { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.75rem; }
  .tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .tool-btn { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
  .tool-btn:hover { background: var(--bg-input-hover); color: var(--text-primary); }
  .tool-btn.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: 0 0 15px var(--primary-glow); }
  .brush-settings { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
  .brush-setting { margin-bottom: 0.75rem; }
  .brush-setting:last-child { margin-bottom: 0; }
  .brush-setting label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; }
  .slider-row { display: flex; align-items: center; gap: 0.75rem; }
  .slider-row input[type="range"] { flex: 1; }
  .slider-val { min-width: 45px; text-align: right; font-size: 0.75rem; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }
  .color-picker-small { width: 32px; height: 32px; border: none; border-radius: var(--radius-sm); cursor: pointer; background: transparent; padding: 0; }
  .color-picker-small::-webkit-color-swatch-wrapper { padding: 2px; }
  .color-picker-small::-webkit-color-swatch { border-radius: 4px; border: 2px solid rgba(255, 255, 255, 0.1); }
  
  /* CANVAS AREA */
  .canvas-area { flex: 1; background: var(--bg-canvas); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; background-image: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 50%), linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px); background-size: 100% 100%, 40px 40px, 40px 40px; }
  .canvas-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 2rem; overflow: auto; }
  .canvas-wrapper { position: relative; box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.4); border-radius: var(--radius-sm); overflow: hidden; }
  .gradient-canvas { width: 100%; height: 100%; display: block; }
  .gradient-canvas canvas { display: block; width: 100%; height: 100%; }
  #overlay-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
  #overlay-canvas.drawing-active { pointer-events: auto; cursor: crosshair; }
  .layers-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
  
  .text-box { position: absolute; pointer-events: auto; min-width: 50px; min-height: 30px; cursor: move; }
  .text-box.selected { outline: 2px solid var(--selection); outline-offset: 4px; }
  .text-box-content { width: 100%; height: 100%; outline: none; background: transparent; border: none; resize: none; overflow: hidden; white-space: pre-wrap; word-wrap: break-word; }
  .image-box { position: absolute; pointer-events: auto; cursor: move; }
  .image-box.selected { outline: 2px solid var(--selection); outline-offset: 4px; }
  .image-box img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
  .shape-box { position: absolute; pointer-events: auto; cursor: move; }
  .shape-box.selected { outline: 2px solid var(--selection); outline-offset: 4px; }
  .resize-handle { position: absolute; width: 10px; height: 10px; background: white; border: 2px solid var(--selection); border-radius: 2px; z-index: 20; display: none; }
  .selected .resize-handle { display: block; }
  .resize-handle.nw { top: -5px; left: -5px; cursor: nwse-resize; }
  .resize-handle.ne { top: -5px; right: -5px; cursor: nesw-resize; }
  .resize-handle.sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
  .resize-handle.se { bottom: -5px; right: -5px; cursor: nwse-resize; }
  .resize-handle.n { top: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
  .resize-handle.s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
  .resize-handle.e { top: 50%; right: -5px; transform: translateY(-50%); cursor: ew-resize; }
  .resize-handle.w { top: 50%; left: -5px; transform: translateY(-50%); cursor: ew-resize; }
  .rotate-handle { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; background: var(--primary); border-radius: 50%; cursor: grab; display: none; z-index: 20; }
  .selected .rotate-handle { display: block; }
  .rotate-handle::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 1px; height: 10px; background: var(--selection); }
  
  .generator-category-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }
  
  .category-group {
    display: flex;
    gap: 8px;
  }
  
  .category-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary, #001830);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #333);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
  }
  
  .category-btn:hover {
    background: var(--bg-hover, #e9ecef);
    border-color: var(--accent, #8b5cf6);
  }
  
  .category-btn.active {
    background: var(--accent, #8b5cf6);
    color: white;
    border-color: var(--accent, #8b5cf6);
  }
  
  .category-btn svg {
    flex-shrink: 0;
  }
  
  /* Responsive: stack vertically on small screens */
  @media (max-width: 1024px) {
    .generator-category-selector {
      flex-direction: column;
      align-items: flex-start;
    }
    .category-group {
      width: 100%;
      justify-content: center;
    }
  }
  
  /* RIGHT SIDEBAR */
  .right-sidebar { width: var(--sidebar-width); background: var(--bg-sidebar); border-left: 1px solid var(--border); overflow-y: scroll; display: flex; flex-direction: column; }
  .panel { border-bottom: 1px solid var(--border); }
  .panel-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; cursor: pointer; transition: background var(--transition); }
  .panel-header:hover { background: var(--bg-input); }
  .panel-header h4 { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
  .panel-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; transition: transform var(--transition); }
  .panel.collapsed .panel-toggle { transform: rotate(-90deg); }
  .panel.collapsed .panel-content { display: none; }
  .panel-content { padding: 0 1rem 1rem; }
  .property-group { margin-bottom: 1rem; }
  .property-group:last-child { margin-bottom: 0; }
  .property-group label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; font-weight: 500; }
  .prop-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
  .prop-header label { margin-bottom: 0; }
  
  .prop-select { width: 100%; padding: 0.6rem 0.75rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.85rem; outline: none; cursor: pointer; transition: all var(--transition); appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.5rem; }
  .prop-select:hover { border-color: var(--border-hover); }
  .prop-select:focus { border-color: var(--primary); }
  .prop-select option { background: var(--bg-sidebar); color: var(--text-primary); }
  
  .input-unit { display: flex; align-items: center; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color var(--transition); }
  .input-unit:focus-within { border-color: var(--primary); }
  .input-unit input { flex: 1; padding: 0.6rem 0.75rem; background: transparent; border: none; color: var(--text-primary); font-size: 0.85rem; outline: none; width: 100%; font-family: 'JetBrains Mono', monospace; }
  .input-unit span { padding: 0 0.75rem; color: var(--text-muted); font-size: 0.75rem; background: rgba(255, 255, 255, 0.02); border-left: 1px solid var(--border); height: 100%; display: flex; align-items: center; }
  .input-unit.small { max-width: 90px; }
  .input-unit.small input { padding: 0.4rem 0.5rem; }
  .input-unit.small span { padding: 0 0.5rem; }
  
  .resolution-buttons, .aspect-buttons { display: flex; gap: 4px; background: var(--bg-input); border-radius: var(--radius-sm); padding: 4px; }
  .res-btn, .aspect-btn { flex: 1; padding: 0.5rem 0.25rem; background: transparent; border: none; border-radius: var(--radius-xs); color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
  .res-btn:hover, .aspect-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
  .res-btn.active, .aspect-btn.active { background: var(--primary); color: white; }
  
  .dims-row { display: flex; align-items: center; gap: 0.5rem; }
  .dim-input { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
  .dim-input label { font-size: 0.65rem; color: var(--text-muted); margin-bottom: 0; }
  .dim-input input { width: 100%; padding: 0.5rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-primary); font-size: 0.8rem; outline: none; font-family: 'JetBrains Mono', monospace; }
  .dim-input input:focus { border-color: var(--primary); }
  .dims-x { color: var(--text-muted); font-size: 0.9rem; padding-top: 1rem; }
  .link-dims { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer; margin-top: 1rem; transition: all var(--transition); }
  .link-dims:hover { background: var(--bg-input-hover); color: var(--text-primary); }
  .link-dims.linked { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
  
  .style-btns { display: flex; gap: 4px; background: var(--bg-input); border-radius: var(--radius-sm); padding: 4px; }
  .style-btn { flex: 1; padding: 0.5rem; background: transparent; border: none; border-radius: var(--radius-xs); color: var(--text-secondary); font-size: 0.85rem; cursor: pointer; transition: all var(--transition); display: flex; align-items: center; justify-content: center; }
  .style-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
  .style-btn.active { background: var(--primary); color: white; }
  
  .color-row { display: flex; flex-direction: column; gap: 0.5rem; }
  .color-mode-toggle { display: flex; background: var(--bg-input); border-radius: var(--radius-xs); padding: 3px; }
  .mode-btn { flex: 1; padding: 0.35rem 0.5rem; background: transparent; border: none; border-radius: var(--radius-xs); color: var(--text-secondary); font-size: 0.7rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
  .mode-btn:hover { color: var(--text-primary); }
  .mode-btn.active { background: var(--primary); color: white; }
  .color-inputs { display: flex; gap: 0.5rem; }
  
  .shadow-controls { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }
  .shadow-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
  .mini-input { display: flex; align-items: center; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); overflow: hidden; }
  .mini-input input { width: 45px; padding: 0.4rem 0.3rem; background: transparent; border: none; color: var(--text-primary); font-size: 0.75rem; text-align: center; outline: none; font-family: 'JetBrains Mono', monospace; }
  .mini-input span { padding: 0 0.4rem; color: var(--text-muted); font-size: 0.65rem; background: rgba(255, 255, 255, 0.02); border-left: 1px solid var(--border); }
  
  .toggle-checkbox { width: 36px; height: 20px; appearance: none; background: var(--bg-input); border-radius: 10px; position: relative; cursor: pointer; transition: background var(--transition); }
  .toggle-checkbox::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--text-muted); border-radius: 50%; transition: all var(--transition); }
  .toggle-checkbox:checked { background: var(--primary); }
  .toggle-checkbox:checked::before { left: 18px; background: white; }
  
  .transform-row { display: flex; gap: 0.5rem; }
  .spacing-row { display: flex; gap: 1rem; }
  .spacing-input { flex: 1; }
  .spacing-input label { font-size: 0.7rem; }
  .stroke-row { display: flex; align-items: center; gap: 0.5rem; }
  .shape-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .shape-type-btn { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
  .shape-type-btn:hover { background: var(--bg-input-hover); color: var(--text-primary); }
  .shape-type-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
  .grain-color-mode { display: flex; background: var(--bg-input); border-radius: var(--radius-xs); padding: 3px; margin-bottom: 0.5rem; }
  .filter-controls { display: flex; flex-direction: column; gap: 0.75rem; }
  .filter-item { display: flex; align-items: center; gap: 0.75rem; }
  .filter-item span { min-width: 70px; font-size: 0.75rem; color: var(--text-muted); }
  .filter-item input[type="range"] { flex: 1; }
  .delete-panel { border-bottom: none; padding: 1rem; }
  .delete-layer-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem; background: var(--danger-light); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: var(--radius-md); color: var(--danger); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
  .delete-layer-btn:hover { background: rgba(239, 68, 68, 0.2); border-color: var(--danger); }
  
  /* RANGE SLIDER */
  input[type="range"] { -webkit-appearance: none; width: 100%; height: 4px; background: var(--bg-input); border-radius: 2px; outline: none; }
  input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--primary); border-radius: 50%; cursor: pointer; box-shadow: 0 2px 8px var(--primary-glow); transition: transform var(--transition); }
  input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
  input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; background: var(--primary); border: none; border-radius: 50%; cursor: pointer; }
  
  /* MODE INDICATOR */
  .mode-indicator { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; background: var(--bg-toolbar); border: 1px solid var(--primary); border-radius: var(--radius-lg); box-shadow: var(--shadow-md), var(--shadow-glow); z-index: 1000; backdrop-filter: blur(10px); }
  .mode-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; color: var(--primary); }
  .mode-text { font-size: 0.85rem; font-weight: 500; color: var(--text-primary); }
  .mode-indicator button { padding: 0.3rem 0.6rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-xs); color: var(--text-muted); font-size: 0.7rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
  .mode-indicator button:hover { background: var(--bg-input-hover); color: var(--text-primary); }
  
  /* MODAL */
  .modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
  .modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px); }
  .modal-content { position: relative; width: 90%; max-width: 480px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: modalIn 0.25s ease; }
  @keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
  .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
  .modal-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
  .modal-close { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); border: none; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
  .modal-close:hover { background: var(--bg-input-hover); color: var(--text-primary); }
  .modal-body { padding: 1.5rem; }
  .export-options { display: flex; flex-direction: column; gap: 1.25rem; }
  .export-option label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
  .format-buttons { display: flex; gap: 4px; background: var(--bg-input); border-radius: var(--radius-sm); padding: 4px; }
  .format-btn { flex: 1; padding: 0.6rem; background: transparent; border: none; border-radius: var(--radius-xs); color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
  .format-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
  .format-btn.active { background: var(--primary); color: white; }
  .export-preview { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--bg-input); border-radius: var(--radius-md); }
  .preview-thumb { width: 80px; height: 80px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: var(--radius-sm); overflow: hidden; }
  .preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .preview-info { display: flex; flex-direction: column; gap: 0.35rem; }
  .preview-info span { font-size: 0.85rem; color: var(--text-secondary); }
  .preview-info span:first-child { font-weight: 600; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }
  .modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
  .btn-secondary, .btn-primary { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.25rem; border: none; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
  .btn-secondary { background: var(--bg-input); color: var(--text-secondary); }
  .btn-secondary:hover { background: var(--bg-input-hover); color: var(--text-primary); }
  .btn-primary { background: linear-gradient(135deg, var(--primary), #7c3aed); color: white; box-shadow: 0 4px 15px var(--primary-glow); }
  .btn-primary:hover { background: linear-gradient(135deg, var(--primary-hover), #8b5cf6); transform: translateY(-1px); }
  
  /* LOADING */
  .loading-spinner { width: 24px; height: 24px; border: 2px solid rgba(255, 255, 255, 0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .regenerate-animation { animation: pulse 0.3s ease; }
  @keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.95); } }
  
  /* RESPONSIVE */
  @media (max-width: 1400px) { :root { --sidebar-width: 260px; } }
  @media (max-width: 1200px) { :root { --sidebar-width: 240px; } .generator-selector { gap: 1px; padding: 3px; } .generator-btn { width: 32px; height: 32px; } }
  @media (max-width: 1024px) { .left-sidebar { width: 220px; } .right-sidebar { width: 260px; } }
  @media (max-width: 900px) { .left-sidebar { display: none; } .toolbar-center .generator-selector { display: none; } .action-btn span { display: none; } .action-btn { padding: 0.5rem; } }
  @media (max-width: 768px) { .right-sidebar { position: fixed; right: 0; top: var(--toolbar-height); height: calc(100vh - var(--toolbar-height)); transform: translateX(100%); transition: transform 0.3s ease; z-index: 50; width: 280px; } .right-sidebar.open { transform: translateX(0); } .zoom-controls { display: none; } .modal-content { width: 95%; max-width: none; margin: 1rem; } }
  
  .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .no-select { user-select: none; }
  .cursor-move { cursor: move; }
  .cursor-crosshair { cursor: crosshair; }
  
  @media print { .top-toolbar, .left-sidebar, .right-sidebar, .mode-indicator, .modal { display: none !important; } .canvas-area { width: 100%; height: auto; overflow: visible; } }