.photo-editor[hidden]{display:none}
.photo-editor{position:absolute;inset:0;z-index:30;background:#111;display:flex;flex-direction:column;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);color:#fff}
.editor-header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;padding:10px 12px;flex-shrink:0}
.photo-editor button{min-height:44px;background:#191919;color:#fff;border:1px solid #666;padding:8px 12px;font-size:14px;font-weight:700;cursor:pointer}
.editor-header button{border:0;background:transparent}
#editApply{background:#fff;color:#000}
.photo-editor button:disabled{opacity:.35;cursor:default}
.editor-stage{position:relative;flex:1;min-height:100px;overflow:hidden;background:#000}
#editCanvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;touch-action:none}
.editor-controls{flex-shrink:0;padding:12px 16px;background:#111;max-height:45%;overflow:auto}
.editor-tools{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-bottom:10px}.editor-tools button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:64px;padding:7px 1px;white-space:nowrap;font-size:14px;line-height:1.2}.editor-tools svg{flex-shrink:0}
.editor-tools button[aria-pressed=true]{background:#fff;color:#000;border-color:#fff}
.editor-controls label{display:flex;align-items:center;gap:14px;font-size:14px;margin:6px 0;min-height:28px}
.editor-controls input{flex:1;min-width:0;accent-color:#fff}
@media(orientation:landscape){.photo-editor{display:grid;grid-template-columns:minmax(0,1fr) min(360px,48%);grid-template-rows:auto minmax(0,1fr)}.editor-header{grid-column:1/-1}.editor-controls{max-height:none;padding:10px;overflow:auto}.editor-stage{min-height:0}}

.brush-preview{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);border:2px solid #fff;border-radius:50%;pointer-events:none;box-sizing:border-box}.brush-preview[hidden]{display:none}

.editor-history{display:flex;gap:8px}.editor-history button{font-size:28px;line-height:1;min-width:44px;padding:6px}.brush-preview{will-change:width,height}

#editCancel{justify-self:start}#editApply{justify-self:end}.editor-history{justify-self:center}.editor-history button{display:grid;place-items:center}.redo-arrow{transform:scaleX(-1)}

#penColorControls[hidden]{display:none}#penColor{flex:0 0 44px;width:44px;height:36px;border:1px solid #666;padding:2px;background:transparent;cursor:pointer}

.editor-zoom{position:absolute;right:10px;bottom:10px;display:flex;gap:2px;z-index:2}.editor-zoom button{background:#111b;min-width:40px;padding:6px;font-size:16px}.editor-zoom #zoomReset{min-width:60px;font-size:14px}
