:root {
    --color-root: #0F1A15;
    --color-surface: #1E2B24;
    --color-acid: #D4FF5F;
    --color-text: #FFFFFF;
    --color-text-muted: #9CA3AF;
    --color-border: #374151;
    --grid-cols: 4;
}

 
.extractor-layout-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .extractor-layout-wrapper {
        display: grid;
        grid-template-columns: 320px 1fr !important;
        align-items: start;
    }
}

 
.mode-group {
    padding-bottom: 1rem;
}

.mode-group:last-child {
    padding-bottom: 0;
}

.mode-group h5 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    background: var(--color-root);
    padding: 0.75rem 1rem 0.5rem;
    z-index: 20;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mode-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.mode-item:last-child {
    border-bottom: none;
}

.mode-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mode-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.25rem;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.mode-item input[type="checkbox"]:checked {
    background: var(--color-acid);
    border-color: var(--color-acid);
}

.mode-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid var(--color-root);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mode-item span {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.4;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--color-acid);
}
.results-container {
    display: grid;
    gap: 2rem;
}

.image-result-group {
    background: rgba(30, 43, 36, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    
     
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 200px;
}

.results-area {
    flex: 1;
     
}

.image-result-group:hover {
    border-color: rgba(212, 255, 95, 0.3);
}

.group-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;  
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.header-actions {
    margin-left: auto;
}

.action-btn.preview-btn {
    background: transparent;
    color: var(--color-acid);
    border: 1px solid var(--color-acid);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.05em;
}

.action-btn.preview-btn:hover {
    background: var(--color-acid);
    color: var(--color-root);
}

.action-btn.preview-btn .icon-svg {
    width: 1rem;
    height: 1rem;
}

.thumb-container {
    flex-shrink: 0;
    position: relative;
}

.thumb-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.meta-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-title {
    color: var(--color-text);
    font-weight: 800;
    margin: 0;
    font-size: 1.125rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    align-self: flex-start;
    display: inline-block;
}

.status-badge.processing { background: rgba(255, 255, 255, 0.1); color: var(--color-text-muted); }
.status-badge.done { background: rgba(212, 255, 95, 0.1); color: var(--color-acid); border: 1px solid rgba(212, 255, 95, 0.3); }
.status-badge.error { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

 
.result-grid-track {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 4), 1fr);
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    :root { --grid-cols: 1; }
    .result-grid-track { grid-template-columns: repeat(1, 1fr) !important; }
}

 
.mini-palette-card {
    background: var(--color-surface);  
    border-radius: 0.25rem;  
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.mini-palette-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-acid);
    background: #23332a;  
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--color-acid);
    z-index: 2;
}

.mini-palette-card.selected {
    border-color: var(--color-acid);
    box-shadow: 0 0 0 1px var(--color-acid);
}

.mini-palette-card.selected::before {
    content: '✓'; position: absolute; top: -6px; right: -6px;
    width: 22px; height: 22px; background: var(--color-acid); color: var(--color-root);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border: 2px solid #000; z-index: 10; pointer-events: none;
}

 
.card-header { display: flex; justify-content: space-between; margin-bottom: 8px; width: 100%; padding: 0; }
.card-footer { display: flex; gap: 3px; margin-top: auto; height: 10px; flex-wrap: wrap; padding: 0; }

.mode-name {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-family: monospace;
    text-transform: uppercase;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1;
}

