/* Local retouch demonstration. Image, masks, selection and cursor share one coordinate space. */
.retouch-workbench { --dust-one: 1; --dust-two: 1; --scratch-left: 62%; --cursor-x: 27%; --cursor-y: 50%; --sample-x: 60%; --sample-y: 38%; --cursor-opacity: 0; --sample-opacity: 0; --selection-one: 0; --selection-two: 0; --ants: 0; display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #0b0b0b; }
.retouch-document { display: flex; flex-direction: column; min-width: 0; }
.retouch-document-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 56px; padding: 15px 22px; border-bottom: 1px solid var(--line); color: #ccc; font-size: 14px; }
.retouch-document-bar > span:last-child { color: var(--muted); font-size: 12px; }
.retouch-canvas { position: relative; width: calc(100% - 48px); aspect-ratio: 1672 / 941; overflow: hidden; isolation: isolate; margin: auto 24px; background: #30291e; }
.retouch-base, .retouch-defect, .retouch-defect > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: fill; }
.retouch-defect { pointer-events: none; }
.retouch-dust-one { opacity: var(--dust-one); mask-image: radial-gradient(ellipse 4.6% 8.1% at 35.2% 40%, #000 62%, transparent 100%); }
.retouch-dust-two { opacity: var(--dust-two); mask-image: radial-gradient(ellipse 2.6% 4.6% at 54.3% 58.4%, #000 60%, transparent 100%); }
.retouch-scratch { mask-image: radial-gradient(ellipse 9.5% 8% at 71.1% 45.3%, #000 70%, transparent 100%); clip-path: inset(0 0 0 var(--scratch-left)); }
.retouch-selection { position: absolute; inset: 0; width: 100%; height: 100%; color: #fff; fill: none; stroke-width: 1.2; pointer-events: none; }
.retouch-selection path, .retouch-selection rect { stroke: #fff; stroke-dasharray: 5 4; stroke-dashoffset: var(--ants); vector-effect: non-scaling-stroke; filter: drop-shadow(0 1px 1px #000); }
.retouch-selection-one { opacity: var(--selection-one); }
.retouch-selection-two { opacity: var(--selection-two); }
.retouch-cursor { position: absolute; left: var(--cursor-x); top: var(--cursor-y); z-index: 3; width: 25px; height: 25px; transform: translate(-50%,-50%); border: 1px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgb(0 0 0 / 45%); opacity: var(--cursor-opacity); pointer-events: none; }
.retouch-cursor span { position: absolute; inset: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / 45%); }
[data-retouch-state="select"] .retouch-cursor { width: 11px; height: 11px; border-radius: 1px; }
[data-retouch-state="select"] .retouch-cursor span { display: none; }
[data-retouch-state="heal"] .retouch-cursor { box-shadow: 0 0 0 5px rgb(255 255 255 / 13%), 0 0 0 1px rgb(0 0 0 / 55%); }
[data-retouch-state="sample"] .retouch-cursor { width: 20px; height: 20px; }
[data-retouch-state="sample"] .retouch-cursor span { inset: 7px; }
[data-retouch-state="stamp"] .retouch-cursor { width: 27px; height: 27px; box-shadow: 0 0 0 var(--stamp-pulse, 3px) rgb(255 255 255 / 15%), 0 0 0 1px rgb(0 0 0 / 55%); }
.retouch-sample { position: absolute; left: var(--sample-x); top: var(--sample-y); width: 17px; height: 17px; transform: translate(-50%,-50%); opacity: var(--sample-opacity); pointer-events: none; filter: drop-shadow(0 1px 1px #000); }
.retouch-sample > i, .retouch-sample > b { position: absolute; background: #fff; }
.retouch-sample > i { width: 17px; height: 1px; left: 0; top: 8px; }
.retouch-sample > b { height: 17px; width: 1px; left: 8px; top: 0; }
.retouch-image-label { position: absolute; left: 12px; bottom: 12px; padding: 4px 8px; background: rgb(0 0 0 / 63%); border-radius: 3px; color: #fff; font-size: 12px; line-height: 1.6; pointer-events: none; }
.retouch-document-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 12px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.retouch-original { flex-shrink: 0; min-height: 36px; padding: 6px 10px; border: 1px solid #555; border-radius: 4px; background: transparent; color: #ddd; font-size: 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
.retouch-original:hover, .retouch-original[aria-pressed="true"] { border-color: #ddd; color: #fff; }
[data-retouch-original="true"] .retouch-dust-one, [data-retouch-original="true"] .retouch-dust-two { opacity: 1; }
[data-retouch-original="true"] .retouch-scratch { clip-path: inset(0); }
[data-retouch-original="true"] .retouch-cursor, [data-retouch-original="true"] .retouch-sample, [data-retouch-original="true"] .retouch-selection { visibility: hidden; }
.retouch-assistant { display: flex; flex-direction: column; min-width: 0; padding: 24px; border-left: 1px solid var(--line); background: #101010; }
.retouch-assistant-title { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.retouch-assistant-title > svg { width: 24px; height: 24px; }
.retouch-assistant-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.retouch-request { margin-top: 26px; }
.retouch-request > span { color: var(--muted); font-size: 12px; }
.retouch-request > p { margin-top: 8px; color: #eee; font-size: 16px; line-height: 1.85; }
.retouch-operations { margin-top: 24px; border-top: 1px solid var(--line); }
.retouch-operations > div { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--muted); transition: color .25s; }
.retouch-operations > div > svg { width: 20px; height: 20px; }
.retouch-operations > div > span { font-size: 14px; }
.retouch-operations small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.retouch-operations i { margin-left: auto; color: #777; font-size: 12px; font-style: normal; }
.retouch-operations .is-current, .retouch-operations .is-done { color: #eee; }
.retouch-operations .is-current small, .retouch-operations .is-done small { color: var(--muted); }
.retouch-operations .is-current > svg { color: var(--accent); }
.retouch-result-note { min-height: 48px; margin-top: 20px; color: #bbb; font-size: 14px; line-height: 1.8; }
.retouch-values { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; padding-top: 24px; color: var(--muted); font-size: 14px; }
.retouch-unavailable { display: none; }
[data-retouch-state="unavailable"] .retouch-defect, [data-retouch-state="unavailable"] .retouch-selection, [data-retouch-state="unavailable"] .retouch-cursor, [data-retouch-state="unavailable"] .retouch-sample { display: none; }
@media (min-width: 961px) { .retouch-canvas { margin-block: auto; } .retouch-document::before, .retouch-document::after { content: ''; min-height: 22px; flex: 1; } .retouch-document-bar { order: -1; } .retouch-document-footer { order: 2; } }
@media (max-width: 1100px) { .retouch-workbench { grid-template-columns: minmax(0,1.45fr) minmax(285px,1fr); } .retouch-assistant { padding: 22px 20px; } .retouch-canvas { width: calc(100% - 32px); margin-inline: 16px; } }
@media (max-width: 960px) { .retouch-workbench { grid-template-columns: 1fr; } .retouch-canvas { margin-block: 20px; } .retouch-assistant { border-left: 0; border-top: 1px solid var(--line); } .retouch-operations { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; } .retouch-operations > div { align-items: flex-start; padding-block: 18px; } .retouch-operations i { display: none; } .retouch-request { margin-top: 18px; } .retouch-request > p { max-width: 640px; } .retouch-result-note { min-height: 0; } }
@media (max-width: 600px) { .retouch-document-bar, .retouch-document-footer { padding-inline: 14px; } .retouch-document-bar { font-size: 12px; } .retouch-document-footer { flex-wrap: wrap; } .retouch-canvas { width: 100%; margin: 0; } .retouch-assistant { padding: 22px 18px; } .retouch-operations { gap: 10px; } .retouch-operations > div { flex-direction: column; gap: 8px; } .retouch-operations small { line-height: 1.7; } .retouch-operations > div > span { font-size: 12px; } .retouch-values { gap: 12px; font-size: 12px; } .retouch-cursor { width: 18px; height: 18px; } .retouch-cursor span { inset: 6px; } .retouch-image-label { left: 8px; bottom: 8px; } }
@media (prefers-reduced-motion: reduce) { .retouch-operations > div { transition: none; } }
