.photo-upload{width:100%;margin:4px 0 16px;padding:11px 16px;border:1px dashed #b8a1c3;border-radius:13px;background:transparent;font-size:13px;font-weight:600}.photo-upload:hover,.photo-upload[aria-pressed=true]{background:#f1e9f5}.photo-dialog{width:min(440px,calc(100% - 24px));max-height:90svh;overflow:auto;border:1px solid #dfd4df;border-radius:24px;background:#faf7f2;color:#302d38;padding:22px;box-shadow:0 25px 90px #24172e40}.photo-dialog::backdrop{background:#21152688;backdrop-filter:blur(4px)}.photo-dialog h2{margin:0;font-size:24px}.photo-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.photo-head button{border:0;background:transparent;font-size:26px;min-width:44px;min-height:44px}.photo-dialog p{font-size:13px;line-height:1.5;margin:10px 0}.photo-dialog button:not(.photo-head button){padding:11px 16px;border:1px solid #d7cbd9;border-radius:12px;background:transparent;min-height:44px}.photo-dialog #photo-pick{width:100%;background:#eee5f2}.photo-dialog #photo-make{background:#302d38;color:#fff}.photo-dialog button:disabled{opacity:.4;cursor:default}.photo-dialog canvas{display:block;width:min(100%,320px);height:auto;aspect-ratio:1;margin:4px auto;touch-action:none;cursor:grab}.photo-dialog [hidden]{display:none!important}.photo-empty{padding:30px 12px;text-align:center;color:#85788c}.photo-dialog label{font-size:13px;display:flex;gap:12px;align-items:center;justify-content:space-between;margin:12px 0}.photo-dialog select{font:inherit;border-radius:8px;padding:7px;background:transparent;color:inherit;border:1px solid #cbbdcd}.photo-dialog input[type=range]{width:70%;accent-color:#9761b4}.photo-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.photo-dialog #photo-remove{border:0;text-decoration:underline;font-size:12px;padding:6px}.photo-status{min-height:20px;color:#725a7b}.photo-privacy{color:#807585;font-size:12px!important}[data-theme=night] .photo-dialog{background:#282431;color:#f7edf7;border-color:#51445b}[data-theme=night] .photo-upload:hover,[data-theme=night] .photo-upload[aria-pressed=true],[data-theme=night] .photo-dialog #photo-pick{background:#3a3044}[data-theme=night] .photo-dialog #photo-make{background:#e7cee9;color:#302d38}[data-theme=night] .photo-privacy,[data-theme=night] .photo-status{color:#c4b2ce}

/* Keep the editor canvas in normal layout; the game's global canvas is absolute. */
#photo-dialog #photo-preview{position:relative;inset:auto;top:auto;bottom:auto;left:auto;right:auto;transform:none;z-index:auto;display:block;width:min(100%,300px);height:auto;max-height:none;aspect-ratio:1;flex-shrink:0;margin:8px auto;cursor:grab}
.photo-confirmation{padding:12px 16px;border-radius:12px;background:#e7efce;color:#3f5c32;text-align:center;font-weight:700;font-size:18px}
.photo-dialog #photo-start{background:#302d38;color:#fff;width:100%;font-weight:600}
[data-theme=night] .photo-dialog #photo-start{background:#e7cee9;color:#302d38}
@media(prefers-reduced-motion:no-preference){.photo-confirmation{animation:photo-ready .2s ease-out}@keyframes photo-ready{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}}

.photo-sources{display:flex;gap:8px;flex-wrap:wrap}.photo-dialog .photo-sources #photo-pick{width:auto;flex:1}.photo-dialog #photo-camera{flex:1;white-space:nowrap;background:#eee5f2}[data-theme=night] .photo-dialog #photo-camera{background:#3a3044}

/* Only the editor body scrolls; the header and primary actions stay visible. */
#photo-dialog{box-sizing:border-box;width:min(484px,calc(100% - 24px));max-height:calc(100svh - 24px);padding:0;overflow:hidden}
#photo-dialog[open]{display:flex;flex-direction:column}
#photo-dialog .photo-head{flex:none;padding:16px 22px 4px}
#photo-dialog .photo-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 22px 12px}
#photo-dialog .photo-actions{flex:none;margin:0;padding:12px 22px max(16px,env(safe-area-inset-bottom));border-top:1px solid #dfd4df;background:#faf7f2}
#photo-dialog .photo-actions button{min-height:48px;flex:1}
#photo-dialog #photo-preview{width:min(100%,280px,36svh);margin:0 auto}
[data-theme=night] #photo-dialog .photo-actions{background:#282431;border-color:#51445b}
@media(max-height:600px){#photo-dialog .photo-head{padding-top:8px}#photo-dialog .photo-head h2{font-size:20px}#photo-dialog .photo-actions{padding-top:8px;padding-bottom:8px}}