.preview-btn-icon {
    background: transparent; border: none; cursor: pointer; opacity: 0.6; 
    color: var(--color-text-muted); font-size: 12px;
}
.preview-btn-icon:hover { opacity: 1; color: var(--color-acid); }

 
.mini-swatch {
    position: relative; display: flex; align-items: center; 
    font-family: monospace; font-weight: 600;
    transition: all 0.2s; overflow: hidden; color: var(--color-text);
}
.copy-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: flex-start;
    padding-left: 10px;
    background: rgba(0,0,0,0.2);
    opacity: 0; transition: opacity 0.2s;
    pointer-events: none; z-index: 3;
}
.mini-swatch:hover .copy-overlay { opacity: 1; }
.swatch-info { display: none; width: 100%; padding: 0 12px; pointer-events: none; z-index: 2; box-sizing: border-box; }

 
.result-grid-track.view-card { grid-template-columns: repeat(var(--grid-cols, 4), 1fr); gap: 20px; }
.view-card .mini-palette-card { padding: 15px; }
.view-card .mini-swatch-row {
    display: flex; flex-direction: column !important; height: auto !important; 
    width: 100%;
    border-radius: 0.5rem; overflow: hidden; margin-bottom: 0.5rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.view-card .mini-swatch {
    width: 100% !important; height: 32px !important; flex: none !important;
    border-bottom: 1px solid rgba(0,0,0,0.2); border-radius: 0 !important; padding: 0; 
}
.view-card .mini-swatch:last-child { border-bottom: none; }
.view-card .swatch-info { display: flex !important; align-items: center; justify-content: flex-end; gap: 10px; width: 100%; }
.view-card .swatch-hex { font-size: 0.75rem; font-weight: 700; } 
.view-card .swatch-percent { font-size: 0.75rem; opacity: 0.9; } 
.view-card .card-footer { display: none; }
.view-card .palette-info { display: none; }  

 
.result-grid-track.view-strip { grid-template-columns: repeat(var(--grid-cols, 4), 1fr); gap: 20px; }
.view-strip .mini-palette-card { padding: 15px; overflow: visible !important; }
.view-strip .card-header { margin-bottom: 0.5rem; padding: 0; }
.view-strip .mini-swatch-row {
    display: flex; flex-direction: row !important; height: 64px !important;
    width: 100%;
    margin-bottom: 0; overflow: visible; border-radius: 0.25rem;
}
.view-strip .copy-overlay { justify-content: center; padding-left: 0; }
.view-strip .mini-swatch { height: 100% !important; border-radius: 0; flex: 1 !important; overflow: visible; }
.view-strip .mini-swatch:first-child { border-top-left-radius: 0.25rem; border-bottom-left-radius: 0.25rem; }
.view-strip .mini-swatch:last-child { border-top-right-radius: 0.25rem; border-bottom-right-radius: 0.25rem; }
.view-strip .mini-swatch:hover { z-index: 100; flex: 2 !important; }
.view-strip .card-footer { display: none; }
.view-strip .palette-info { display: none; }

 
.view-strip .mini-swatch:hover .swatch-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--color-acid);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border: 1px solid var(--color-acid);
    pointer-events: none;
    width: auto;
}

.view-strip .mini-swatch:hover .swatch-info::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--color-acid) transparent;
}

.view-strip .swatch-hex { font-weight: 700; font-family: monospace; }
.view-strip .swatch-percent { color: #fff; font-size: 10px; }

 
.result-grid-track.view-pie { grid-template-columns: repeat(var(--grid-cols, 4), 1fr); gap: 20px; }
.view-pie .mini-palette-card { 
    flex-direction: row; align-items: center; 
    padding: 20px; padding-top: 55px; 
    min-height: 140px; overflow: visible; 
}
.view-pie .card-header { 
    position: absolute; top: 12px; left: 18px; 
    width: calc(100% - 36px); pointer-events: none; 
}
.view-pie .mini-swatch-row {
    width: 90px; height: 90px; flex: 0 0 90px; position: relative;
    margin-right: 15px; background: none !important; overflow: visible; z-index: 1;
    box-shadow: none !important;
}
.view-pie .mini-swatch-row::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%; background: var(--pie-gradient);
    mask: radial-gradient(transparent 38%, black 39%); 
    -webkit-mask: radial-gradient(transparent 38%, black 39%); 
    z-index: -1;
}
.view-pie .mini-swatch { display: none !important; }

.pie-slice-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%; background: var(--segment-gradient);
    opacity: 0; 
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
    pointer-events: none;
    mask: radial-gradient(transparent 38%, black 39%);
    -webkit-mask: radial-gradient(transparent 38%, black 39%);
    z-index: 2;
}
.pie-slice-overlay.active { opacity: 1; transform: scale(1.15); }

