.solo-photo-editor{padding:0;width:min(520px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border:0;border-radius:20px;background:var(--surface,#fff);color:var(--ink,#202022);box-shadow:0 16px 60px #0002;overflow:auto;overscroll-behavior:contain}
.solo-photo-editor::backdrop{background:rgb(20 15 18 / .6)}
.photo-editor-header{position:sticky;top:0;z-index:2;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 20px 14px;background:var(--surface,#fff)}
.photo-editor-header h2{font-size:20px;line-height:1.4}.photo-editor-header p{font-size:12px;color:var(--muted,#646068);margin-top:5px;word-break:keep-all;overflow-wrap:anywhere}
.solo-photo-editor button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:44px;border:0;border-radius:12px;padding:8px;color:inherit;background:var(--soft,#f6eef1);font-size:13px;font-weight:650;transition:transform .16s ease,background-color .16s ease}
.solo-photo-editor button:active:not(:disabled){transform:scale(.97)}.solo-photo-editor button:disabled{opacity:.42;cursor:not-allowed}.solo-photo-editor button:focus-visible,.solo-photo-editor canvas:focus-visible,.solo-photo-editor input:focus-visible{outline:3px solid var(--focus,var(--accent,#c83569));outline-offset:3px}
.photo-editor-header>button{flex:none;background:transparent;border-radius:50%}.photo-editor-header>button:hover{background:var(--soft,#f6eef1)}
.photo-editor-body{padding:0 20px 16px}.photo-editor-stage{position:relative;aspect-ratio:4/5;width:min(100%,calc(48dvh * .8));margin:0 auto;overflow:hidden;border-radius:12px;background:var(--soft,#f6eef1);isolation:isolate}
.photo-editor-stage canvas{width:100%;height:100%;display:block;object-fit:contain;touch-action:none;cursor:move}
.photo-editor-grid{position:absolute;inset:0;pointer-events:none;background:linear-gradient(to right,transparent calc(100% / 3 - .5px),#fff7 calc(100% / 3 - .5px),#fff7 calc(100% / 3 + .5px),transparent calc(100% / 3 + .5px),transparent calc(200% / 3 - .5px),#fff7 calc(200% / 3 - .5px),#fff7 calc(200% / 3 + .5px),transparent calc(200% / 3 + .5px)),linear-gradient(to bottom,transparent calc(100% / 3 - .5px),#fff7 calc(100% / 3 - .5px),#fff7 calc(100% / 3 + .5px),transparent calc(100% / 3 + .5px),transparent calc(200% / 3 - .5px),#fff7 calc(200% / 3 - .5px),#fff7 calc(200% / 3 + .5px),transparent calc(200% / 3 + .5px))}
.photo-editor-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:20px;font-size:13px;background:var(--soft,#f6eef1)}.photo-editor-loading[hidden]{display:none}
.photo-editor-position{font-size:11px;text-align:center;color:var(--muted,#646068);margin:9px 0 16px}.photo-editor-error{color:var(--danger,#b53349);font-size:12px;word-break:keep-all;overflow-wrap:anywhere;margin:8px 0 12px}
.photo-editor-zoom label{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:0}.photo-editor-zoom output{font-weight:500;color:var(--muted,#646068);font-variant-numeric:tabular-nums}.photo-editor-zoom input{display:block;height:44px;width:100%;padding:0;border:0;accent-color:var(--accent,var(--green,#c83569));background:transparent;cursor:pointer}
.photo-editor-tools{display:flex;justify-content:space-between;gap:6px;margin-top:8px;flex-wrap:wrap}.photo-editor-direction,.photo-editor-transform{display:flex;gap:6px}.photo-editor-transform button:last-child{padding-inline:12px}
.photo-editor-footer{position:sticky;bottom:0;display:grid;grid-template-columns:1fr 2fr;gap:10px;padding:14px 20px max(14px,env(safe-area-inset-bottom));background:var(--surface,#fff);border-top:1px solid var(--line,#e8e1e5);z-index:1}.photo-editor-footer button{min-height:48px}.photo-editor-footer .photo-editor-apply{background:var(--accent,var(--green,#c83569));color:var(--on-accent,var(--surface,#fff))}.photo-editor-footer .photo-editor-cancel{background:transparent}
@media(max-width:360px){.photo-editor-header{padding:16px 14px 12px}.photo-editor-body{padding-inline:14px}.photo-editor-footer{padding-inline:14px}.photo-editor-tools{gap:10px}.photo-editor-tools button{min-width:44px}.photo-editor-transform{margin-left:auto}}
/* Short screens reserve room for two rows of 44px tools and the sticky footer. */
@media(max-height:640px){.photo-editor-stage{width:min(100%,calc(22dvh * .8))}.photo-editor-position{margin:6px 0 8px}.photo-editor-body{padding-bottom:12px}}
@media(prefers-reduced-motion:reduce){.solo-photo-editor button{transition:none}.solo-photo-editor button:active:not(:disabled){transform:none}}
