.madp-toolbar-crop {
    gap: 6px;
}

.madp-toolbar-crop:not(:disabled) {
    color: #0f7f69;
    background: #effaf7;
    border-color: #79d2bd;
}

.madp-image-cropper {
    z-index: 2147483645;
    display: grid;
    place-items: center;
    padding: 20px;
    position: fixed;
    inset: 0;
}

.madp-image-cropper__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(8, 19, 39, .72);
}

.madp-image-cropper > section {
    z-index: 1;
    width: min(920px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    color: #17233f;
    background: #fff;
    border-radius: 16px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(5, 15, 33, .42);
}

.madp-image-cropper header,
.madp-image-cropper footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
}

.madp-image-cropper header {
    border-bottom: 1px solid #e1e7ed;
}

.madp-image-cropper header > div {
    display: grid;
    gap: 3px;
}

.madp-image-cropper header strong {
    font-size: 17px;
}

.madp-image-cropper header span {
    color: #788398;
    font-size: 11px;
}

.madp-image-cropper header button {
    width: 34px;
    height: 34px;
    color: #17233f;
    background: #f1f4f7;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
}

.madp-image-cropper main {
    min-height: 0;
    padding: 20px;
    overflow: auto;
}

.madp-image-cropper__preview {
    min-height: 320px;
    padding: 16px;
    background: #eef2f5;
    border-radius: 12px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.madp-image-cropper__stage {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 56vh;
    line-height: 0;
    overflow: hidden;
    user-select: none;
}

.madp-image-cropper__stage > img {
    display: block;
    max-width: 100%;
    max-height: 56vh;
    width: auto;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
    box-shadow: 0 8px 26px rgba(23, 35, 63, .16);
}

.madp-image-cropper__selection {
    position: absolute;
    border: 2px solid #fff;
    cursor: move;
    touch-action: none;
    box-shadow: 0 0 0 9999px rgba(8, 19, 39, .58), inset 0 0 0 1px rgba(23, 174, 143, .85);
}

.madp-image-cropper__selection::before,
.madp-image-cropper__selection::after {
    content: "";
    pointer-events: none;
    position: absolute;
    inset: 0;
}

.madp-image-cropper__selection::before {
    border-left: 1px solid rgba(255, 255, 255, .45);
    border-right: 1px solid rgba(255, 255, 255, .45);
    left: 33.333%;
    right: 33.333%;
}

.madp-image-cropper__selection::after {
    border-top: 1px solid rgba(255, 255, 255, .45);
    border-bottom: 1px solid rgba(255, 255, 255, .45);
    top: 33.333%;
    bottom: 33.333%;
}

.madp-image-cropper__handle {
    position: absolute;
    z-index: 2;
    width: 14px;
    height: 14px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #20ae8e;
    box-shadow: 0 2px 7px rgba(8, 19, 39, .35);
    touch-action: none;
}

.madp-image-cropper__handle.is-n { top: 0; left: 50%; cursor: ns-resize; transform: translate(-50%, -50%); }
.madp-image-cropper__handle.is-ne { top: 0; right: 0; cursor: nesw-resize; transform: translate(50%, -50%); }
.madp-image-cropper__handle.is-e { top: 50%; right: 0; cursor: ew-resize; transform: translate(50%, -50%); }
.madp-image-cropper__handle.is-se { right: 0; bottom: 0; cursor: nwse-resize; transform: translate(50%, 50%); }
.madp-image-cropper__handle.is-s { bottom: 0; left: 50%; cursor: ns-resize; transform: translate(-50%, 50%); }
.madp-image-cropper__handle.is-sw { bottom: 0; left: 0; cursor: nesw-resize; transform: translate(-50%, 50%); }
.madp-image-cropper__handle.is-w { top: 50%; left: 0; cursor: ew-resize; transform: translate(-50%, -50%); }
.madp-image-cropper__handle.is-nw { top: 0; left: 0; cursor: nwse-resize; transform: translate(-50%, -50%); }

.madp-image-cropper__help {
    margin: 12px 0 0;
    color: #68758a;
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
}

.madp-image-cropper__error {
    color: #a43740;
    background: #fff1f2;
    border: 1px solid #efc0c4;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11px;
    line-height: 1.45;
}

.madp-image-cropper footer {
    justify-content: flex-end;
    background: #f8fafb;
    border-top: 1px solid #e1e7ed;
}

.madp-image-cropper footer button {
    min-height: 40px;
    padding: 0 16px;
    color: #26364e;
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.madp-image-cropper footer button.is-primary {
    color: #fff;
    background: #23ae8f;
    border-color: #23ae8f;
}

.madp-image-cropper footer button.is-reset {
    margin-right: auto;
}

.madp-image-cropper footer button:disabled {
    cursor: wait;
    opacity: .55;
}

@media (max-width: 720px) {
    .madp-image-cropper {
        padding: 8px;
    }

    .madp-image-cropper > section {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .madp-image-cropper__preview {
        min-height: 220px;
    }
}
