/* Match the existing target/content modals; keep changes scoped to this step. */
.target-adjustment .modal-dialog { width: min(440px, calc(100% - 24px)); margin: 12px auto; }
.target-adjustment .modal-content { border: 0; border-radius: 28px; overflow: hidden; }
/* Start your Magoo's language (2026-10-24): 24 px padding, 24 px between blocks. */
.target-adjustment .target-adjustment-header { padding: 24px 24px 0; flex: none; }
.target-adjustment .modal-heading-3 { margin: 0; font-size: 23px; }
.target-adjustment .target-adjustment-body { padding: 24px; }
.target-adjustment [data-editor] { display: flex; flex-direction: column; gap: 24px; }
.target-adjustment p.target-adjustment-copy { margin: 0; padding: 0; font-size: 15px; line-height: 1.5; text-align: center; color: #0F133A; }
.target-adjustment p.target-adjustment-note { padding: 0; margin: 0; color: #5E6070; font-size: 13px; line-height: 1.45; text-align: center; }
/* The canvas fills the stage; the script fits the image inside it with room for the corner handles. */
.target-adjustment-stage { position: relative; width: 100%; height: clamp(220px, calc(100vh - 430px), 460px); height: clamp(220px, calc(100dvh - 430px), 460px); border-radius: 10px; overflow: hidden; background: #00000081; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.target-adjustment-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; }
.target-adjustment-canvas:active { cursor: grabbing; }
.target-adjustment-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.target-adjustment button:disabled { opacity: .55; cursor: wait; }
.target-adjustment button:focus-visible { outline: 3px solid #FFB242; outline-offset: 3px; }
.target-adjustment canvas:focus-visible { outline: 3px solid #FFB242; outline-offset: -3px; }
.target-adjustment-corner-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.target-adjustment-corner-tools label { font-size: 13px; color: #0F133A; }
.target-adjustment-corner-tools select { margin-top: 4px; }
.target-adjustment p.target-adjustment-error { color: #CC0000; padding: 0; font-size: 14px; margin: 12px 0 0; }
.target-adjustment [hidden] { display: none !important; }
.target-adjustment .modal-body { border-radius: 0; }

/* Keep the image within the visible screen; the original file is unchanged. */
.target-adjustment .modal-dialog-scrollable { height: calc(100vh - 24px); height: calc(100dvh - 24px); }
.target-adjustment .target-adjustment-actions { position: sticky; bottom: -24px; z-index: 1; background: #fff; padding: 12px 0; }
@media (max-width: 480px), (max-height: 600px) {
    .target-adjustment .target-adjustment-actions { bottom: -24px; gap: 8px; }
    .target-adjustment p.target-adjustment-copy { font-size: 14px; line-height: 1.4; }
    .target-adjustment p.target-adjustment-note { font-size: 12px; }
}

/* Small screens: while moving corners the editor takes the whole screen, so the
   image is as large as possible: one line of guidance on top, actions below. */
@media (max-width: 575.98px), (max-height: 600px) {
    .target-adjustment--editing .modal-dialog { width: 100%; max-width: none; margin: 0; height: 100vh; height: 100dvh; }
    .target-adjustment--editing .modal-content { height: 100%; max-height: none; border-radius: 0; background: #fff; }
    /* Still full screen, with the same header as every window (24 px). */
    .target-adjustment--editing .target-adjustment-header { padding: 24px 24px 0; padding-top: max(24px, env(safe-area-inset-top)); }
    .target-adjustment--editing .modal-heading-3 { font-size: 19px; }
    .target-adjustment--editing .target-adjustment-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
    .target-adjustment--editing [data-editor] { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 24px; }
    .target-adjustment--editing p.target-adjustment-copy { margin: 0; font-size: 14px; line-height: 1.35; }
    .target-adjustment--editing .target-adjustment-stage { flex: 1 1 auto; height: auto; min-height: 120px; }
    /* Dragging replaces the corner picker and its hint on touch screens. */
    .target-adjustment--editing .target-adjustment-corner-tools,
    .target-adjustment--editing p.target-adjustment-note { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    .target-adjustment--editing .target-adjustment-actions { position: static; flex-direction: row-reverse; align-items: center; gap: 12px; margin-top: 0; padding: 0; }
    .target-adjustment--editing .target-adjustment-actions .flow-primary { flex: 1 1 auto; width: auto; }
    .target-adjustment--editing .target-adjustment-actions .flow-secondary { flex: none; }
    .target-adjustment--editing p.target-adjustment-error { margin: -12px 0 0; text-align: center; }
    .target-adjustment--editing p.target-adjustment-error:empty { display: none; }
}
