.photo-editor { width: min(900px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; border: 1px solid #aaa; border-radius: 10px; padding: 1rem; background: #fff; color: #212121; }
.photo-editor::backdrop { background: #000a; }
.photo-editor h2 { font-size: 1.3rem; margin-bottom: .5rem; }
.photo-editor p { font-size: .9rem; margin: .5rem 0; }
.photo-editor-stage { height: clamp(180px, 43dvh, 460px); width: 100%; background: #222; }
.photo-editor-stage > canvas { display: block; max-width: 100%; max-height: 100%; }
.photo-editor-stage > video, .photo-editor-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-editor-tools, .photo-editor-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .7rem 0; }
.photo-editor-actions { position: sticky; bottom: -1rem; padding: .5rem 0; margin-bottom: 0; background: #fff; z-index: 2; }
.photo-editor button { padding: .65rem; border: 1px solid #1976d2; color: #1565c0; background: #fff; border-radius: 4px; cursor: pointer; }
.photo-editor button[data-action="use"] { background: #1976d2; color: #fff; }
.photo-editor button:disabled { opacity: .5; cursor: default; }
.photo-editor-bounds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; border: 1px solid #aaa; }
.photo-editor-bounds label { margin: 0; }
.photo-editor-bounds input { min-width: 0; }
.upload-draft { max-width: 160px; max-height: 120px; object-fit: contain; display: block; margin-top: .5rem; }
html[data-theme="dark"] .photo-editor-actions { background: #252b34; }
html[data-theme="dark"] .photo-editor { background: #252b34; color: #eee; }
@media (max-width: 500px) { .photo-editor-stage { height: 30dvh; min-height: 180px; } .photo-editor { padding: .65rem; } .photo-editor-bounds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
