.bg-remove-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 16px;
}

.bg-remove-head h2 {
    margin-bottom: 6px;
}

.bg-remove-status {
    margin: 0;
    text-align: right;
    max-width: 420px;
}

.bg-upload {
    margin-bottom: 0;
}

.bg-remove-workbench.has-image .bg-upload {
    display: none;
}

.bg-remove-panel[hidden] {
    display: none !important;
}

.bg-remove-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.bg-remove-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.bg-remove-options label {
    font-size: 13px;
    color: var(--muted);
}

.bg-remove-actions {
    margin: 0;
}

.tool-select-sm {
    height: 40px;
    min-width: 140px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 0 10px;
    font-size: 13px;
    color-scheme: light;
    cursor: pointer;
    box-sizing: border-box;
    flex: none;
}

.tool-select-sm option {
    color: #1a2233;
    background: #eef2fb;
}

.progress-wrap {
    margin-bottom: 16px;
}

.progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    transition: width 0.2s ease;
}

.progress-text {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.compare-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.compare-item {
    min-width: 0;
}

.compare-label {
    font-size: 14px;
    margin-bottom: 8px;
    color: #c9d4f5;
}

.compare-frame {
    position: relative;
    min-height: 280px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkerboard {
    background-color: #1a2030;
    background-image:
        linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.compare-frame img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 8px;
    display: none;
}

.compare-frame img.visible {
    display: block;
}

.compare-placeholder {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    padding: 20px;
}

.compare-frame.has-result .compare-placeholder {
    display: none;
}

.file-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.7;
}

.upload-zone-sm {
    border: 2px dashed rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
}

.upload-zone-sm:hover,
.upload-zone-sm.dragover {
    border-color: rgba(91, 124, 250, 0.5);
    background: rgba(91, 124, 250, 0.06);
}

.upload-zone-sm input {
    display: none;
}

.status-msg.success {
    color: #7dcea0;
}

.status-msg.error {
    color: #f08a8a;
}

@media (max-width: 900px) {
    .compare-grid {
        grid-template-columns: 1fr;
    }

    .bg-remove-status {
        text-align: left;
        max-width: none;
    }

    .bg-remove-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .bg-remove-actions {
        justify-content: flex-end;
    }
}