.view-pie .palette-info {
    display: flex; flex-direction: column; gap: 4px;
    flex: 1; padding: 0;
}

.pie-legend-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; color: var(--color-text-muted);
    cursor: pointer; padding: 2px 4px; border-radius: 4px;
    transition: all 0.2s;
}
.pie-legend-item:hover { 
    background: rgba(255,255,255,0.1); 
    color: var(--color-text); 
    transform: translateX(2px);
}
.pie-legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.pie-legend-text { font-family: monospace; }
.pie-legend-ratio { margin-left: auto; font-weight: 700; color: var(--color-text-muted); }

 
.preview-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 26, 21, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease-out;
    color: var(--color-text);
}
.preview-modal.active { opacity: 1; pointer-events: auto; }

 
#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #000;
    color: var(--color-acid);
    border: 1px solid var(--color-acid);
    padding: 12px 24px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    z-index: 3000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}

#toast.hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.preview-header {
    height: 64px; padding: 0 20px;
    background: rgba(30, 43, 36, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0; z-index: 100;
}

.ph-title { font-weight: 700; color: var(--color-acid); }

.tool-btn {
    background: transparent; border: 1px solid transparent; color: var(--color-text-muted);
    padding: 0.5rem; border-radius: 0.25rem; cursor: pointer; transition: all 0.2s;
}
.tool-btn:hover { color: var(--color-acid); border-color: rgba(212, 255, 95, 0.3); background: rgba(212, 255, 95, 0.05); }
.tool-btn.active { background: var(--color-acid); color: var(--color-root); }

.ph-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.ph-close:hover { border-color: #ef4444; color: #ef4444; }

 
.sort-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s;
    font-weight: 600;
}

.sort-btn:hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
}

.sort-btn.active {
    color: var(--color-acid);
    border-color: var(--color-acid);
    background: rgba(212, 255, 95, 0.05);
}

 
.view-btn {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--color-text-muted);
    border-radius: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}
.view-btn.active {
    border-color: var(--color-acid);
    color: var(--color-acid);
    background: rgba(212, 255, 95, 0.05);
}
.view-btn svg { width: 16px; height: 16px; fill: currentColor; }

 
.preview-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
}
.preview-sidebar {
    width: 280px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 43, 36, 0.3);
    overflow-y: auto;
}
.preview-main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.icon-svg {
    width: 1.2em;
    height: 1.2em;
    fill: currentColor;
    vertical-align: text-bottom;
    display: inline-block;
}

.view-btn .icon-svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.tool-btn .icon-svg {
    width: 18px;
    height: 18px;
}

.logo-icon .icon-svg {
    width: 24px;
    height: 24px;
}

.empty-icon .icon-svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

 
.ph-tag .icon-svg {
    width: 12px;
    height: 12px;
    margin-right: 4px;
}

 
.overview-group {
    margin-bottom: 2rem;
}

.overview-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.overview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.overview-list.detailed {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    width: 100%;
}

