  :root {
            --bg-main: #f8fafc;
            --bg-card: #ffffff;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --border-light: #e2e8f0;
            --accent: #6366f1;
            --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
            
            --ui-primary: #6366f1;
            --ui-text-on-primary: #ffffff;
        }

        * { box-sizing: border-box; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); -webkit-tap-highlight-color: transparent; }

        body {
            margin: 0;
            font-family: 'Outfit', sans-serif;
            background-color: var(--bg-main);
            color: var(--text-main);
            height: 100vh;
            overflow: hidden; 
            display: flex;
            justify-content: center;
            padding: 20px;
        }

        .container {
            width: 100%;
            max-width: 1350px;
            display: grid;
            grid-template-columns: 360px 1fr; 
            grid-template-rows: auto 1fr;
            gap: 25px;
            height: 100%;
        }

        @media (max-width: 1000px) {
            body { height: auto; overflow: auto; display: block; }
            .container { grid-template-columns: 1fr; grid-template-rows: auto; gap: 20px; height: auto; }
            .controls-panel { height: auto !important; overflow: visible !important; }
            .card { height: auto !important; }
            .visual-panel { height: auto !important; overflow: visible !important; }
            .canvas-container { min-height: 300px; }
        }

        header { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--border-light); padding-bottom: 15px; margin-bottom: 5px; }
        h1 { font-family: 'Playfair Display', serif; font-size: 2rem; margin: 0; color: var(--text-main); letter-spacing: -0.5px; }
        .version-badge { font-size: 0.8rem; background: var(--text-main); color: white; padding: 4px 8px; border-radius: 6px; vertical-align: middle; margin-left: 10px; font-family: 'Outfit', sans-serif; letter-spacing: 1px; }

        .card {
            background: var(--bg-card);
            border: 1px solid var(--border-light);
            border-radius: 20px;
            padding: 25px;
            box-shadow: var(--shadow-soft);
            display: flex; flex-direction: column; gap: 20px;
        }

        .controls-panel { grid-row: 2; height: 100%; overflow: hidden; display: flex; flex-direction: column; }

        .scrollable-sidebar {
            height: 100%;
            overflow-y: auto; 
            padding-right: 10px; 
            scrollbar-width: thin;
            scrollbar-color: var(--border-light) transparent;
        }
        .scrollable-sidebar::-webkit-scrollbar { width: 6px; }
        .scrollable-sidebar::-webkit-scrollbar-thumb { background-color: var(--border-light); border-radius: 10px; }

        .sidebar-section { border-bottom: 1px solid var(--border-light); padding-bottom: 25px; margin-bottom: 25px; }
        .sidebar-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

        h3 { 
            font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1.2px; margin: 0 0 15px 0; color: var(--text-muted); 
            display: flex; justify-content: space-between; align-items: center;
        }

        .wheel-wrapper { position: relative; width: 220px; height: 220px; margin: 0 auto; border-radius: 50%; box-shadow: 0 10px 30px rgba(0,0,0,0.1); background: #fff; padding: 5px; }
        .wheel-canvas { width: 100%; height: 100%; border-radius: 50%; cursor: crosshair; touch-action: none; }
        .wheel-cursor { position: absolute; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); pointer-events: none; transform: translate(-50%, -50%); z-index: 10; transition: none !important; }

        .color-info-row { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 10px; }
        .live-preview-dot { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 1px solid var(--border-light); }
        #hexInput { background: var(--bg-main); border: 1px solid var(--border-light); padding: 10px; border-radius: 10px; font-family: monospace; font-size: 1rem; color: var(--text-main); text-align: center; width: 100px; outline: none; }
        #hexInput:focus { border-color: var(--accent); background: #fff; }

        .btn-group { display: flex; gap: 8px; }
        .btn-main { flex: 1; background: var(--text-main); color: #fff; border: none; padding: 10px; border-radius: 10px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.9rem; transition: opacity 0.2s; }
        .btn-main:hover { opacity: 0.9; }
        .btn-sec { flex: 1; background: #fff; border: 1px solid var(--border-light); color: var(--text-main); padding: 10px; border-radius: 10px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.9rem; transition: background 0.2s; }
        .btn-sec:hover { background: var(--bg-main); border-color: var(--text-muted); }

        .collection-grid { display: flex; flex-wrap: wrap; gap: 8px; }
        .saved-chip { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); position: relative; transition: transform 0.2s; }
        .saved-chip:hover { transform: scale(1.1); z-index: 2; }

        .mixer-area { background: var(--bg-main); border-radius: 12px; padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 50px; align-items: center; }
        .mix-chip { width: 26px; height: 26px; border-radius: 6px; cursor: pointer; position: relative; transition: transform 0.2s; }
        .mix-chip:hover { transform: scale(1.1); }
        .mix-chip:hover::after { content: '×'; position: absolute; inset: 0; display:flex; align-items:center; justify-content:center; color:white; font-size:14px; text-shadow:0 0 2px black; }

        .visual-panel { grid-row: 2; display: flex; flex-direction: column; gap: 20px; height: 100%; overflow-y: auto; padding-right: 5px; }
        
        .nav-tabs { display: flex; gap: 20px; border-bottom: 2px solid var(--border-light); margin-bottom: 10px; overflow-x: auto; white-space: nowrap; flex-shrink: 0; }
        .nav-item { padding: 10px 5px; font-weight: 600; color: var(--text-muted); cursor: pointer; position: relative; top: 2px; }
        .nav-item.active { color: var(--text-main); border-bottom: 2px solid var(--text-main); }
        .tab-content { display: none; height: 100%; animation: fadeIn 0.3s; }
        .tab-content.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

        .canvas-container { position: relative; width: 100%; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 20px rgba(0,0,0,0.03); border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; min-height: 400px; }
        canvas { max-width: 100%; height: auto; }
        .toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; align-items: center; justify-content: space-between; }
        .select-style { padding: 10px 15px; border-radius: 10px; border: 1px solid var(--border-light); background: #fff; cursor: pointer; font-family: inherit; font-size: 0.9rem; }

        .btn-pattern-action { border: none; padding: 10px 20px; border-radius: 50px; font-weight: 600; font-size: 0.9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: transform 0.2s, box-shadow 0.2s; }
        .btn-pattern-regen { background: #fff; color: var(--text-main); border: 2px solid var(--border-light); }
        .btn-pattern-regen:hover { border-color: var(--text-main); background: var(--bg-main); }
        .btn-pattern-down { background: linear-gradient(135deg, var(--text-main), #334155); color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
        .btn-pattern-down:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.25); }

        .ui-preview-container { background: #fff; padding: 30px; border-radius: 16px; border: 1px solid var(--border-light); display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
        .ui-component-box { display: flex; flex-direction: column; gap: 15px; }
        .ui-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
        
        .demo-btn-primary { background: var(--ui-primary); color: var(--ui-text-on-primary); border: none; padding: 12px 24px; border-radius: 8px; font-weight: 500; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
        .demo-btn-outline { background: transparent; color: var(--ui-primary); border: 2px solid var(--ui-primary); padding: 10px 22px; border-radius: 8px; font-weight: 600; cursor: pointer; }
        .demo-card { background: white; border-top: 4px solid var(--ui-primary); border-radius: 12px; padding: 20px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
        .demo-nav { background: var(--text-main); padding: 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; color: white; }
        .demo-nav span { font-weight: 700; letter-spacing: 1px; }
        .demo-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; margin-left: 15px; }
        .demo-links a.active { color: var(--ui-primary); font-weight: 600; }
        .demo-input { border: 2px solid var(--border-light); padding: 10px; border-radius: 8px; width: 100%; outline: none; }
        .demo-input:focus { border-color: var(--ui-primary); }

        .palette-bar { display: flex; height: 80px; border-radius: 12px; overflow: hidden; margin-top: 10px; cursor: pointer; border: 1px solid var(--border-light); }
        .p-swatch { flex: 1; transition: flex 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.7rem; font-family: monospace; font-weight: bold; } 
        .p-swatch:hover { flex: 1.5; }

        .toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(30, 41, 59, 0.95); color: #fff; padding: 14px 28px; border-radius: 50px; font-size: 0.95rem; font-weight: 500; letter-spacing: 0.5px; opacity: 0; pointer-events: none; z-index: 1000; box-shadow: 0 10px 25px rgba(0,0,0,0.2); backdrop-filter: blur(5px); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: flex; align-items: center; gap: 10px; }
        .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
        .toast i { font-size: 1.1rem; }

        .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(3px); z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
        .modal-overlay.active { opacity: 1; pointer-events: auto; }
        .modal-box { background: #fff; width: 90%; max-width: 400px; padding: 30px; border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.15); transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); text-align: center; }
        .modal-overlay.active .modal-box { transform: scale(1); }
        .modal-title { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--text-main); margin-bottom: 10px; }
        .modal-text { color: var(--text-muted); margin-bottom: 25px; line-height: 1.5; font-size: 0.95rem; }
        .modal-actions { display: flex; gap: 10px; justify-content: center; }
        .btn-modal { padding: 12px 24px; border-radius: 12px; font-weight: 600; cursor: pointer; border: none; font-size: 0.9rem; transition: all 0.2s; }
        .btn-modal-cancel { background: #f1f5f9; color: var(--text-muted); }
        .btn-modal-cancel:hover { background: #e2e8f0; color: var(--text-main); }
        .btn-modal-confirm { background: var(--text-main); color: #fff; }
        .btn-modal-confirm:hover { background: var(--accent); box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3); }

        .comparison-list { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; width: 100%; }
        .compare-row { background: #fff; border: 1px solid var(--border-light); border-radius: 12px; padding: 15px; display: flex; flex-direction: column; gap: 10px; position: relative; animation: fadeIn 0.3s; }
        .compare-row-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--text-muted); }
        .compare-swatches { display: flex; height: 50px; border-radius: 8px; overflow: hidden; width: 100%; }
        .c-swatch { flex: 1; }
        .btn-remove-row { background: transparent; border: none; color: #ef4444; cursor: pointer; }
        .btn-remove-row:hover { color: #dc2626; }
        
        #btnComparisonExport { display: none; margin-top: 20px; width: 100%; }
        #btnComparisonExport.visible { display: flex; }
        #emptyStateMsg { text-align: center; padding: 40px; color: var(--text-muted); border: 2px dashed var(--border-light); border-radius: 12px; }

        .upload-area { border: 2px dashed var(--border-light); border-radius: 16px; padding: 40px; text-align: center; cursor: pointer; transition: all 0.2s; background: var(--bg-main); margin-bottom: 20px; }
        .upload-area:hover { border-color: var(--accent); background: #eff6ff; }
        .upload-icon { font-size: 3rem; color: var(--text-muted); margin-bottom: 15px; }
        
        .img-editor-container { position: relative; display: inline-block; overflow: hidden; border-radius: 12px; box-shadow: var(--shadow-soft); max-width: 100%; max-height: 400px; margin-bottom: 20px; border: 1px solid var(--border-light); }
        #imagePreview { display: block; max-width: 100%; max-height: 400px; }
        
        .picker-dot { 
            position: absolute; width: 28px; height: 28px; 
            border: 3px solid white; border-radius: 50%; 
            box-shadow: 0 4px 10px rgba(0,0,0,0.4); cursor: grab; 
            transform: translate(-50%, -50%); z-index: 10; 
            font-size: 11px; display: flex; align-items: center; justify-content: center; 
            color: white; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,0.8); 
            transition: transform 0.1s !important; 
        }
        .picker-dot:active { cursor: grabbing; transform: translate(-50%, -50%) scale(1.2); }
        
        .extracted-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; }
        .extracted-card { background: #fff; border: 1px solid var(--border-light); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
        .extracted-swatch { height: 70px; width: 100%; }
        .extracted-info { padding: 12px; }
        .extracted-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; display: block; }
        .extracted-hex { font-family: monospace; font-size: 0.95rem; color: var(--text-main); font-weight: bold; margin-bottom: 8px; display: block; }
        .extracted-actions { display: flex; gap: 5px; }
        .btn-xs { flex: 1; padding: 5px; font-size: 0.75rem; border-radius: 6px; cursor: pointer; border: 1px solid var(--border-light); background: transparent; color: var(--text-muted); }
        .btn-xs:hover { background: var(--bg-main); color: var(--text-main); }

        /* ESTILOS CONVERTIDOR */
        .converter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
        @media (max-width: 800px) { .converter-grid { grid-template-columns: 1fr; } }
        
        .converter-preview {
            height: 150px; border-radius: 16px; margin-bottom: 20px; box-shadow: var(--shadow-soft); border: 1px solid var(--border-light);
            display: flex; align-items: center; justify-content: center; color: white; font-family: monospace; font-size: 1.2rem; text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        
        .input-group { margin-bottom: 20px; }
        .input-label { display: block; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
        
        .multi-input { display: flex; gap: 10px; }
        .sub-input-container { flex: 1; position: relative; }
        .sub-input { width: 100%; padding: 10px 10px 10px 30px; border: 1px solid var(--border-light); border-radius: 8px; font-family: monospace; outline: none; }
        .sub-input:focus { border-color: var(--accent); }
        .sub-label { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 0.8rem; color: var(--text-muted); font-weight: bold; pointer-events: none; }
        
        .btn-copy-code {
            width: 100%; padding: 10px; margin-top: 5px; background: var(--bg-main); border: 1px solid var(--border-light); border-radius: 8px; cursor: pointer; font-size: 0.85rem; color: var(--text-main); display: flex; justify-content: space-between; align-items: center;
        }
        .btn-copy-code:hover { background: #fff; border-color: var(--accent); color: var(--accent); }
 