.photo-edit.story-dialog{position:fixed;inset:var(--viewport-top,0px) 0 auto;margin:0 auto;width:min(100%,760px);height:var(--viewport-height,calc(100 * var(--ui-dvh)));max-width:100%;max-height:none;padding:0;border:0;border-radius:0;background:#10201c;color:#ecfff5;overflow:hidden}
.photo-edit[open]{display:flex;flex-direction:column}.photo-edit *{box-sizing:border-box}.photo-edit-head{display:flex;align-items:center;gap:6px;flex:none;padding:calc(var(--ui-safe-top) + 8px) 10px 8px;background:#10251d}.photo-edit-head strong{flex:1}.photo-edit button{cursor:pointer}.photo-edit-head button,.photo-edit-selection button,.photo-edit-footer button{border:0;border-radius:16px;min-width:44px;min-height:44px;background:#244c3e;color:#ecfff5;padding:8px 12px}.photo-edit-head [data-undo],.photo-edit-head [data-redo]{font-size:23px;padding:6px}.photo-edit-footer .primary,.photo-edit .photo-text-form .primary{background:#78e4bb;color:#123125}.photo-edit button:disabled{opacity:.4;cursor:default}
.photo-edit-body{position:relative;flex:1;min-height:80px;display:flex;align-items:center;justify-content:center;overflow:hidden}.photo-edit-image{position:relative;flex:none;max-width:100%;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.photo-edit-image img,.photo-edit-image canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}.photo-edit-image img{object-fit:contain;pointer-events:none}.photo-edit-image canvas{outline:none}
.photo-edit .scene-toolbar{top:10px;right:8px;left:auto;flex-direction:column;max-height:calc(100% - 20px)}.photo-edit .scene-toolbar button{min-width:0}.photo-edit .scene-toolbar [aria-pressed=true]{background:#78e4bb;color:#123125}
.photo-edit-selection{flex:none;display:flex;gap:8px;align-items:center;padding:6px 12px;background:#16372d}.photo-edit-selection label{flex:1;margin:0;min-width:0;display:flex;gap:8px;align-items:center;font-size:12px}.photo-edit-selection input{min-width:0;width:100%;margin:0}.photo-edit-settings{flex:none;max-height:35%;overflow:auto;padding:10px 12px;background:#16372d;border-radius:20px 20px 0 0}.photo-edit [hidden]{display:none!important}.photo-edit input[type=range]{accent-color:#78e4bb;min-height:32px;padding:0}.photo-edit input[type=color]{width:44px;height:32px;padding:2px;border:0;border-radius:8px}.photo-edit label{color:#ecfff5}.photo-brush-colors{display:flex;gap:10px}.photo-brush-colors button{width:36px;height:36px;border-radius:50%;border:2px solid #ffffff55}.photo-brush-row{display:flex;gap:12px;align-items:center;margin-top:6px}.photo-brush-row label{flex:1;min-width:0;font-size:11px;margin:0}.photo-brush-row label:first-child{flex:0 0 44px}.photo-brush-row input[type=range]{width:100%}.photo-brush-sample{width:60px;height:36px;flex:none;background:#ffffff18;border-radius:8px}.photo-edit-footer{display:flex;align-items:center;gap:8px;flex:none;padding:6px 12px calc(var(--ui-safe-bottom) + 8px);background:#10251d}.photo-edit-footer span{flex:1;font-size:12px;color:#c5e0d2}.photo-edit-footer button{font-size:12px}.photo-edit .scene-emojis{grid-template-columns:repeat(8,1fr);gap:6px}.photo-edit .scene-emojis button{min-width:0;min-height:44px;padding:4px;font-size:27px}.photo-text-form{display:grid;gap:8px}.photo-text-form textarea{width:100%;resize:none;background:#244c3e;color:#fff;border:1px solid #466a5b;font:16px/1.3 system-ui;border-radius:12px;padding:10px}.photo-text-form>div{display:flex;align-items:center;justify-content:space-between}.photo-text-form label{display:flex;align-items:center;gap:8px;margin:0;font-size:12px}.photo-text-form button{border:0;border-radius:16px;min-height:44px;padding:8px 16px}.keyboard-open .photo-edit-head{padding-top:8px}.keyboard-open .photo-edit-footer{padding-bottom:8px}.keyboard-open .photo-edit-settings{max-height:60%}.keyboard-open .photo-edit .scene-toolbar{display:none}
.photo-draft-preview{width:44px;height:48px;object-fit:cover;border-radius:8px}.compose-context .photo-draft-edit{flex:none;border:0;border-radius:12px;color:var(--ink);background:var(--soft);min-height:40px;padding:8px;font-size:12px}
@media(max-width:400px){.photo-edit .scene-emojis{grid-template-columns:repeat(6,1fr)}.photo-brush-sample{width:36px}.photo-edit-head{gap:3px}.photo-edit-head button{padding:6px 9px}.photo-edit-selection{gap:5px}.photo-edit-selection button{padding:6px 8px}}
/* Keep the canvas frame still when the first object is selected under a finger. */
.photo-edit-selection{height:56px}.photo-edit .photo-edit-selection[hidden]{display:flex!important;visibility:hidden;height:56px}

.photo-edit-selection{position:relative}.photo-edit-selection[hidden]:before{content:attr(data-hint);position:absolute;inset:0;display:grid;place-items:center;visibility:visible;font-size:12px;color:#c5e0d2;pointer-events:none}
.photo-edit-image{background:#fff}
.keyboard-open .photo-edit-selection,.keyboard-open .photo-edit-footer{display:none!important}.keyboard-open .photo-edit-body{min-height:20px}.keyboard-open .photo-edit-settings{max-height:calc(var(--viewport-height,calc(100 * var(--ui-dvh))) - 70px)}

.photo-edit-footer [data-status]:empty{display:none}.photo-edit-footer [data-done]{margin-left:auto;font-size:16px;min-width:110px}
