.blur-mode-picker {
    margin: 1.5rem auto 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1em;
    width: 90%;
    max-width: 500px;
}

.blur-tool-picker {
    margin: 1.5rem auto 1rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.blur-tool-picker-label {
    display: block;
    margin-bottom: .5em;
    font-weight: 400;
    color: #677788;
    text-align: left;
}

.blur-tool-options .form-check-input,
.blur-tool-options .form-check-label {
    cursor: pointer;
}

.blur-strength-wrapper {
    /* shown via showFlexElement() (display: flex) once an image loads, so
       flex-direction has to be set explicitly - otherwise the label and
       slider end up side by side in a row instead of label-above-slider. */
    flex-direction: column;
    margin: 0 auto 1em;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.blur-strength-wrapper label {
    display: block;
    /*margin-bottom: .5em;*/
    font-weight: 600;
    color: #677788;
    white-space: nowrap;
}

.blur-strength-wrapper label[for="blur-strength-input-id"] {
    font-weight: 400;
    text-align: left;
}

.blur-strength-scale {
    display: flex;
    justify-content: space-between;
    font-size: .75em;
    font-weight: 600;
    color: #677788;
}

.blur-strength-input {
    width: 100%;
}

/* Cropper's default "dim everything outside the selection" look is turned
   off in JS (modal: false), so the selection box itself is the only visual
   cue for what part of the photo will be blurred - it needs a bold frame of
   its own rather than Cropper's barely-visible 1px default outline. A white
   ring plus a blue ring (instead of a plain outline) keeps it readable on
   top of any photo, light or dark. */
.cropper-view-box {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #377dff, 0 0 10px rgba(0, 0, 0, .45);
}

/* resize handles (edges + corners) get the same brand blue, at full
   opacity - Cropper ships them nearly invisible (opacity: .1) by default */
.cropper-line,
.cropper-point {
    background-color: #377dff;
    opacity: .9;
}

/* ---------- Brush tool ---------- */

.brush-canvas-wrapper {
    /* shrink-wraps the canvas so the absolutely positioned cursor ring
       lines up with the canvas' own box */
    position: relative;
    width: fit-content;
    max-width: 98%;
    margin: 2em auto 0;
    line-height: 0;
}

.brush-canvas {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    /* stops the page from scrolling/zooming while painting with a finger */
    touch-action: none;
    cursor: none;
}

.brush-cursor {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    /* same white + brand-blue double ring as the Cropper selection box,
       readable on any photo */
    box-shadow: 0 0 0 1px #fff, 0 0 0 2px #377dff, inset 0 0 0 1px #fff;
}

/* eraser mode - red ring instead of the blue one */
.brush-cursor.eraser {
    box-shadow: 0 0 0 1px #fff, 0 0 0 2px #e5484d, inset 0 0 0 1px #fff;
}

/* one row: [Brush | Eraser]  [Undo] [Clear] - wraps on narrow screens */
.brush-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .75em 1.5em;
    margin-bottom: 2em;
}

.brush-mode-toggle .btn {
    display: inline-flex;
    align-items: center;
    gap: .4em;
}

/* active mode gets the filled brand-blue look, so it's obvious which one is on */
.brush-mode-toggle .btn-check:checked + .btn {
    background-color: var(--btn-blue);
    border-color: var(--btn-blue);
    color: var(--light-white);
}

.brush-mode-toggle .btn-check:focus-visible + .btn {
    outline: 2px solid var(--btn-blue);
    outline-offset: 2px;
}

.brush-actions {
    display: flex;
    gap: .5em;
}
