.j3d-normal-gen__panel {
    margin-top: 24px;
}

.j3d-normal-gen__settings {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
    align-items: flex-end;
    margin-bottom: 22px;
}

.j3d-normal-gen__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}

.j3d-normal-gen__field label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

.j3d-normal-gen__field input[type="range"] {
    width: 100%;
    accent-color: var(--j3d-primary, #424cb9);
}

.j3d-normal-gen__field--checkbox {
    flex-direction: row;
    align-items: center;
    min-width: 0;
}

.j3d-normal-gen__field--checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
    color: #2d3748;
}

.j3d-normal-gen__directions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    min-width: 240px;
    margin: 0;
    padding: 0;
    border: 0;
}

.j3d-normal-gen__directions legend {
    width: 100%;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
}

.j3d-normal-gen__directions label {
    cursor: pointer;
    color: #2d3748;
}

.j3d-normal-gen__directions input {
    margin-right: 5px;
    accent-color: var(--j3d-primary, #424cb9);
}

.j3d-normal-gen__file-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #fafbfe;
    border: 1px solid #eceef5;
    border-radius: 8px;
}

.j3d-normal-gen__file-info div {
    min-width: 150px;
}

.j3d-normal-gen__file-info dt {
    font-size: 12px;
    color: #7a8499;
}

.j3d-normal-gen__file-info dd {
    margin: 3px 0 0;
    color: #2d3748;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.j3d-normal-gen__previews {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.j3d-normal-gen__preview {
    min-width: 0;
    margin: 0;
}

.j3d-normal-gen__preview figcaption {
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.j3d-normal-gen__image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f1f3f8;
    background-image: linear-gradient(45deg, #e5e8f0 25%, transparent 25%), linear-gradient(-45deg, #e5e8f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e8f0 75%), linear-gradient(-45deg, transparent 75%, #e5e8f0 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
    border: 1px solid #dfe3ed;
    border-radius: 8px;
}

.j3d-normal-gen__image-wrap img,
.j3d-normal-gen__image-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 520px;
    object-fit: contain;
}

.j3d-normal-gen__compare-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    background-color: #f1f3f8;
}

.j3d-normal-gen__compare {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
    color: #2d3748;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #dfe3ed;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
    touch-action: none;
}

.j3d-normal-gen__compare:focus-visible {
    outline: 2px solid var(--j3d-primary, #424cb9);
    outline-offset: 2px;
}

.j3d-normal-gen__status {
    min-height: 22px;
    margin: 18px 0 12px;
    color: #4a5568;
}

.j3d-normal-gen__status.is-error {
    color: #a12622;
}

.j3d-normal-gen__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.j3d-normal-gen__actions .btn-u,
.j3d-normal-gen__actions .btn-u-default {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.j3d-normal-gen__actions [aria-disabled="true"] {
    pointer-events: none;
    opacity: .55;
}

.j3d-normal-gen__links {
    margin-top: 18px;
    color: #4a5568;
}

@media (max-width: 640px) {
    .j3d-normal-gen__settings {
        align-items: stretch;
    }

    .j3d-normal-gen__field,
    .j3d-normal-gen__directions {
        min-width: 0;
    }

    .j3d-normal-gen__directions {
        flex-direction: column;
        gap: 8px;
    }

    .j3d-normal-gen__previews {
        grid-template-columns: 1fr;
    }

    .j3d-normal-gen__image-wrap {
        min-height: 130px;
    }
}
