        :root {
            --bg-base: #0D0F14;
            --bg-surface: #151921;
            --bg-surface-hover: #1E2430;
            --text-primary: #F8FAFC;
            --text-secondary: #94A3B8;
            --accent: #3B82F6;
            --accent-hover: #60A5FA;
            --border: #262D3D;
            --radius-md: 0px; /* user wants it sharp like a knife */
            --radius-lg: 0px;
            --radius-xl: 0px;
            --shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
            --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            
            --theme-bg: #ffffff;
            --theme-text: #000000;
            --theme-primary: #3B82F6;
            --theme-secondary: #10B981;
            --theme-accent: #F59E0B;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-base);
            color: var(--text-primary);
            display: flex;
            min-height: 100vh;
            overflow-x: hidden;
        }

        h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; }
        
        .sidebar {
            width: 280px; background: var(--bg-surface); border-right: 1px solid var(--border);
            padding: 24px; display: flex; flex-direction: column; gap: 24px; flex-shrink: 0;
            z-index: 10;
        }

        .main-content {
            flex-grow: 1; padding: 40px; display: flex; flex-direction: column; gap: 40px;
            overflow-y: auto; max-width: 1200px; margin: 0 auto; width: 100%;
        }

        .logo { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
        .logo-icon { width: 32px; height: 32px; background: linear-gradient(135deg, #3B82F6, #8B5CF6, #EC4899); border-radius: 0px; }

        .history-section h3 { font-size: 14px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
        .history-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
        .history-item { aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: var(--transition); }
        .history-item:hover { border-color: var(--accent); transform: translateY(-2px); }
        .history-item img { width: 100%; height: 100%; object-fit: cover; }

        .header { display: flex; justify-content: space-between; align-items: center; }
        .header-controls { display: flex; gap: 16px; align-items: center; }

        .mode-toggle {
            /* tbh idk why this toggle is so complex */
            display: flex; background: var(--bg-surface); border-radius: 0px; padding: 4px;
            border: 1px solid var(--border);
        }
        .mode-btn {
            padding: 8px 16px; border-radius: 16px; border: none; background: transparent;
            color: var(--text-secondary); font-weight: 600; cursor: pointer; transition: var(--transition);
        }
        .mode-btn.active { background: var(--bg-surface-hover); color: var(--text-primary); }

        .mood-tag {
            background: rgba(255,255,255,0.05); border: 1px solid var(--border); padding: 8px 16px;
            border-radius: 20px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px;
            opacity: 0; transform: translateY(-10px); transition: var(--transition);
        }
        .mood-tag.visible { opacity: 1; transform: translateY(0); }

        /* Upload Zone */
        .upload-zone {
            background: var(--bg-surface); border: 2px dashed var(--border); border-radius: var(--radius-xl);
            padding: 60px 40px; text-align: center; cursor: pointer; transition: var(--transition);
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; position: relative; overflow: hidden;
        }
        .upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--bg-surface-hover); }
        .upload-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.8; }
        .upload-text { font-size: 18px; font-weight: 600; }
        .upload-subtext { font-size: 14px; color: var(--text-secondary); }
        #file-input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

        .image-preview-container { display: none; width: 100%; max-height: 300px; border-radius: var(--radius-lg); overflow: hidden; position: relative; }
        .image-preview-container img { width: 100%; height: 100%; object-fit: contain; background: rgba(0,0,0,0.5); }

        /* Manual Input Zone */
        .manual-zone {
            display: none; background: var(--bg-surface); border-radius: var(--radius-xl); padding: 40px; text-align: center;
        }
        .manual-input {
            background: var(--bg-base); border: 1px solid var(--border); color: var(--text-primary);
            padding: 16px 24px; border-radius: 12px; font-size: 24px; font-family: monospace; width: 250px;
            text-align: center; margin-bottom: 16px;
        }
        .manual-input:focus { outline: none; border-color: var(--accent); }

        /* Palette Display */
        .palette-container { display: none; flex-direction: column; gap: 20px; }
        .swatches-wrapper { display: flex; height: 200px; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow); background: #000; }
        .swatch-col { display: flex; flex-direction: column; transition: flex-grow 0.5s cubic-bezier(0.25, 1, 0.5, 1); position: relative; cursor: pointer; }
        .swatch-col:hover { flex-grow: 2 !important; }
        .swatch-color { flex-grow: 1; transition: var(--transition); }
        
        .swatch-info {
            position: absolute; bottom: 0; left: 0; right: 0; padding: 16px;
            background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); opacity: 0; transition: var(--transition);
            display: flex; flex-direction: column; gap: 4px; pointer-events: none;
        }
        .swatch-col:hover .swatch-info { opacity: 1; pointer-events: auto; }
        
        .copyable { font-family: monospace; font-size: 14px; color: white; cursor: pointer; padding: 4px; border-radius: 4px; transition: var(--transition); }
        .copyable:hover { background: rgba(255,255,255,0.2); }
        .swatch-percent { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.5); color: white; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 12px; backdrop-filter: blur(4px); }

        .features-grid { display: none; grid-template-columns: 1fr 1fr; gap: 24px; }
        .card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
        .card-header { display: flex; justify-content: space-between; align-items: center; }
        .card-title { font-size: 18px; display: flex; align-items: center; gap: 8px; }

        /* Smart Roles Preview */
        .role-preview { background: var(--theme-bg); border-radius: var(--radius-md); padding: 24px; overflow: hidden; position: relative; box-shadow: 0 4px 20px rgba(0,0,0,0.2); transition: background 0.3s; }
        .role-nav { display: flex; justify-content: space-between; margin-bottom: 32px; }
        .role-nav-logo { width: 24px; height: 24px; background: var(--theme-primary); border-radius: 4px; }
        .role-hero h4 { color: var(--theme-text); font-size: 24px; margin-bottom: 12px; transition: color 0.3s; }
        .role-hero p { color: var(--theme-text); opacity: 0.7; font-size: 14px; margin-bottom: 24px; transition: color 0.3s; }
        .role-btn { background: var(--theme-primary); color: var(--theme-bg); border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
        .role-accent-blob { position: absolute; top: -20px; right: -20px; width: 100px; height: 100px; background: var(--theme-accent); border-radius: 50%; filter: blur(30px); opacity: 0.5; }
        .role-assignments { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
        .role-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.02); padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); }
        .role-label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
        .role-color-box { display: flex; align-items: center; gap: 8px; }
        .role-color-swatch { width: 24px; height: 24px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.1); }

        /* Contrast Checker */
        .contrast-matrix { display: grid; grid-template-columns: auto repeat(5, 1fr); gap: 4px; overflow-x: auto; }
        .matrix-header { font-size: 12px; color: var(--text-secondary); text-align: center; padding: 8px; }
        .matrix-cell { aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; position: relative; }
        .matrix-cell span { font-size: 16px; }
        .pass-aaa { border: 2px solid #10B981; }
        .pass-aa { border: 2px solid #F59E0B; }
        .fail { border: 2px solid #EF4444; opacity: 0.3; }
        .contrast-legend { display: flex; gap: 16px; font-size: 12px; margin-top: 16px; color: var(--text-secondary); }
        .legend-item { display: flex; align-items: center; gap: 6px; }
        .legend-dot { width: 10px; height: 10px; border-radius: 50%; }

        /* Font Pairing */
        .font-pairings { display: flex; flex-direction: column; gap: 16px; }
        .font-pair { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 16px; position: relative; transition: var(--transition); }
        .font-pair:hover { border-color: var(--accent); }
        .font-pair h4 { font-size: 20px; margin-bottom: 8px; color: var(--text-primary); }
        .font-pair p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
        .font-copy { position: absolute; top: 16px; right: 16px; background: var(--bg-surface-hover); border: none; color: white; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; }

        /* Theme Generator */
        .theme-slides { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
        .slide { flex: 0 0 200px; height: 120px; border-radius: 8px; padding: 16px; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
        .slide-title { font-size: 16px; font-weight: bold; margin-bottom: 8px; }
        .slide-text { font-size: 10px; opacity: 0.8; }
        
        .btn { padding: 12px 20px; border-radius: 8px; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 8px; border: 1px solid transparent; }
        .btn-primary { background: var(--accent); color: white; }
        .btn-primary:hover { background: var(--accent-hover); }
        .btn-secondary { background: rgba(255,255,255,0.05); color: var(--text-primary); border-color: var(--border); }
        .btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--text-secondary); }

        .toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--bg-surface-hover); color: white; padding: 12px 24px; border-radius: 30px; box-shadow: var(--shadow); font-weight: 500; opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 1000; border: 1px solid var(--border); }
        .toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

        /* Harmonies Container */
        .harmonies-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
        .harmony-row { display: flex; gap: 8px; align-items: center; }
        .harmony-label { width: 100px; font-size: 12px; color: var(--text-secondary); }
        .harmony-swatches { display: flex; gap: 4px; flex-grow: 1; }
        .h-swatch { height: 40px; flex-grow: 1; border-radius: 4px; cursor: pointer; }

        @media (max-width: 900px) {
            body { flex-direction: column; }
            .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 16px; flex-direction: row; align-items: center; overflow-x: auto;}
            .history-section { display: none; }
            .features-grid { grid-template-columns: 1fr; }
        }
