.profile-photo-crop-dialog {
    --crop-surface: #f8fafc;
    --crop-ink: #162c49;
    --crop-muted: #43566d;
    --crop-line: #afbecf;
    --crop-accent: #214f94;
    --crop-danger: #9d283a;
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(27rem, calc(100% - 1.5rem));
    max-width: none;
    min-width: 0;
    max-height: calc(100% - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    margin: auto;
    padding: clamp(.8rem, 4vw, 1.2rem);
    border: 1px solid var(--crop-line);
    border-radius: 16px;
    background: var(--crop-surface);
    color: var(--crop-ink);
    text-align: start;
}
.profile-photo-crop-dialog::backdrop { background: rgb(12 24 44 / .64); }
:is(.dark, [data-bs-theme="dark"]) .profile-photo-crop-dialog {
    --crop-surface: #13243a;
    --crop-ink: #f5f8ff;
    --crop-muted: #c3d2e4;
    --crop-line: #637a96;
    --crop-accent: #365f9b;
    --crop-danger: #ffbdc8;
}
.profile-photo-crop-dialog h2 {
    margin: 0 0 .35rem;
    color: var(--crop-ink);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}
.profile-photo-crop-dialog p {
    margin: 0;
    color: var(--crop-muted);
    font-size: .9rem;
    line-height: 1.4;
}
.profile-photo-crop-frame {
    width: min(100%, 19rem);
    width: min(100%, 19rem, 46dvh);
    margin: .85rem auto .55rem;
    overflow: hidden;
    border-radius: 9px;
    background: #dbe4ec;
}
.profile-photo-crop-frame canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}
.profile-photo-crop-frame canvas:active { cursor: grabbing; }
.profile-photo-crop-controls,
.profile-photo-crop-actions { display: flex; align-items: center; gap: .6rem; }
.profile-photo-crop-controls { margin-top: .35rem; }
.profile-photo-crop-controls label { margin: 0; font-size: .9rem; }
.profile-photo-crop-controls input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 0;
    accent-color: var(--crop-accent);
}
.profile-photo-crop-dialog button {
    min-height: 44px;
    padding: .45rem .8rem;
    border: 1px solid var(--crop-line);
    border-radius: 8px;
    background: var(--crop-surface);
    color: var(--crop-ink);
    font-size: .9rem;
    font-weight: 650;
    white-space: nowrap;
}
.profile-photo-crop-actions {
    justify-content: flex-end;
    margin-top: .65rem;
    padding-top: .65rem;
    border-top: 1px solid var(--crop-line);
}
.profile-photo-crop-dialog [data-crop-confirm] {
    border-color: var(--crop-accent);
    background: var(--crop-accent);
    color: white;
}
.profile-photo-crop-dialog button:disabled { opacity: .6; }
.profile-photo-crop-dialog :is(button, input, canvas):focus-visible {
    outline: 3px solid #669be1;
    outline-offset: -3px;
}
.profile-photo-crop-dialog .profile-photo-crop-error {
    margin: .35rem 0;
    color: var(--crop-danger);
}
.profile-photo-preview {
    display: block;
    width: 88px;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
}
