.upload-zone {
    border: 2px dashed #bfd5e7;
    border-radius: 20px;
    padding: 2rem 1.25rem;
    text-align: center;
    cursor: pointer;
    background: #f8fbfe;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-zone.drag-over {
    border-color: #2d74b9;
    background: #eef6ff;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.65rem;
}

.upload-text {
    color: #102a43;
    font-weight: 700;
}

.upload-hint {
    margin-top: 0.45rem;
    color: #52667a;
    line-height: 1.7;
}

.stitch-panel {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.source-info {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 0.95fr);
    gap: 1rem;
    align-items: start;
}

.source-preview {
    min-height: 260px;
    border: 1px solid #dbe7f2;
    border-radius: 18px;
    background: #f8fbfe;
    padding: 0.9rem;
}

.multi-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 0.75rem;
    align-content: start;
}

.preview-thumb {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dbe7f2;
}

.preview-thumb img {
    display: block;
    width: 100%;
    height: 96px;
    object-fit: cover;
}

.preview-thumb span {
    position: absolute;
    left: 0.45rem;
    top: 0.45rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(16, 42, 67, 0.78);
    color: #fff;
    font-size: 0.75rem;
}

.source-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: #6b7f92;
    text-align: center;
}

.source-detail,
.control-card,
.result-panel,
.sort-list {
    padding: 1rem 1.1rem;
    border: 1px solid #dbe7f2;
    border-radius: 18px;
    background: #fff;
}

.source-name {
    color: #102a43;
    font-size: 1.08rem;
    font-weight: 700;
}

.source-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.65rem;
}

.source-meta span,
.field-value {
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: #eef4f8;
    color: #35506b;
    font-size: 0.86rem;
}

.source-note,
.field-hint {
    margin-top: 0.8rem;
    color: #52667a;
    line-height: 1.7;
    font-size: 0.92rem;
}

.control-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 0.8fr;
    gap: 1rem;
}

.form-label {
    display: block;
    color: #102a43;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.mode-option input {
    display: none;
}

.mode-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    background: #eef4f8;
    color: #35506b;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.mode-option input:checked + .mode-tag {
    background: #0f4c81;
    color: #fff;
}

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.range-input,
.number-input,
.color-input {
    width: 100%;
}

.range-input {
    margin: 0.5rem 0 0.9rem;
}

.number-input {
    max-width: 96px;
    padding: 0.65rem 0.75rem;
    border: 1px solid #c8d7e5;
    border-radius: 12px;
    font-size: 0.96rem;
}

.color-input {
    max-width: 96px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
}

.tool-actions,
.result-actions {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-primary {
    background: #0f4c81;
    color: #fff;
}

.btn-secondary {
    background: #edf3f7;
    color: #27445d;
}

.sort-list {
    display: grid;
    gap: 0.7rem;
}

.sort-item {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.55rem;
    border-radius: 14px;
    background: #f8fbfe;
}

.sort-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
}

.sort-name {
    color: #102a43;
    font-weight: 700;
}

.sort-meta {
    color: #6b7f92;
    font-size: 0.84rem;
    margin-top: 0.25rem;
}

.sort-actions {
    display: flex;
    gap: 0.45rem;
}

.sort-btn {
    border: 0;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    background: #ddeaf4;
    color: #27445d;
    cursor: pointer;
}

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.result-title {
    color: #102a43;
    font-size: 1.12rem;
    font-weight: 700;
}

.result-sub {
    margin-top: 0.35rem;
    color: #52667a;
    line-height: 1.65;
}

.result-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1rem;
}

.metric-card {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: #f8fbfe;
    border: 1px solid #e0eaf2;
}

.metric-label {
    display: block;
    color: #6b7f92;
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
}

.metric-value {
    color: #102a43;
    font-size: 1rem;
}

.single-result .preview-card {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 18px;
    background: #f8fbfe;
}

.preview-label {
    color: #102a43;
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.single-result img {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 14px;
}

@media (max-width: 960px) {
    .source-info,
    .control-grid,
    .result-metrics {
        grid-template-columns: 1fr;
    }

    .result-header,
    .sort-item {
        grid-template-columns: 1fr;
    }
}
