/* AI tools: remove background, upscale, blur faces */

.ai-stage { min-height: 420px; }
.ai-stage > img { max-width: 100%; max-height: 70vh; border-radius: 4px; box-shadow: 0 14px 34px -14px rgba(18, 40, 38, .4); }
.ai-note { margin: 4px 0 0; line-height: 1.5; }
.ai-hint { margin: 12px 4px 0; }
.ai-warn { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fff4e6; color: #8a4b0f; line-height: 1.45; }
.ai-info { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.ai-info p { margin: 0; display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.ai-info p.ai-warn, .ai-info p.small { display: block; }
.ai-count { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-weight: 600; font-size: .9rem; }
.ai-stop { margin-top: 2px; }

/* before | after */
.ai-cmp { position: relative; display: inline-block; max-width: 100%; line-height: 0; user-select: none; touch-action: pan-y; }
.ai-cmp canvas { display: block; max-width: 100%; max-height: 68vh; height: auto; border-radius: 4px; }
.ai-cmp__after { box-shadow: 0 14px 34px -14px rgba(18, 40, 38, .4); }
.ai-cmp__before { position: absolute; inset: 0; width: 100%; height: 100% !important; max-height: none !important; }
.ai-cmp__line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); pointer-events: none; }
.ai-cmp__knob { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.ai-cmp__knob::before, .ai-cmp__knob::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -5px; border: 5px solid transparent; }
.ai-cmp__knob::before { left: 4px; border-right-color: var(--c); }
.ai-cmp__knob::after { right: 4px; border-left-color: var(--c); }
.ai-cmp__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.ai-cmp__tag { position: absolute; top: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(23, 23, 58, .62); color: #fff; font-size: .75rem; font-weight: 600; line-height: 1.4; pointer-events: none; }
.ai-cmp__tag--l { left: 10px; } .ai-cmp__tag--r { right: 10px; }

/* background colours */
.ai-swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ai-swatch { aspect-ratio: 1; width: 100%; height: auto; padding: 0; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.ai-swatch:hover { transform: translateY(-1px); }
.ai-swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.ai-swatch--pick { background: conic-gradient(#ff6b6b, #ffd43b, #69db7c, #4dabf7, #b197fc, #ff6b6b); }
.ai-swatch--pick::-webkit-color-swatch-wrapper { padding: 0; opacity: 0; }
.ai-swatch--pick::-moz-color-swatch { opacity: 0; }

/* faces */
.ai-faces { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.ai-faces__img { display: block; max-width: 100%; max-height: 68vh; height: auto; border-radius: 4px; box-shadow: 0 14px 34px -14px rgba(18, 40, 38, .4); }
.ai-faces__boxes { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.ai-box { position: absolute; padding: 0; border: 2px solid #fff; border-radius: 10px; background: color-mix(in srgb, var(--c) 18%, transparent); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); cursor: pointer; }
.ai-box:hover { background: color-mix(in srgb, var(--c) 30%, transparent); }
.ai-box.off { border-style: dashed; border-color: rgba(255, 255, 255, .8); background: none; }
.ai-box--new { border-style: dashed; pointer-events: none; }
.ai-box__x { position: absolute; top: -10px; right: -10px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--text); font-size: 14px; line-height: 20px; text-align: center; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
