.j3d-cmp__widget {
    max-width: 100%;
}

.j3d-cmp__widget [hidden] {
    display: none !important;
}

.j3d-cmp__section {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #eceef5;
}

.j3d-cmp__section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.j3d-cmp__section h2 {
    margin: 0 0 16px;
    color: #3d4a5c;
    font-size: 19px;
}

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

.j3d-cmp__card {
    box-sizing: border-box;
    padding: 16px;
    background: #fafbfe;
    border: 1px solid #eceef5;
    border-radius: 8px;
    min-width: 0;
}

.j3d-cmp__card-title {
    margin: 0 0 6px;
    color: #2d3748;
    font-size: 16px;
}

.j3d-cmp__card-hint {
    margin: 0 0 14px;
    color: #7a8499;
    font-size: 13px;
}

.j3d-cmp__dropzone {
    padding: 18px 12px;
}

.j3d-cmp__card-preview {
    margin-top: 14px;
}

.j3d-cmp__thumb {
    display: block;
    max-width: 100%;
    max-height: 140px;
    margin: 0 0 10px;
    border: 1px solid #dfe3ed;
    border-radius: 6px;
    background: #f1f3f8;
}

.j3d-cmp__card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 0 12px;
}

.j3d-cmp__card-info dt {
    color: #7a8499;
    font-size: 11px;
}

.j3d-cmp__card-info dd {
    margin: 2px 0 0;
    color: #2d3748;
    font-weight: 600;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.j3d-cmp__card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.j3d-cmp__card-actions .btn-u {
    box-sizing: border-box;
    min-height: 44px;
    flex: 1 1 100px;
}

.j3d-cmp__card-error {
    min-height: 19px;
    margin: 10px 0 0;
    color: #c53030;
    font-size: 13px;
}

.j3d-cmp__card-warning {
    min-height: 19px;
    margin: 8px 0 0;
    color: #9c6b0a;
    font-size: 13px;
}

.j3d-cmp__global-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.j3d-cmp__global-actions .btn-u {
    box-sizing: border-box;
    min-height: 44px;
    flex: 1 1 180px;
}

.j3d-cmp__mismatch-warning {
    min-height: 19px;
    margin: 14px 0 0;
    color: #9c6b0a;
    font-size: 14px;
}

.j3d-cmp__mode-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.j3d-cmp__mode-buttons .btn-u {
    box-sizing: border-box;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 140px;
}

.j3d-converter .j3d-cmp__mode-buttons .is-active {
    background: #424cb9;
    border-color: #424cb9;
    color: #fff;
}

.j3d-cmp__empty {
    margin: 0;
    padding: 30px 16px;
    text-align: center;
    color: #7a8499;
    background: #f1f3f8;
    border: 1px dashed #dfe3ed;
    border-radius: 8px;
    font-size: 14px;
}

.j3d-cmp__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 640px;
    margin: 0 auto;
    overflow: hidden;
    background: #f1f3f8;
    border: 1px solid #dfe3ed;
    border-radius: 8px;
    touch-action: none;
}

.j3d-cmp__layer {
    position: absolute;
    inset: 0;
}

.j3d-cmp__layer--before {
    z-index: 1;
}

.j3d-cmp__layer--after {
    z-index: 2;
}

.j3d-cmp__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.j3d-cmp__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: #98a2b8;
    background: #eef0f7;
    font-size: 13px;
    text-align: center;
}

.j3d-cmp__divider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(45, 55, 72, .25);
    z-index: 3;
    pointer-events: none;
}

.j3d-cmp__handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #424cb9;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(45, 55, 72, .3);
    cursor: ew-resize;
    z-index: 4;
    touch-action: none;
}

.j3d-cmp__handle:focus-visible {
    outline: 3px solid #424cb9;
    outline-offset: 2px;
}

.j3d-cmp__handle.is-dragging {
    background: #eef0ff;
}

.j3d-cmp__handle-icon {
    width: 14px;
    height: 14px;
    border-left: 2px solid #424cb9;
    border-right: 2px solid #424cb9;
}

.j3d-cmp__readout {
    margin: 12px 0 0;
    color: #5a6278;
    font-size: 14px;
    text-align: center;
}

.j3d-cmp__field {
    margin-top: 18px;
}

.j3d-cmp__field > label {
    display: block;
    margin-bottom: 7px;
    color: #4a5568;
    font-size: 13px;
    font-weight: 600;
}

.j3d-cmp__constant-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.j3d-cmp__constant-row input[type="range"] {
    flex: 1 1 100px;
    min-height: 30px;
    accent-color: #424cb9;
}

.j3d-cmp__constant-value {
    color: #424cb9;
    font-size: 13px;
    white-space: nowrap;
}

.j3d-cmp__side-stage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.j3d-cmp__side-figure {
    margin: 0;
}

.j3d-cmp__side-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f3f8;
    border: 1px solid #dfe3ed;
    border-radius: 8px;
}

.j3d-cmp__side-figure figcaption {
    margin-top: 8px;
    color: #5a6278;
    font-size: 13px;
    text-align: center;
}

.j3d-cmp__instructions {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #eceef5;
}

.j3d-cmp__instructions h2 {
    margin: 0 0 16px;
    color: #3d4a5c;
    font-size: 19px;
}

@media (max-width: 900px) {
    .j3d-cmp__cards,
    .j3d-cmp__side-stage {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .j3d-cmp__widget {
        padding: 0;
    }

    .j3d-cmp__global-actions .btn-u,
    .j3d-cmp__mode-buttons .btn-u {
        flex: 1 1 100%;
    }

    .j3d-cmp__frame {
        max-height: 420px;
    }
}