.overview-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.overview-card.detailed-card {
    padding: 0;
    overflow: hidden;
    background: var(--ui-surface, #1e293b);
    display: flex;
    flex-direction: column;
}

.overview-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.overview-card.detailed-card:hover {
    background: var(--ui-surface, #1e293b);  
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.overview-card.active {
    border-color: var(--color-acid);
    background: rgba(212, 255, 95, 0.05);
}

.ov-strip {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.ov-color {
    flex: 1;
    height: 100%;
}

.ov-name {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: monospace;
}

 
.ov-card-header {
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.ov-mode-name {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.ov-actions {
    display: flex;
    gap: 0.25rem;
}

.ov-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s;
}

.ov-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--color-text);
    opacity: 1;
    border-color: rgba(255,255,255,0.3);
}

.ov-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ov-color-row {
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 0.7rem;
    font-family: monospace;
    font-weight: 600;
    justify-content: space-between;
}

.ov-color-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.ov-card-footer {
    padding: 0.75rem;
    font-size: 0.75rem;
    font-family: monospace;
    font-weight: 600;
    color: var(--color-text);
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.1);
}

 

 
.preview-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--color-root);
    z-index: 9999;  
    display: flex; flex-direction: column;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease-out;
    color: #cbd5e1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.preview-modal.active { opacity: 1; pointer-events: auto; }

 
.preview-header {
    height: 72px; padding: 0 24px;
    background: var(--color-root);
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0; z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
}

 
.ph-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.ph-title { 
    font-size: 18px; font-weight: 800; color: var(--color-acid); 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    text-transform: uppercase; letter-spacing: 0.05em;
}

 
.status-indicator {
    width: 6px; height: 6px; border-radius: 50%;
    background-color: var(--color-acid);
    box-shadow: 0 0 8px var(--color-acid);
    display: none;  
    flex-shrink: 0;
}
.status-indicator.active { display: block; }

.ph-tag { display: none !important; }

 
.ph-center { 
    flex: 1; display: flex; justify-content: flex-start; align-items: center; gap: 16px; min-width: 0; 
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.ph-center::-webkit-scrollbar { display: none; }
.ph-center > .cmd-group:first-child { margin-left: auto; }
.ph-center > .cmd-group:last-child { margin-right: auto; }

.cmd-group {
    background: rgba(255, 255, 255, 0.02); 
    padding: 6px; border-radius: 8px;
    display: flex; align-items: center; gap: 6px;
    border: 1px solid var(--color-border); 
    flex-shrink: 0;
}

.v-divider { width: 1px; height: 24px; background: var(--color-border); margin: 0 4px; opacity: 0.5; }

.seg-control { display: flex; gap: 2px; background: rgba(0,0,0,0.2); padding: 2px; border-radius: 6px; border: 1px solid var(--color-border); }
.seg-btn {
    background: transparent; border: none; color: #94a3b8;
    padding: 6px 16px; font-size: 11px; font-weight: 700;
    border-radius: 4px; cursor: pointer; transition: all 0.2s; white-space: nowrap;
    text-transform: uppercase; letter-spacing: 0.05em;
    border: 1px solid transparent;
}
.seg-btn:hover { color: var(--color-acid); }
.seg-btn.active { background: var(--color-acid); color: var(--color-root); border-color: var(--color-acid); }

.ph-select {
    background: transparent; color: var(--color-text); border: none; padding: 6px 12px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    border-radius: 4px; outline: none;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.ph-select:hover { background: rgba(255,255,255,0.05); color: var(--color-acid); }
.ph-select option { background: var(--color-root); color: var(--color-text); padding: 8px; }

 
.tool-btn {
    background: transparent; border: 1px solid transparent; color: var(--color-text-muted);
    padding: 0 8px; height: 32px;
    border-radius: 6px; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
    position: relative;
}

.tool-btn:hover { color: var(--color-acid); background: rgba(212, 255, 95, 0.1); border-color: rgba(212, 255, 95, 0.2); }
.tool-btn.active { background: var(--color-acid); color: var(--color-root); border-color: var(--color-acid); }

.tool-btn.icon-only {
    width: 32px; padding: 0; justify-content: center;
}
.tool-btn.icon-only .icon-svg { margin: 0; width: 18px; height: 18px; }

 
.tool-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%; left: 50%; transform: translateX(-50%);
    margin-top: 12px;
    background: #0f172a;
    color: var(--color-acid);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 9999;
    border: 1px solid rgba(212, 255, 95, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    pointer-events: none;
    font-family: monospace; font-weight: 600;
    opacity: 0; animation: tooltipFadeIn 0.2s forwards; animation-delay: 0.1s;
}

.tool-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    margin-left: -5px; margin-top: 7px;
    border-width: 5px; border-style: solid;
    border-color: transparent transparent rgba(212, 255, 95, 0.3) transparent;
    pointer-events: none;
    opacity: 0; animation: tooltipFadeIn 0.2s forwards; animation-delay: 0.1s;
}

@keyframes tooltipFadeIn { from { opacity: 0; transform: translate(-50%, -4px); } to { opacity: 1; transform: translate(-50%, 0); } }

 
.ph-right { 
    display: flex; align-items: center; gap: 12px; margin-left: auto; 
    flex-shrink: 0; max-width: 40%; justify-content: flex-end;
}

 
.preview-header .tool-btn {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    line-height: 30px;  
    text-align: center;
    vertical-align: middle;
}
 
 
.preview-header .tool-btn {
    display: inline-flex; justify-content: center; align-items: center;
}
.preview-header .tool-btn span, 
.preview-header .tool-btn { 
     
}

 
.ph-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.05); border: 1px solid transparent;
    color: var(--color-text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0 !important;  
    transition: all 0.2s;
    flex-shrink: 0;
}
.ph-close::after {
    content: "×";
    font-size: 24px;
    line-height: 1;
    display: block;
    color: inherit;
}
.ph-close:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; border-color: rgba(239, 68, 68, 0.5); }
.ph-close[data-tooltip]:hover::after {  
    content: attr(data-tooltip) " (ESC)";  
    font-size: 11px;
    position: absolute;
    top: 100%; right: 0; left: auto; transform: none;
    margin-top: 12px;
    background: #0f172a;
    color: var(--color-acid);
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 9999;
    border: 1px solid rgba(212, 255, 95, 0.3);
}

