.photo-cropper-header {
    margin-bottom: 18px;
}

.photo-cropper {
    display: grid;
    gap: 18px;
}

.photo-cropper-workspace {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    min-width: 0;
}

.photo-upload-panel,
.photo-queue-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 22px;
    min-width: 0;
}

.crop-format-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.format-option {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.format-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.format-option span {
    font-weight: 700;
}

.format-option small {
    color: var(--muted);
}

.format-option.is-selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(29, 95, 209, 0.18);
}

.drop-zone {
    min-height: 270px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #eef6ff);
    text-align: center;
    color: var(--muted);
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.drop-zone strong {
    color: var(--text);
}

.drop-zone.is-dragging {
    border-color: var(--accent);
    background: #e0edff;
    transform: translateY(-1px);
}

.drop-zone-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.drop-zone-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.processing-status {
    min-height: 42px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--muted);
    font-size: 0.92rem;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.queue-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.queue-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.56;
}

.queue-header h2 {
    margin-bottom: 4px;
}

.photo-queue {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.empty-state {
    grid-column: 1 / -1;
    min-height: 210px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 6px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--text);
}

.crop-result-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.crop-thumb {
    width: 100%;
    border: 0;
    padding: 0;
    display: grid;
    place-items: center;
    background:
        linear-gradient(45deg, #edf5ff 25%, transparent 25% 75%, #edf5ff 75%),
        linear-gradient(45deg, #edf5ff 25%, #fff 25% 75%, #edf5ff 75%);
    background-position: 0 0, 10px 10px;
    background-size: 20px 20px;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    cursor: pointer;
}

.crop-thumb:focus-visible {
    outline: 3px solid rgba(29, 95, 209, 0.5);
    outline-offset: 3px;
}

.crop-result-card[data-format="1x1"] .crop-thumb {
    aspect-ratio: 1 / 1;
}

.crop-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.crop-card-meta {
    display: grid;
    gap: 2px;
}

.crop-card-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crop-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.crop-card-actions button,
.crop-card-actions .button-secondary {
    padding: 10px;
    min-height: 40px;
}

.photo-review-card {
    width: min(980px, 100%);
    border-radius: 8px;
}

.review-layout {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 280px;
    gap: 22px;
    align-items: start;
}

.review-editor-frame {
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #1d2b40;
    padding: 16px;
    min-height: 460px;
}

.review-editor-frame canvas {
    width: 100%;
    max-width: 680px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 16px 32px rgba(8, 37, 76, 0.16);
    background: #162236;
    cursor: move;
    touch-action: none;
}

.review-details {
    display: grid;
    gap: 12px;
}

.review-detail {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.review-detail span {
    color: var(--muted);
    font-size: 0.86rem;
}

.review-actions {
    display: grid;
    gap: 10px;
}

@media (max-width: 980px) {
    .photo-cropper-workspace,
    .review-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .crop-format-selector,
    .crop-card-actions {
        grid-template-columns: 1fr;
    }

    .queue-header,
    .queue-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .review-editor-frame {
        min-height: 320px;
        padding: 10px;
    }
}
