.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;
}

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

.split-panel.is-empty {
    opacity: 0.94;
}

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

.source-preview {
    min-height: 240px;
    border: 1px solid #dbe7f2;
    border-radius: 18px;
    background: #f8fbfe;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.source-placeholder {
    color: #6b7f92;
    text-align: center;
    padding: 1rem;
}

.source-detail {
    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.15fr 0.85fr;
    gap: 1rem;
}

.control-card {
    padding: 1rem 1.1rem;
    border: 1px solid #dbe7f2;
    border-radius: 18px;
    background: #fff;
}

.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;
}

.custom-grid {
    display: grid;
    gap: 0.8rem;
}

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

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

.tool-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;
}

.result-panel {
    border: 1px solid #dbe7f2;
    border-radius: 18px;
    background: #fff;
    padding: 1rem 1.1rem;
}

.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-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.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;
}

.slice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.slice-card {
    border: 1px solid #dbe7f2;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.slice-card img {
    display: block;
    width: 100%;
    background: #f8fbfe;
}

.slice-body {
    padding: 0.8rem;
}

.slice-title {
    color: #102a43;
    font-weight: 700;
}

.slice-meta {
    margin-top: 0.35rem;
    color: #6b7f92;
    font-size: 0.85rem;
}

.slice-download {
    margin-top: 0.65rem;
    width: 100%;
}

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

    .result-header {
        flex-direction: column;
    }
}
