/**
 * 21C Systems — Image Editor shell styles.
 *
 * Visual chrome is Styler-driven (Image Editor category). Defaults here match
 * component-baselines.json; live overrides apply via CssEmitter (!important).
 */

.c21-image-editor {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    box-sizing: border-box;
    background: #f6f7f7;
    border-style: solid;
    border-width: 1px;
    border-color: #c3c4c7;
    border-radius: 0.75rem;
    padding: 1rem;
}


.c21-image-editor[hidden] {
    display: none !important;
}


.c21-image-editor__viewport-wrap {
    flex: 3 1 20rem;
    min-width: 0;
    overflow: auto;
    max-height: 28rem;
}


.c21-image-editor__viewport {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100%;
    min-height: 12rem;
    box-sizing: border-box;
    cursor: grab;
    background: #1c1830;
    border-radius: 0.5rem;
}


.c21-image-editor__viewport:active {
    cursor: grabbing;
}


.c21-image-editor--crop-active .c21-image-editor__viewport {
    touch-action: none;
    cursor: crosshair;
}


.c21-image-editor__canvas {
    display: block;
    margin: 0 auto;
}


/* Hidden probe — Styler colours for canvas crop overlay (mask / border / guides). */
.c21-image-editor__crop-overlay {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.5);
    border-style: solid;
    border-width: 2px;
    border-color: #ffffff;
    color: rgba(255, 255, 255, 0.35);
}


.c21-image-editor__controls {
    flex: 1 1 12rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    box-sizing: border-box;
    background: #ffffff;
    border-style: solid;
    border-width: 1px;
    border-color: #dcdcde;
    border-radius: 0.5rem;
    padding: 0.75rem;
}


.c21-image-editor__crop-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}


.c21-image-editor__crop-actions > .c21-image-editor__control {
    flex: 1 1 auto;
}


.c21-image-editor__controls--crop > *:not(.c21-image-editor__crop-actions):not([data-capability="crop"]) {
    display: none;
}


@media (max-width: 640px) {
    .c21-image-editor {
        flex-direction: column;
    }

    .c21-image-editor__viewport-wrap,
    .c21-image-editor__controls {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* High specificity — theme button resets otherwise strip border/background. */
.c21-auth-app .c21-image-editor .c21-image-editor__control,
.c21-image-editor .c21-image-editor__control,
button.c21-image-editor__control {
    box-sizing: border-box;
    display: inline-block;
    width: 100%;
    margin: 0;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    color: #1c1830;
    background: #f3f0ff;
    border-style: solid;
    border-width: 2px;
    border-color: #000;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}


.c21-auth-app .c21-image-editor .c21-image-editor__control:hover,
.c21-auth-app .c21-image-editor .c21-image-editor__control:focus,
.c21-image-editor .c21-image-editor__control:hover,
.c21-image-editor .c21-image-editor__control:focus,
button.c21-image-editor__control:hover,
button.c21-image-editor__control:focus {
    text-decoration: none;
    filter: none;
    color: #1c1830;
    background: #e8e2ff;
    border-color: #7b66ff;
}


.c21-auth-app .c21-image-editor .c21-image-editor__control:disabled,
.c21-image-editor .c21-image-editor__control:disabled,
button.c21-image-editor__control:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}


.c21-auth-app .c21-image-editor .c21-image-editor__control--primary,
.c21-auth-app .c21-image-editor .c21-image-editor__control--active,
.c21-image-editor .c21-image-editor__control--primary,
.c21-image-editor .c21-image-editor__control--active,
button.c21-image-editor__control--primary,
button.c21-image-editor__control--active {
    color: #ffffff;
    background: #7b66ff;
    border-color: #7b66ff;
}


.c21-auth-app .c21-image-editor .c21-image-editor__control--primary:hover,
.c21-auth-app .c21-image-editor .c21-image-editor__control--primary:focus,
.c21-auth-app .c21-image-editor .c21-image-editor__control--active:hover,
.c21-auth-app .c21-image-editor .c21-image-editor__control--active:focus,
.c21-image-editor .c21-image-editor__control--primary:hover,
.c21-image-editor .c21-image-editor__control--primary:focus,
.c21-image-editor .c21-image-editor__control--active:hover,
.c21-image-editor .c21-image-editor__control--active:focus,
button.c21-image-editor__control--primary:hover,
button.c21-image-editor__control--primary:focus,
button.c21-image-editor__control--active:hover,
button.c21-image-editor__control--active:focus {
    color: #ffffff;
    background: #6a55ee;
    border-color: #6a55ee;
}


.c21-image-editor__range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    color: #1c1830;
    font-size: 0.875rem;
}


.c21-image-editor__range-input {
    flex: 1 1 8rem;
    min-width: 6rem;
}


.c21-image-editor__range-value {
    font-variant-numeric: tabular-nums;
}


.c21-image-editor__colour,
.c21-image-editor__checkbox {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    color: #1c1830;
    font-size: 0.875rem;
}


.c21-image-editor__exact-dims {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
    width: 100%;
}


.c21-image-editor__exact-lock {
    align-self: center;
}


.c21-image-editor__exact-dim {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}


.c21-image-editor__exact-dim-input {
    max-width: 100%;
}


/*
 * Native <input type="color"> — one simple border only (no padding/background
 * “frame” and no second border on the inner swatch, which caused a nested box).
 */
.c21-auth-app .c21-image-editor .c21-image-editor__colour-input,
.c21-image-editor .c21-image-editor__colour-input,
input.c21-image-editor__colour-input[type="color"] {
    box-sizing: border-box;
    display: inline-block;
    width: 2.75rem;
    height: 2.25rem;
    margin: 0;
    padding: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    border-style: solid;
    border-width: 2px;
    border-color: #000;
    border-radius: 0.35rem;
}


.c21-auth-app .c21-image-editor .c21-image-editor__colour-input::-webkit-color-swatch-wrapper,
.c21-image-editor .c21-image-editor__colour-input::-webkit-color-swatch-wrapper,
input.c21-image-editor__colour-input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}


.c21-auth-app .c21-image-editor .c21-image-editor__colour-input::-webkit-color-swatch,
.c21-image-editor .c21-image-editor__colour-input::-webkit-color-swatch,
input.c21-image-editor__colour-input[type="color"]::-webkit-color-swatch {
    border: none;
}


.c21-auth-app .c21-image-editor .c21-image-editor__colour-input::-moz-color-swatch,
.c21-image-editor .c21-image-editor__colour-input::-moz-color-swatch,
input.c21-image-editor__colour-input[type="color"]::-moz-color-swatch {
    border: none;
}


.c21-image-editor__done {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}


.c21-image-editor__done-btn,
.c21-image-editor__cancel-btn {
    flex: 1 1 8rem;
    width: auto;
}
