#mm-profile .profile-launch{max-width:780px}
#mm-profile .profile-launch .muted{margin-bottom:0}
#mm-profile #mm-profile-editor{position:fixed;inset:0;width:min(1120px,calc(100vw - 40px));height:min(880px,calc(100vh - 40px));height:min(880px,calc(100dvh - 40px));max-width:none;max-height:none;margin:auto;padding:0;border:1px solid #dfd3d8;border-radius:16px;background:#f7f4f0;color:#261a20;overflow:hidden;box-shadow:0 20px 100px #0005}
#mm-profile #mm-profile-editor::backdrop{background:#1b111ddd}
#mm-profile #mm-profile-editor.profile-dialog-fallback{z-index:5000}
#mm-profile .profile-editor-shell{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden}
#mm-profile .profile-editor-header{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:14px 18px}
#mm-profile .profile-editor-header strong{flex:1;min-width:0;font-family:Oswald,sans-serif;font-size:23px;color:#562239}
#mm-profile .profile-editor-shell button{min-height:40px;margin:0;padding:9px 12px;font-size:12px}
#mm-profile .profile-editor-header .status{flex-basis:100%;margin:0;font-size:12px;line-height:1.35;min-height:0}
#mm-profile .profile-editor-header .status:empty{display:none}
#mm-profile .profile-grid{grid-template-columns:minmax(0,1.2fr) minmax(300px,1fr);grid-template-rows:minmax(0,1fr);gap:16px;min-height:0;padding:0 18px}
#mm-profile .profile-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0;gap:8px;overflow:hidden}
#mm-profile .profile-controls{display:grid;grid-template-rows:auto minmax(0,1fr);min-height:0;overflow:hidden;border:1px solid #dfd3d8;border-radius:10px;background:#fff}
#mm-profile .profile-targets{padding:10px;background:#f7f4f0;border-bottom:1px solid #dfd3d8}
#mm-profile .profile-targets button{flex:1}
#mm-profile .profile-settings-scroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:14px;scrollbar-gutter:stable}
#mm-profile .profile-settings-scroll h3{font-size:20px}
#mm-profile .profile-adjustments{padding:0;border:0;margin:14px 0 0;min-width:0}
#mm-profile .profile-adjustments:disabled{opacity:.5}
#mm-profile .profile-adjustments label{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:12px}
#mm-profile output{color:#562239;font-variant-numeric:tabular-nums;font-weight:800;white-space:nowrap}
#mm-profile input[type=range]{accent-color:#562239;border:0;padding:0;min-height:32px;margin:4px 0 8px;cursor:pointer}
#mm-profile details{margin:8px 0}
#mm-profile details>summary{padding:12px 0}
#mm-profile .chips{gap:6px}
#mm-profile .profile-modes button{flex:1}
#mm-profile button[aria-pressed=true]{box-shadow:inset 0 0 0 2px #d4aa33}
#mm-profile .profile-canvas-wrap{position:relative;flex:none;overflow:hidden;border-radius:10px;background:#20151c;width:min(100%,420px,calc(100vh - 240px));width:min(100%,420px,calc(100dvh - 240px));aspect-ratio:1}
#mm-profile #mm-profile-canvas{width:100%;height:auto;margin:0;border-radius:0;display:block}
#mm-profile #mm-profile-canvas.editable{touch-action:none;cursor:grab}
#mm-profile #mm-profile-canvas.editable:active{cursor:grabbing}
#mm-profile .profile-canvas-wrap.round-preview::after{content:'';pointer-events:none;position:absolute;inset:0;border-radius:50%;border:2px solid #fff8ed99;box-shadow:0 0 0 999px #0006}
#mm-profile .profile-preview-tools{display:flex;align-items:center;justify-content:space-between;gap:14px;width:min(100%,420px)}
#mm-profile .profile-round-toggle{display:flex;align-items:center;gap:7px;min-height:28px}
#mm-profile #mm-photo-round{display:inline-block;width:18px;height:18px;margin:0;accent-color:#562239}
#mm-profile #mm-photo-gesture-tip{margin:0;text-align:center;font-size:12px;line-height:1.4}
#mm-profile .profile-editor-footer{padding:12px 18px 14px;background:#fff;border-top:1px solid #dfd3d8;margin-top:12px}
#mm-profile .profile-exports{display:flex;gap:8px}
#mm-profile .profile-exports button{min-height:44px}
#mm-profile #mm-photo-download{flex:1}
#mm-profile .profile-editor-footer .status{min-height:0;max-height:3em;overflow:auto;font-size:12px;line-height:1.4;margin:6px 0 0}
#mm-profile .profile-editor-footer .status:empty{margin:0}
#mm-profile .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:740px){
  #mm-profile #mm-profile-editor{width:100vw;height:100vh;height:100dvh;margin:0;border:0;border-radius:0}
  #mm-profile .profile-editor-header{padding:max(10px,env(safe-area-inset-top)) 12px 10px}
  #mm-profile .profile-editor-header strong{font-size:20px}
  #mm-profile .profile-editor-header button{padding:8px 10px}
  #mm-profile .profile-grid{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px;padding:0 10px}
  #mm-profile .profile-preview{gap:4px}
  #mm-profile .profile-canvas-wrap{width:min(100%,260px,32vh);width:min(100%,260px,32dvh)}
  #mm-profile .profile-preview-tools{width:min(100%,300px)}
  #mm-profile .profile-preview-tools .muted{font-size:10px}
  #mm-profile .profile-targets{padding:8px}
  #mm-profile .profile-settings-scroll{padding:12px}
  #mm-profile .profile-editor-footer{padding:10px 12px max(10px,env(safe-area-inset-bottom));margin-top:8px}
}
@media(max-height:520px) and (orientation:landscape){
  #mm-profile #mm-profile-editor{width:100vw;height:100vh;height:100dvh;margin:0;border:0;border-radius:0}
  #mm-profile .profile-grid{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);grid-template-rows:minmax(0,1fr)}
  #mm-profile .profile-canvas-wrap{width:min(100%,calc(100vh - 205px));width:min(100%,calc(100dvh - 205px))}
  #mm-profile .profile-preview-tools .muted{display:none}
  #mm-profile .profile-editor-header{padding-top:8px;padding-bottom:8px}
  #mm-profile .profile-editor-footer{padding-top:8px;padding-bottom:8px;margin-top:8px}
}