.btn-overview {
    border: 1px solid var(--color-border);
    padding: 0 12px;
}


.ph-select:hover { color: var(--color-acid); background: rgba(255,255,255,0.05); border-radius: 4px; }
.ph-select option { background: var(--color-root); color: #cbd5e1; }

.tool-btn {
    width: auto; height: 32px; padding: 0 8px;
    background: transparent; border: 1px solid transparent; color: #94a3b8;
    border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    position: relative; transition: all 0.1s; white-space: nowrap;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.tool-btn:hover { 
    background: rgba(255,255,255,0.05); color: var(--color-acid); 
    border: 1px solid var(--color-acid); 
    box-shadow: none;
    transform: none;
}
.tool-btn:active { transform: translateY(1px); box-shadow: none; }
.tool-btn.active { background: var(--color-acid); color: var(--color-root); border: 1px solid var(--color-acid); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

.tool-btn.icon-only {
    width: 32px;
    padding: 0;
}
.tool-btn.icon-only .icon-svg {
    width: 18px; height: 18px;
    fill: currentColor;
}

.tool-btn[data-tooltip]:hover::after {
    background: #333; color: #fff; 
    border: none; border-radius: 4px;
    font-family: monospace; font-weight: 500; text-transform: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    bottom: -36px;
}
.tool-btn[data-tooltip]:hover::before {
    border-color: transparent transparent var(--color-acid) transparent;
    bottom: -8px;
}

.ph-right { width: auto; display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-shrink: 0; }
.btn-overview { 
    width: auto; padding: 0 12px; font-size: 11px; font-weight: 600; 
    color: #cbd5e1; gap: 6px; border: 1px solid var(--color-border); background: transparent; height: 32px;
    border-radius: 4px; text-transform: uppercase;
}
.btn-overview:hover { border-color: var(--color-acid); color: var(--color-acid); box-shadow: none; background: rgba(255,255,255,0.05); }
.btn-overview.active { background: var(--color-acid); border: 1px solid var(--color-acid); color: var(--color-root); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

.ph-close {
    width: auto; height: 32px; border-radius: 4px; background: transparent; color: var(--color-text-muted); border: 1px solid transparent;
    font-size: 11px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; margin-left: 12px; opacity: 1;
    transition: all 0.1s; padding: 0 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
.ph-close:hover { 
    background: rgba(255, 255, 255, 0.05); color: var(--color-acid); transform: none; 
    border-color: var(--color-acid);
    box-shadow: none; 
}

 
.preview-body { flex: 1; display: grid; grid-template-columns: 280px 1fr; overflow: hidden; }

 
.preview-sidebar {
    background: var(--color-root); 
    border-right: 1px solid var(--color-border);
    display: flex; flex-direction: column; overflow-y: auto;
}
.preview-sidebar::-webkit-scrollbar { width: 8px; background: var(--color-root); border-left: 1px solid var(--color-border); }
.preview-sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; border: 2px solid var(--color-root); }
.preview-sidebar::-webkit-scrollbar-thumb:hover { background: #64748b; }

.sidebar-group-title {
    padding: 16px 20px 12px; font-size: 12px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.05em; position: sticky; top: 0; background: var(--color-root); z-index: 10;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-item {
    padding: 10px 20px; cursor: pointer; border-left: 3px solid transparent; transition: all 0.1s;
    display: flex; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.sidebar-item:hover { 
    background: rgba(255,255,255,0.03); color: #fff; 
    padding-left: 20px;  
}
.sidebar-item:hover .si-name { color: #fff; }
.sidebar-item.active { 
    background: rgba(212, 255, 95, 0.1); 
    border-left-color: var(--color-acid); 
    color: var(--color-acid); 
    border-bottom: 1px solid transparent;
}
.sidebar-item.active .si-name { color: var(--color-acid); font-weight: 600; }
.sidebar-item.active .si-strip { border-color: var(--color-acid); }

.si-name { font-size: 12px; color: #cbd5e1; font-weight: 500; }
.si-strip { display: flex; border-radius: 2px; overflow: hidden; opacity: 1; border: 1px solid var(--color-border); transition: border-color 0.2s; }
.si-color { flex: 1; height: 100%; border-right: 1px solid rgba(0,0,0,0.1); }
.si-color:last-child { border-right: none; }

.preview-sidebar.view-strip .sidebar-item { flex-direction: column; align-items: flex-start; }
.preview-sidebar.view-strip .si-strip { height: 8px; width: 100%; flex-direction: row; border: 1px solid var(--color-border); }
.preview-sidebar.view-card .sidebar-item { flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 20px; }
.preview-sidebar.view-card .si-name { flex: 1; padding-right: 10px; line-height: 1.3; }
.preview-sidebar.view-card .si-strip { width: 40px; height: 40px; flex-direction: column; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); border: 1px solid var(--color-border); }

 
.sidebar-item { 
    position: relative; 
    border: 1px solid transparent; 
    transition: all 0.2s;
} 

 
.sidebar-item .si-strip {
    position: relative;
    overflow: visible; 
}

.sidebar-item.selected {
    border-color: var(--color-acid);
    box-shadow: 0 0 0 1px var(--color-acid);
    background: rgba(212, 255, 95, 0.05);
    z-index: 10;
}

.sidebar-item.selected .si-name {
    color: var(--color-acid);
    font-weight: 700;
}

 
.sidebar-item.selected .si-strip::after {
    content: '✓'; 
    position: absolute; 
    top: -5px; 
    right: -5px;
    width: 16px; height: 16px;
    background: var(--color-acid); 
    color: var(--color-root);
    border-radius: 50%; 
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 10px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 2px solid #18181b;  
    z-index: 20; 
    pointer-events: none;
}

 
.preview-workspace {
    background: #18181b; display: flex; flex-direction: column; position: relative;
    background-image: none;
}

.pw-stage {
    flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 40px; position: relative;
}

#preview-container {
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);  
    transform-origin: center center;
    border-radius: 0;  
    
     
    background: #18181b; 
    border: 1px solid rgba(255,255,255,0.1);
    color: #f3f4f6;
    
    --ui-bg: #ffffff; --ui-surface: #f3f4f6; --ui-primary: #3b82f6; --ui-accent: #6366f1;
    --ui-text-main: #1f2937; --ui-text-sub: rgba(31, 41, 55, 0.6); --ui-border: rgba(31, 41, 55, 0.12);
    --ui-success: #10b981; --ui-danger: #ef4444;
}

 
.preview-modal.env-light #preview-container {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1f2937;
}

.preview-modal.env-neutral #preview-container {
    background: #e5e5e5;
    border-color: #d4d4d8;
    color: #1f2937;
}

 
.pw-overview {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(24, 24, 27, 0.95); z-index: 50; backdrop-filter: blur(8px); padding: 40px; overflow-y: auto; display: none;
    box-sizing: border-box;
}
.pw-overview.active { display: block; }

.overview-header-bar {
    max-width: 1400px; margin: 0 auto 30px; display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-right: 20px; box-sizing: border-box;
}
.overview-header-bar h3 { margin: 0; font-size: 18px; color: #fff; font-weight: 700; }
.overview-header-bar .editable-title {
    outline: none; cursor: text; border-bottom: 1px dashed rgba(255,255,255,0.3); transition: all 0.2s; padding: 2px 5px; border-radius: 4px;
}
.overview-header-bar .editable-title:hover {
    background: rgba(255,255,255,0.1);
}
.overview-header-bar .editable-title:focus {
    background: rgba(255,255,255,0.1); border-bottom-color: var(--color-acid);
}

 
#btnDownloadAll.tool-btn {
    background: var(--color-acid);
    border: 1px solid var(--color-acid);
    color: var(--color-root) !important;
    padding: 0 24px; height: 40px; font-size: 13px; font-weight: 700;
    border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.2s;
    position: relative; overflow: hidden;
    z-index: 1;
    text-transform: uppercase;
    font-family: monospace;
}

#btnDownloadAll.tool-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
    filter: brightness(1.05);
}

#btnDownloadAll.tool-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

#btnDownloadAll.tool-btn .icon-svg {
    width: 18px; height: 18px; fill: currentColor !important; margin-right: 0 !important;
}

 
.preview-modal.env-light #btnDownloadAll.tool-btn {
     
}
.preview-modal.env-light #btnDownloadAll.tool-btn:hover {
     
}
.preview-modal.env-light #btnDownloadAll.tool-btn .icon-svg {
    fill: currentColor !important;
}

 
.overview-grid { 
    display: block; 
    padding-bottom: 50px; 
    max-width: 1400px; 
    margin: 0 auto; 
    padding-right: 20px; 
    box-sizing: border-box; 
}

 
.pw-overview .mini-palette-card { 
    background: #1f2937; 
    border: 1px solid rgba(255,255,255,0.1); 
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    display: flex; flex-direction: column;
    padding: 12px; height: auto; min-height: 0;
    overflow: hidden;
    border-radius: 8px;
}
.pw-overview .mode-name { color: #fff; font-size: 12px; font-weight: 600; margin-bottom: 0; }
.pw-overview .card-header { position: static; width: auto; margin-bottom: 8px; pointer-events: auto; }
.pw-overview .count-badge { background: var(--color-acid); color: var(--color-root); border-radius: 4px; font-weight: 700; }

.pw-overview .mini-swatch-row {
    display: flex; flex-direction: column; height: auto !important; width: 100% !important;
    border-radius: 4px; overflow: hidden; margin: 0; background: none; mask: none;
    border: 1px solid rgba(255,255,255,0.1);
}
.pw-overview .mini-swatch {
    display: flex; width: 100% !important; height: 30px !important; 
    border-radius: 0; border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0 8px; align-items: center; justify-content: flex-end;
}
.pw-overview .mini-swatch:last-child { border-bottom: none; }
.pw-overview .swatch-info { display: flex !important; width: 100%; justify-content: flex-end; gap: 10px; }
.pw-overview .swatch-hex { color: #e2e8f0; font-family: monospace; font-size: 11px; }
.pw-overview .swatch-meta { color: #94a3b8; font-size: 10px; }

.pw-overview .card-footer, 
.pw-overview .pie-slice-overlay,
.pw-overview .preview-btn-icon { display: none !important; }

.pw-overview .mini-palette-card.selected::before {
    display: none;
}

 
.pw-overview .ph-close {
    background: transparent !important;
    color: #ef4444 !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
}
.pw-overview .ph-close:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

 
.selection-feedback {
     
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000; pointer-events: none;

     
    width: 140px; height: 140px;
    background: rgba(20, 20, 23, 0.85);  
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);

     
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px;

     
    opacity: 0;
    transition: all 0.2s;
}

 
.selection-feedback .icon-svg {
    width: 48px; height: 48px;
    color: currentColor;  
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.1));
}

 
.selection-feedback.feedback-success {
    background: var(--color-acid);
    color: var(--color-root);
    border-color: var(--color-acid);
}

 
.selection-feedback.feedback-danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

 
.selection-feedback.animate {
    animation: hudFade 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes hudFade {
    0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
}

 
.pw-shortcuts {
    height: 40px; background: var(--color-root); border-top: 1px solid var(--color-border);
    display: flex; justify-content: center; align-items: center; gap: 30px; font-size: 11px; color: #64748b; flex-shrink: 0;
    font-family: monospace;
}
.kbd {
    background: transparent; padding: 2px 6px; border-radius: 4px; color: var(--color-acid); font-family: monospace; border: 1px solid var(--color-border); margin-right: 6px;
}

 
.ui-layout { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ui-card { background: var(--ui-surface); border-radius: 8px; transition: background 0.3s; border: 1px solid var(--ui-border); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.ui-btn-primary { 
    background: var(--ui-primary); color: white; 
    border: 1px solid var(--ui-primary); border-radius: 6px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    text-transform: uppercase; letter-spacing: 0.05em;
}
.ui-btn-primary:active { transform: translateY(1px); box-shadow: none; }

.ui-text-main { color: var(--ui-text-main); }
.ui-text-sub { color: var(--ui-text-sub); }
.ui-text-primary { color: var(--ui-primary); }
.ui-border-b { border-bottom: 1px solid var(--ui-border); }

 
.web-dashboard {
    width: 960px; height: 640px; background: var(--ui-bg); border-radius: 16px;
    display: flex; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ui-text-main); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

 
.web-dashboard::-webkit-scrollbar {
    width: 10px; height: 10px;
}
.web-dashboard::-webkit-scrollbar-track {
    background: transparent;
}
.web-dashboard::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.4);  
    border: 3px solid transparent;  
    background-clip: content-box;   
    border-radius: 99px;
}
.web-dashboard::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

.wd-sidebar { 
    width: 220px; background: var(--ui-surface); padding: 24px; 
    display: flex; flex-direction: column; gap: 20px; border-right: 1px solid var(--ui-border);
}
.wd-logo { font-size: 18px; font-weight: 800; color: var(--ui-primary); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.wd-nav-item { padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--ui-text-sub); cursor: default; }
.wd-nav-item.active { background: var(--ui-bg); color: var(--ui-text-main); font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.wd-nav-item:hover:not(.active) { border-color: var(--ui-border); color: var(--ui-text-main); }

.wd-main { flex: 1; padding: 32px; display: grid; grid-template-rows: auto 1fr; gap: 24px; background: var(--ui-bg); }
.wd-chart-placeholder { flex: 1; background: var(--ui-surface); border-radius: 12px; position: relative; overflow: hidden; border: 1px solid var(--ui-border); }

 
.mob-frame {
    width: 340px; height: 680px; background: var(--ui-bg); border-radius: 36px;
    border: 8px solid #0f172a; box-shadow: 0 0 0 2px #334155; 
    overflow: hidden; position: relative; display: flex; flex-direction: column; font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.mob-header { height: 56px; display: flex; align-items: center; padding: 0 20px; justify-content: space-between; flex-shrink: 0; background: var(--ui-bg); }
.mob-content { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.mob-content::-webkit-scrollbar { width: 0; } 
.mob-post { padding: 16px; border-radius: 16px; border: 1px solid var(--ui-border); }
.mob-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ui-accent); flex-shrink: 0; }
.mob-row { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.mob-img-ph { width: 100%; height: 160px; background: var(--ui-surface); border-radius: 12px; opacity: 0.8; margin: 12px 0; border: 1px solid var(--ui-border); }
.mob-tabbar { height: 60px; background: var(--ui-surface); display: flex; justify-content: space-around; align-items: center; font-size: 20px; color: var(--ui-text-sub); border-top: 1px solid var(--ui-border); }

 



 
