:root{--paper:#f5f1eb;--ink:#302e2c;--muted:#736b66;--line:#ded7cf;--accent:#795344;--accent-dark:#5c3c31;--soft:#eae1d7}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,select,input{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{border:1px solid var(--line);background:#fffaf5;color:var(--ink);padding:11px 16px;border-radius:9px;cursor:pointer;min-height:44px;font-size:13px;font-weight:550;transition:background .15s}button:hover:enabled{background:var(--soft)}button:disabled{opacity:.4;cursor:not-allowed}button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible,.stage:focus-visible{outline:3px solid #aa7963;outline-offset:3px}.primary{background:var(--accent);border-color:var(--accent);color:#fff}.primary:hover:enabled{background:var(--accent-dark)}button[aria-pressed=true]:not(#flip){background:var(--accent);color:white;border-color:var(--accent)}[hidden]{display:none!important}.header{display:flex;justify-content:space-between;align-items:center;max-width:1600px;margin:auto;padding:24px 5%}.brand{font:600 25px Georgia,serif;letter-spacing:-1px;text-decoration:none;color:var(--ink);display:inline-flex;align-items:center}.brand>span:not(.brand-icon){font-weight:400;color:var(--accent)}.brand-icon{width:35px;height:40px;border:1px solid var(--accent);border-radius:50% 50% 42% 42%;font:italic 25px Georgia,serif;text-align:center;margin-right:11px;color:var(--accent)}.private-pill{font-size:11px;text-transform:uppercase;letter-spacing:1.3px;color:#625f54;display:flex;align-items:center;gap:8px}.private-pill i{width:6px;height:6px;border-radius:50%;background:#73866a}.intro{text-align:center;padding:42px 20px 40px}.eyebrow{font-size:10px;letter-spacing:2.3px;font-weight:650;color:var(--accent)}h1{font:400 clamp(40px,5vw,70px)/1.04 Georgia,serif;letter-spacing:-2px;margin:21px 0}h1 em{font-weight:400;color:var(--accent)}.intro>p:not(.eyebrow){color:var(--muted)}.actions{display:flex;justify-content:center;gap:10px;margin:24px 0 14px}.actions button{padding:13px 22px}.actions span{margin-left:18px}.intro .micro{font-size:11px}.workspace{max-width:1460px;margin:0 auto;padding:16px;display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:24px;background:#eee8e0;border:1px solid var(--line);border-radius:18px;scroll-margin-top:15px}.mirror-column{min-width:0}.stage-top{display:flex;justify-content:space-between;align-items:center;padding:2px 4px 12px;font-size:10px;letter-spacing:1.7px}.stage-top #stateBadge{letter-spacing:0;color:var(--muted);font-size:11px}.stage{height:clamp(450px,61vh,760px);position:relative;background:#ddd4c8;border-radius:11px;overflow:hidden;isolation:isolate;touch-action:none;outline:none}.stage video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;transform-origin:center;will-change:transform}.stage>canvas{display:block;width:100%;height:100%;position:absolute;inset:0}.empty{height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;background:radial-gradient(ellipse at 50% 36%,#f4eee6,transparent 65%)}.empty-mirror{width:120px;height:154px;border-radius:65px 65px 50px 50px;border:1px solid #af9684;padding:7px;box-shadow:0 6px 30px #7953440a;margin-bottom:17px}.empty-mirror span{height:100%;display:flex;align-items:center;justify-content:center;border:1px solid #c2ad9b;border-radius:inherit;font:italic 43px Georgia,serif;color:#a68b79}.empty h2{font:28px Georgia,serif;margin:9px}.empty p{color:var(--muted);font-size:13px;margin:8px 0 20px}.empty .permission{font-size:10px;margin:12px 0 0}.text-button{border:0;background:none;text-decoration:underline;text-underline-offset:4px;font-size:12px;color:var(--accent);padding:8px;min-height:36px}.quickbar{display:flex;justify-content:center;gap:8px;padding:14px 0 3px;flex-wrap:wrap}.status{padding:9px 8px 2px;text-align:center;color:var(--muted);font-size:11px;min-height:38px}.status.error{color:#962f27}.controls{background:var(--paper);border:1px solid var(--line);border-radius:10px;padding:20px}.control-header{margin-bottom:16px}.control-header h2{font:24px Georgia,serif;margin:0}.control-header span{font-size:8px;letter-spacing:2px;color:var(--muted)}.control-group{border-top:1px solid var(--line);padding:16px 0 0;margin-top:15px}.control-group>label{display:block;margin-bottom:6px}.label-row{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:5px}label{font-size:12px;font-weight:600}output{font-size:11px;color:var(--accent);font-variant-numeric:tabular-nums}.camera-row{display:flex;gap:7px}.camera-row select{min-width:0;flex:1;border:1px solid var(--line);border-radius:7px;padding:8px;background:#fffaf5;font-size:12px;color:var(--ink)}.camera-row button{padding:5px 13px;font-size:20px}.controls input[type=range]{display:block;width:100%;accent-color:var(--accent);height:27px;margin:0 0 12px;cursor:pointer}.button-pair{display:flex;gap:7px}.button-pair button{flex:1;padding:9px;font-size:11px}.hint{font-size:10px;line-height:1.65;color:var(--muted);margin:10px 0 0}.small-tag{font-size:9px;color:var(--muted)}.modes{display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;margin:10px 0 15px}.modes button{font-size:10px;padding:9px 3px;line-height:1.3}.wide{width:100%}.bottom{margin-top:12px}#lensPanel{margin-top:14px}#lensCanvas{width:100%;height:auto;display:block;background:#ddd4c8;border-radius:7px;image-rendering:auto} .lens-point{position:absolute;pointer-events:none;border:1px solid white;width:34px;height:34px;border-radius:50%;box-shadow:0 0 0 1px #795344;transform:translate(-50%,-50%)}.compare-labels{position:absolute;inset:12px 12px auto;display:flex;justify-content:space-between;pointer-events:none}.compare-labels span{font-size:10px;background:#302e2cd9;padding:4px 8px;border-radius:5px;color:white}.busy{position:absolute;bottom:15px;left:50%;transform:translateX(-50%);white-space:nowrap;background:#302e2ce8;color:white;font-size:12px;padding:8px 15px;border-radius:30px}.restore{position:absolute;top:12px;right:12px;background:#f5f1ebed;z-index:3}.notes{max-width:1200px;margin:60px auto;display:grid;grid-template-columns:repeat(3,1fr);gap:45px;padding:0 25px}.number{font-size:9px;letter-spacing:1.7px;color:var(--accent)}.notes h2,.partner h2{font:25px Georgia,serif;margin:12px 0}.notes p,.partner p{font-size:13px;color:var(--muted)}.partner{max-width:1410px;margin:0 auto 45px;text-align:center;padding:28px;background:var(--soft);border-radius:10px}.partner h2{font-size:24px}.help{max-width:900px;margin:0 auto;padding:0 20px}.help details{border-bottom:1px solid var(--line);padding:16px 0}.help summary{font-size:13px;cursor:pointer}.help p{font-size:12px;color:var(--muted)}footer{display:flex;align-items:center;justify-content:space-between;gap:20px;max-width:1460px;padding:40px 25px;margin:auto}footer .brand{font-size:20px}footer p,footer>span{font-size:10px;color:var(--muted)}.focus-layout .controls,.focus-layout .stage-top,.focus-layout .quickbar,.focus-layout .status{display:none}.focus-layout.workspace{grid-template-columns:1fr;padding:0;border:0;background:#ddd4c8}.focus-layout .stage{height:88dvh;border-radius:0}.expanded{position:fixed;inset:0;z-index:10;border-radius:0;max-width:none;margin:0;background:var(--paper);overflow:auto;padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}.expanded .stage{height:calc(100dvh - 150px)}.expanded.focus-layout .stage{height:100dvh}.expanded:fullscreen{width:100%;height:100%;max-width:none}.expanded:fullscreen .stage{height:calc(100vh - 155px)}body:has(.expanded){overflow:hidden}@media(min-width:1600px){.workspace{grid-template-columns:minmax(0,1fr) 340px;gap:30px}.stage{height:740px}.controls{padding:24px}.intro{padding-top:55px}}@media(max-width:1050px){.workspace{margin:0 20px;grid-template-columns:minmax(0,1fr) 280px;gap:14px}.controls{padding:14px}.stage{height:560px}.notes{gap:25px}.partner{margin-left:20px;margin-right:20px}}@media(max-width:760px){.header{padding:20px}.brand{font-size:22px}.private-pill{font-size:8px;letter-spacing:.6px}.intro{padding:20px 20px 27px}h1{font-size:48px}.intro>p{font-size:13px}.intro .micro{font-size:9px}.actions button{padding:12px 17px;font-size:12px}.actions span{margin-left:8px}.workspace{display:flex;flex-direction:column;gap:12px;margin:0 12px;padding:10px;border-radius:13px}.stage{height:62dvh;min-height:380px;max-height:680px}.controls{display:grid;grid-template-columns:1fr 1fr;gap:0 20px;padding:18px}.control-header{grid-column:1/-1;margin-bottom:0}.control-group{margin-top:10px}.controls .control-group:nth-child(2){grid-column:1/-1}.notes{margin:35px auto;gap:20px}.notes h2{font-size:21px}.notes p{font-size:11px}.partner{margin-bottom:25px}footer{flex-wrap:wrap;padding:30px 20px;gap:8px}footer p{margin-left:auto}footer>span{width:100%;text-align:center}.expanded{margin:0}.expanded .stage{height:calc(72dvh - 60px)}.focus-layout .controls{display:none}.quickbar button{font-size:11px;padding:10px}.empty-mirror{width:93px;height:120px}.empty h2{font-size:25px}}@media(max-width:460px){.controls{display:block;padding:16px}.notes{grid-template-columns:1fr;gap:16px;padding:0 26px}.notes h2{margin:6px 0}.notes p{margin:0;font-size:12px}.quickbar{gap:5px}.quickbar button{padding:9px 11px;font-size:10px}.stage-top{letter-spacing:1px}.stage-top #stateBadge{font-size:10px}.partner h2{font-size:22px}.private-pill{font-size:7px}.controls .hint{font-size:11px}.modes button{font-size:12px}.button-pair button{font-size:12px}.small-tag{font-size:10px}}@media(max-height:550px) and (orientation:landscape){.workspace{display:grid;grid-template-columns:minmax(0,1fr) 270px}.stage{height:75dvh;min-height:270px}.controls{display:block}.expanded .stage{height:calc(100dvh - 120px);min-height:180px}.empty-mirror{display:none}.empty p{margin:6px}.empty h2{font-size:21px}.empty .permission{display:none}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.intro .tagline{font-size:10px;line-height:1.8}.tagline span{display:block;white-space:nowrap}

/* v1.0.2 — roomier mobile mirror and a true screen-filling inspection view.
   Photo uploads continue using their original fit-inside framing. */
@media(max-width:760px){
  .workspace:not(.expanded){margin:0 7px;padding:8px;gap:8px}
  .workspace:not(.expanded) .stage{height:78dvh;min-height:450px;max-height:none}
  .quickbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  .quickbar button{min-width:0;font-size:12px;padding:10px 6px;line-height:1.3}
  .workspace.expanded{position:fixed;inset:0;width:100%;height:100dvh;margin:0;padding:0;max-width:none;display:block;overflow:hidden;border:0;border-radius:0;background:#171512;z-index:100}
  .expanded .mirror-column{height:100%;position:relative}
  .expanded .stage,.expanded:fullscreen .stage{height:100dvh;min-height:0;max-height:none;border-radius:0}
  .expanded .stage-top{position:absolute;z-index:4;top:0;left:0;right:0;padding:calc(env(safe-area-inset-top) + 14px) 17px 24px;color:#fff;background:linear-gradient(to bottom,rgba(35,29,25,.6),transparent);pointer-events:none}
  .expanded .stage-top #stateBadge{color:#f5f1eb}
  .expanded .quickbar{position:absolute;z-index:4;bottom:0;left:0;right:0;margin:0;padding:22px 12px calc(env(safe-area-inset-bottom) + 14px);background:linear-gradient(to top,rgba(35,29,25,.78),rgba(35,29,25,0));grid-template-columns:repeat(2,minmax(0,1fr))}
  .expanded .quickbar button{background:#f8f3ed;min-height:45px;color:#302e2c;border-color:#e4dbd2;font-size:12px}
  .expanded .quickbar button.primary{background:var(--accent);color:white;border-color:var(--accent)}
  .expanded .status,.expanded .controls{display:none}
  .expanded.focus-layout .stage,.expanded.focus-layout:fullscreen .stage{height:100dvh}
  .expanded .restore{top:calc(env(safe-area-inset-top) + 12px);right:12px}
}
@media(max-width:760px) and (max-height:550px) and (orientation:landscape){
  .workspace:not(.expanded) .stage{height:74dvh;min-height:230px}
}

/* v1.0.3 — lively beauty-editorial palette, with the established large mirror preserved. */
:root{--paper:#fff8f6;--ink:#48273f;--muted:#826c79;--line:#efd7df;--accent:#ab377c;--accent-dark:#78295f;--soft:#fde8ed;--berry:#78295f;--coral:#f36c83;--lavender:#e5dbfd}
body{background:linear-gradient(160deg,#fff3f5 0,#fffaf6 28%,#fff8f6 70%,#faf2fc 100%);color:var(--ink)}
.header{position:relative}
.header::after{content:"";position:absolute;bottom:0;left:5%;right:5%;height:2px;background:linear-gradient(90deg,transparent,#fca3b9,#cc95ee,transparent);opacity:.7}
.brand>span:not(.brand-icon){color:#ae3479}
.brand-icon{color:#ad387c;border-color:#efa9c7;background:linear-gradient(160deg,#ffe9ef,#f5e4ff);box-shadow:0 3px 15px #da81b229}
.private-pill i{background:#3d9a78}
.intro{position:relative;isolation:isolate}
.intro::before{content:"";position:absolute;z-index:-1;width:270px;height:270px;left:calc(50% - 290px);top:5px;border-radius:50%;background:radial-gradient(circle,#f9d2e778,transparent 72%);pointer-events:none}
.intro .eyebrow{color:#ac397d}
h1 em{color:#af3c83}
.intro h1{letter-spacing:-2.4px}
.primary{background:linear-gradient(115deg,#b83e85,#dc5a83);border-color:#ae3d7c;color:white;box-shadow:0 5px 20px #b93e8633}
.primary:hover:enabled{background:linear-gradient(115deg,#8a2b69,#bd4170)}
button{border-color:#ead1dc;background:#fff;color:#58314b;border-radius:11px}
button:hover:enabled{background:#fff0f6}
button[aria-pressed=true]:not(#flip){background:linear-gradient(120deg,#9c357c,#ca538a);color:#fff;border-color:#9c357c}
button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible,.stage:focus-visible{outline:3px solid #df6ca2;outline-offset:3px}
.workspace{background:linear-gradient(135deg,#fff0ec,#f3e7f6);border:1px solid #eecddf;box-shadow:0 18px 60px #7d3c6512}
.stage{background:#e5d6e3;border:1px solid #e6ccdf;box-shadow:inset 0 0 0 1px #ffffff99}
.empty{background:radial-gradient(ellipse at 46% 38%,#fff5f6 0,#f6e5f1 58%,#e9dcf0 100%)}
.empty-mirror{background:linear-gradient(150deg,#ffe4ec,#f5dbff);border-color:#cc97ba;box-shadow:0 12px 32px #b35c8f24}
.empty-mirror span{border-color:#e1accd;color:#b34289}
.stage-top{color:#a23d7c;font-weight:650}
.controls{background:linear-gradient(155deg,#fffaf9,#fff3f8);border-color:#eed2e1;box-shadow:0 7px 32px #aa537112}
.control-header h2{color:#612b58}
.control-header span,.small-tag,.number{color:#ad4684}
.control-group{border-top-color:#efd6e3}
.controls input[type=range]{accent-color:#b83e86}
.camera-row select{background:#fff;border-color:#e6c8d9}
.hint{color:#866d80}
.capture-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.capture-pair button{padding:9px 6px;background:#fff5f8;border-color:#ecc4d8;font-size:11px}
.capture-pair button:hover{background:#ffe4f1}
.comparison-intro{margin:7px 0 3px;font-size:11px}
.modes{grid-template-columns:1fr 1fr;gap:8px}
.modes button{font-size:12px}
.quickbar .capture-done{border-color:#d8a1cd;background:#fce6f7;color:#812e68}
.action-secondary{margin-top:9px;background:linear-gradient(120deg,#fce2ee,#efe4ff);border-color:#dbb4d4;color:#782957}
.action-secondary:disabled{background:#f7eff5}
#lensCanvas{background:#efdae9}
.lens-point{box-shadow:0 0 0 2px #b94d8a}
.compare-labels{z-index:2}
.compare-labels span{background:#542846e8;color:white;font-weight:650;letter-spacing:.6px;padding:5px 10px;border-radius:20px}
.notes h2,.partner h2{color:#5b2b53}
.partner{background:linear-gradient(110deg,#ffe1e9,#f4e6fd);border:1px solid #f0cce0}
.help summary{color:#713763}
body .expanded{background:#24172a}
.expanded .quickbar button.capture-done{background:#fee2f5;color:#842e68}
@media(max-width:760px){
 .intro{padding-top:22px}
 .workspace:not(.expanded){background:linear-gradient(145deg,#fff0ec,#f8eafa)}
 .workspace:not(.expanded) .stage{height:78dvh;min-height:450px;max-height:none}
 .quickbar button{min-height:45px;font-size:12px}
 .workspace.expanded{background:#27162c}
 .expanded .quickbar{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:21px 8px calc(env(safe-area-inset-bottom) + 12px);background:linear-gradient(to top,#2d1639df,#2d163900)}
 .expanded .quickbar button{font-size:10px;min-height:44px;padding:7px 4px;line-height:1.25}
 .expanded .quickbar button.primary{background:linear-gradient(115deg,#b83e85,#dc5a83);color:white;border-color:#a93c7a}
 .expanded .quickbar button.capture-done{background:#fee2f5;color:#842e68}
 .expanded .stage-top{background:linear-gradient(to bottom,#2d16399c,transparent)}
}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* v1.0.5: local low-light illumination and portrait-focus softening */
.stage{position:relative;isolation:isolate}
.stage .light-frame{position:absolute;inset:0;pointer-events:none;z-index:3;opacity:0;border:18px solid rgba(255,252,245,.98);box-shadow:inset 0 0 26px rgba(255,252,245,.42),0 0 35px rgba(255,252,245,.25);transition:opacity .2s ease}
.stage .light-frame.on{opacity:var(--light-strength,.55)}
.stage video.processing{position:absolute!important;width:100%!important;height:100%!important;opacity:1!important;pointer-events:none!important} /* Keep Safari camera stream onscreen under the processed canvas; 1px hidden video can stall frames. */
.stage canvas.live-processing{display:block!important}
.light-tools,.blur-tools{margin:12px 0 14px;padding:12px;border:1px solid rgba(112,64,94,.16);background:rgba(255,250,249,.53);border-radius:14px}
.light-tools .label-row,.blur-tools .label-row{margin:0 0 7px}
.mini-toggle{min-width:76px;padding:7px 12px;border-radius:10px}
.mini-toggle[aria-pressed="true"]{background:#9b3d84;color:#fff}
.blur-tools select{max-width:140px;min-height:38px}
#lightOptions[hidden]{display:none}
@media(max-width:760px){.stage .light-frame{border-width:22px}.light-tools,.blur-tools{padding:10px}}

/* v1.0.6 — Profile Shot: separate photo studio with honest, adjustable local soft focus. */
.actions{flex-wrap:wrap}.profile-main{background:linear-gradient(115deg,#60285c,#a13d80);color:white;border-color:#883a78;box-shadow:0 5px 16px #b93e8626}.profile-main:hover:enabled{background:#6b255c;color:#fff}
.profile-studio{max-width:1460px;margin:28px auto 52px;padding:clamp(18px,3vw,36px);border-radius:20px;background:linear-gradient(135deg,#ffeef6,#f8edf9 54%,#fff8f2);border:1px solid #ebcadc;box-shadow:0 16px 40px #71365812;scroll-margin-top:12px}
.profile-heading{display:flex;align-items:start;justify-content:space-between;gap:18px;margin-bottom:25px}.profile-heading h2{font:normal clamp(31px,4vw,47px)/1.2 Georgia,serif;color:#5d285a;margin:3px 0 8px}.profile-sparkle{color:#e17eaa}.profile-heading p:not(.eyebrow){font-size:13px;color:#725e6c;margin:0;max-width:660px}.profile-close{white-space:nowrap}
.profile-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:25px;align-items:start}.profile-stage-side{max-width:670px;width:100%;margin:0 auto}.portrait-stage{width:100%;aspect-ratio:4/5;max-height:min(80dvh,760px);margin:auto;position:relative;border-radius:18px;overflow:hidden;background:radial-gradient(ellipse at center,#f7d3e4,#dbafc6);border:1px solid #e0bbce;touch-action:none;isolation:isolate}.portrait-stage.ratio-3-4{aspect-ratio:3/4}.portrait-stage.ratio-1-1{aspect-ratio:1/1}.portrait-stage video,.portrait-stage canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.portrait-stage video{object-position:center}.portrait-stage canvas{display:block}.portrait-placeholder{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;color:#743e69;text-align:center;padding:22px}.portrait-placeholder-icon{font-size:62px;color:#ba598c}.portrait-placeholder strong{font:24px Georgia,serif}.portrait-placeholder span{font-size:12px;color:#806b7b}.portrait-stage-label{position:absolute;z-index:3;top:12px;left:12px;font-size:9px;letter-spacing:1px;padding:6px 10px;background:#371b38bb;color:#fff;border-radius:30px;pointer-events:none}.portrait-oval{position:absolute;z-index:2;border:1.5px dashed #ffffffde;box-shadow:0 0 0 1px #a34e8180,inset 0 0 20px #fff4;border-radius:50%;pointer-events:none;transform:translate(-50%,-50%)}.portrait-countdown{position:absolute;z-index:7;inset:0;display:grid;place-items:center;background:#24132a73;color:#fff;font:bold clamp(80px,20vw,170px)/1 Georgia,serif;text-shadow:0 4px 30px #250d27}.portrait-stage-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;padding:15px 0}.portrait-stage-actions button{flex:1;min-width:135px}.portrait-review{background:#fffafded;border-radius:14px;border:1px solid #efcede;padding:15px 17px}.portrait-review label{display:flex;justify-content:space-between;gap:6px}.review-arrow{font-size:10px;font-weight:400;color:#846879}.portrait-review input{width:100%;accent-color:#b33e83}.portrait-export{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:6px}.portrait-status{text-align:center;color:#6f5269;font-size:12px;min-height:26px;margin:0 6px 8px}.portrait-status.error{color:#a12850}.profile-settings{background:#fffbfdf5;padding:18px;border:1px solid #e9d3df;border-radius:16px}.profile-settings h3{font:25px Georgia,serif;margin:2px 0;color:#622f5d}.profile-settings .control-group{padding-top:12px;margin-top:12px}.profile-settings .control-group>label{margin-bottom:7px}.profile-settings input[type=range]{display:block;width:100%;accent-color:#b33980;margin:7px 0 13px}.profile-select{display:block;width:100%;font-size:13px;min-height:43px;border:1px solid #dfbad1;border-radius:10px;color:#532b47;background:#fff;padding:8px}.profile-flip[aria-pressed=true]{background:#742e66!important;color:#fff!important;border-color:#742e66!important}.profile-trust{margin-top:18px;padding:14px;border-radius:12px;background:#fdeef4;color:#754263;font-size:11px}.profile-trust p{margin:4px 0 0;line-height:1.6}
@media(max-width:1050px){.profile-studio{margin-left:20px;margin-right:20px}.profile-layout{grid-template-columns:minmax(0,1fr) 290px;gap:16px}}
@media(max-width:760px){.profile-studio{margin:20px 8px 35px;padding:13px;border-radius:13px}.profile-heading{display:block;padding:5px 4px 12px}.profile-heading h2{font-size:32px}.profile-heading .profile-close{margin-top:12px}.profile-layout{display:block}.profile-stage-side{max-width:480px}.portrait-stage{max-height:70dvh}.profile-settings{margin-top:16px;padding:14px}.portrait-stage-actions button{font-size:12px;padding:10px 6px}.profile-trust{font-size:12px}}
@media(max-width:390px){.portrait-stage-actions button{min-width:120px}.portrait-export button{font-size:11px;padding:10px 6px}}

/* v1.0.7 camera quality selection */
.capture-quality-group{background:linear-gradient(125deg,#fff1f6,#f5ecff);border:1px solid #ebcde5;border-radius:14px;padding:13px!important;margin:8px 0 14px!important}
.capture-quality-group .label-row{gap:10px;align-items:center}
.capture-quality-group #portraitQualityBadge{background:#72346d;color:#fff;padding:5px 9px;border-radius:999px;font-size:10px;white-space:nowrap}
.capture-quality-group .profile-select{font-weight:650;border-color:#c78cb7;min-height:48px}
.capture-quality-group .hint{font-size:11px;line-height:1.6;margin:9px 0}
.capture-resolution{padding:10px;border-radius:9px;background:#ffffffd9;border:1px solid #e8c6db;color:#6b3262;font-size:11px;line-height:1.5;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}

/* MirrorMagik 1.1: accessible nearby controls and accurate portrait geometry. */
.brand sup{font:11px/1 sans-serif;align-self:flex-start;margin:8px 0 0 3px;letter-spacing:0}
.mirror-tools{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap;padding:10px 0 0}
.mirror-tools button{min-width:44px;padding:8px 11px}.mirror-tools output{min-width:40px;text-align:center;font-size:13px}.mirror-tools a{font-size:12px;color:var(--accent);padding:10px}#controls{scroll-margin-top:18px}
.portrait-stage{max-height:none;width:min(100%,calc(70dvh * .8))}.portrait-stage.ratio-3-4{width:min(100%,calc(70dvh * .75))}.portrait-stage.ratio-1-1{width:min(100%,70dvh)}
@media(min-width:761px){.mirror-column{position:sticky;top:14px;align-self:start}}
@media(max-width:760px){.workspace:not(.expanded) .stage{height:58dvh;min-height:300px;max-height:660px}.mirror-tools{position:sticky;top:0;z-index:5;background:var(--paper);border-radius:8px;padding:7px 2px;gap:4px}.mirror-tools button{font-size:12px}.quickbar{grid-template-columns:repeat(3,minmax(0,1fr))}.quickbar button{font-size:11px}.expanded .mirror-tools{position:absolute;top:12px;left:12px;right:12px;background:#fff5f0ee}.focus-layout .mirror-tools{display:none}.portrait-stage{max-height:none}input,select{font-size:16px!important}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}}

.portrait-confirmation{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin:0 0 12px;padding:15px 17px;border:1px solid #a7c5af;border-radius:13px;background:#f1faf3;color:#294f36}.portrait-confirmation>div{flex:1;min-width:180px}.portrait-confirmation strong{font-size:16px}.portrait-confirmation p{font-size:12px;line-height:1.5;margin:4px 0 0}.portrait-confirmation .comparison-explanation{flex-basis:100%;border-top:1px solid #cbded0;padding-top:10px}.comparison-explanation strong{font-size:inherit}.portrait-compare-labels{position:absolute;z-index:3;left:10px;right:10px;bottom:12px;display:flex;justify-content:space-between;pointer-events:none}.portrait-compare-labels span{background:#371b38cc;color:white;font-size:11px;padding:4px 9px;border-radius:6px}

#frameTitleOptions{margin-top:12px}#frameTitleOptions label{display:block;margin-bottom:5px}#frameTitle{width:100%;padding:11px;border:1px solid #dfbad1;border-radius:9px;font-size:16px;background:#fff;color:var(--ink)}

.filter-strength-row{margin-top:12px}

.portrait-quick-edit{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;padding:15px;margin:0 0 15px;border:1px solid #d8b3ca;border-radius:14px;background:#fffafd;scroll-margin-top:12px}.portrait-quick-edit h3{grid-column:1/-1;margin:0;font:21px Georgia,serif;color:#622f5d}.portrait-quick-edit .control-group{margin:0;padding:9px 0 0}.portrait-quick-edit .control-group:last-child{grid-column:1/-1}.portrait-quick-edit .hint{font-size:11px;margin-top:5px}.portrait-quick-edit input[type=range]{width:100%;accent-color:#b33980}.portrait-editor-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;padding:10px 0}.editor-intro{font-size:12px;color:#744466;text-align:center}.profile-stage-side{max-width:740px}.portrait-confirmation{position:sticky;top:0;z-index:6}.portrait-quick-edit .profile-select{font-size:14px}@media(max-width:760px){.portrait-quick-edit{padding:12px;gap:8px}.portrait-quick-edit .hint{display:none}.portrait-quick-edit h3{font-size:19px}.portrait-stage{width:min(100%,calc(48dvh * .8))}.portrait-stage.ratio-3-4{width:min(100%,calc(48dvh * .75))}.portrait-stage.ratio-1-1{width:min(100%,48dvh)}.portrait-confirmation{padding:10px 12px}.portrait-confirmation p{font-size:11px}.portrait-editor-actions button{font-size:12px}}

/* v1.5.4: iOS Safari must not turn taps/double taps into PAGE zoom.
   manipulation keeps scrolling and intentional browser pinch-to-zoom available
   outside the interactive mirror. On the mirror itself, Pointer Events handle
   the application's own two-finger pinch-to-zoom. */
html,body{touch-action:manipulation}
.stage,.stage *, .portrait-stage,.portrait-stage *{touch-action:none}
.stage,.portrait-stage{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}

/* v1.5.5: stop Safari page drift without disabling ordinary vertical scroll,
   slider inputs, the application's intentional two-finger pinch, or photo edits. */
html,body{width:100%;max-width:100%;overflow-x:clip;overscroll-behavior-x:none;overscroll-behavior-y:none}
.expanded{overscroll-behavior:contain}

/* v1.5.6: Mobile photo editing that keeps the *actual edited canvas* in view.
   The editor's original canvas and listeners are preserved; no duplicate
   rendering or image upload is needed. Only photo-editing mode is rearranged.
   The full-size capture preview is retained while the camera is live. */
.portrait-preview-note{display:none}
.portrait-preview-dock{min-width:0}
@media (max-width:760px){
  .profile-studio.editing-photo .profile-layout{display:flex;flex-direction:column;gap:11px;align-items:stretch}
  .profile-studio.editing-photo .profile-stage-side{display:contents}
  .profile-studio.editing-photo .portrait-confirmation{position:static;order:0;margin:0}
  .profile-studio.editing-photo .editor-intro{order:1;margin:0 0 1px}
  .profile-studio.editing-photo .portrait-preview-dock{
    order:2;position:sticky;top:env(safe-area-inset-top,0px);z-index:15;
    align-self:stretch;display:flex;flex-direction:column;align-items:center;
    padding:7px 8px 9px;border:1px solid #e6c3d6;border-radius:13px;
    background:#fffafd;box-shadow:0 8px 26px rgba(75,30,57,.15);
  }
  .profile-studio.editing-photo .portrait-preview-note{
    display:block;margin:0 0 5px;color:#814c6a;font-size:11px;
    font-weight:650;text-align:center;line-height:1.25;
  }
  .profile-studio.editing-photo .portrait-stage{
    width:min(100%,calc(33dvh * .8));max-height:none;
    border-radius:11px;box-shadow:0 3px 14px rgba(75,30,57,.12);
  }
  .profile-studio.editing-photo .portrait-stage.ratio-3-4{width:min(100%,calc(33dvh * .75))}
  .profile-studio.editing-photo .portrait-stage.ratio-1-1{width:min(100%,33dvh)}
  .profile-studio.editing-photo .portrait-quick-edit{order:3;margin:0;scroll-margin-top:calc(39dvh + 16px)}
  .profile-studio.editing-photo .portrait-editor-actions{order:4;padding:2px 0}
  .profile-studio.editing-photo .portrait-stage-actions{order:5;padding:2px 0}
  .profile-studio.editing-photo .portrait-review{order:6}
  .profile-studio.editing-photo #clearPortrait{order:7}
  .profile-studio.editing-photo .portrait-status{order:8}
  .profile-studio.editing-photo .profile-settings{order:9;margin:0}
}
@media (max-width:760px) and (max-height:650px){
  .profile-studio.editing-photo .portrait-stage{width:min(100%,calc(29dvh * .8))}
  .profile-studio.editing-photo .portrait-stage.ratio-3-4{width:min(100%,calc(29dvh * .75))}
  .profile-studio.editing-photo .portrait-stage.ratio-1-1{width:min(100%,29dvh)}
}

/* v1.5.7: mobile-first workbench — a fixed-size live preview and a separate
   scrolling control panel. ALL original inputs and handlers remain in place.
   No extra canvas, no camera restart, and no interference with the desktop UI. */
@media(max-width:760px) and (orientation:portrait){
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout){
    display:flex;flex-direction:column;gap:7px;
    height:calc(100dvh - 12px);max-height:none;min-height:540px;
    padding:7px;margin:0 5px;overflow:hidden;border-radius:13px;
    overscroll-behavior:contain;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .mirror-column{
    flex:0 0 auto;position:static;min-width:0;max-height:none;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .stage{
    position:relative;height:clamp(225px,43dvh,425px);
    min-height:0;max-height:none;border-radius:12px;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .stage-top{
    padding:0 6px 5px;font-size:10px;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .mirror-tools{
    display:flex;position:static;flex-wrap:nowrap;gap:3px;z-index:auto;
    padding:5px 0 0;background:transparent;justify-content:space-between;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .mirror-tools button,
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .mirror-tools a,
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .mirror-tools output{
    min-width:0;font-size:11px;padding:7px 5px;white-space:nowrap;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .controls{
    display:block;flex:1 1 auto;min-height:140px;max-height:none;
    overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;padding:0 10px 12px;margin:0;
    border-radius:13px;background:#fffafd;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .controls .control-group{
    margin:8px 0;padding:10px 0;border-bottom:1px solid #f0dce8;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .controls .control-header{display:none}
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .controls input[type="range"]{
    min-height:26px;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .controls .quickbar{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:8px 0;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .controls .quickbar button{
    font-size:12px;min-height:43px;
  }
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .controls .status{
    margin-top:10px;padding:9px;font-size:11px;
  }
  .mm-workbench-tools{height:auto;min-width:0}
  .mm-tabbar{
    position:sticky;top:0;z-index:8;display:flex;gap:4px;
    background:#fffafd;padding:8px 0 7px;border-bottom:1px solid #edd6e4;
  }
  .mm-tabbar .mm-tab{
    flex:1 1 0;min-width:0;min-height:38px;padding:7px 3px;
    border-radius:9px;border:1px solid #efdae6;background:#fff;
    color:#764867;font-size:11px;font-weight:750;line-height:1.15;
  }
  .mm-tabbar .mm-tab[aria-selected="true"]{
    color:#fff;background:#a63f7c;border-color:#a63f7c;
  }
  .mm-tab-pane{min-width:0;padding:5px 1px 12px}
  .mm-tab-pane[hidden]{display:none!important}
  body.mm-mobile-workbench .profile-studio:not([hidden]){
    position:fixed;inset:0;z-index:80;
    width:100%;height:100dvh;min-height:0;max-width:none;
    display:flex;flex-direction:column;overflow:hidden;
    margin:0;padding:calc(env(safe-area-inset-top) + 5px) 8px max(5px,env(safe-area-inset-bottom));
    border:0;border-radius:0;
    background:linear-gradient(140deg,#fff4f8,#f8edf9);
  }
  body.mm-mobile-workbench .profile-studio[hidden]{display:none!important}
  body.mm-mobile-workbench:has(.profile-studio:not([hidden])){overflow:hidden}
  body.mm-mobile-workbench .profile-heading{
    flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;
    margin:0 0 4px;padding:3px 4px 6px;gap:7px;
  }
  body.mm-mobile-workbench .profile-heading h2{font-size:19px;margin:0;line-height:1.2}
  body.mm-mobile-workbench .profile-heading p{display:none}
  body.mm-mobile-workbench .profile-heading .profile-close{margin:0;padding:7px 12px;font-size:12px;min-height:35px}
  body.mm-mobile-workbench .profile-layout{display:flex;flex:1;min-height:0;gap:0;overflow:hidden}
  body.mm-mobile-workbench .profile-stage-side,
  body.mm-mobile-workbench .profile-studio.editing-photo .profile-stage-side{
    display:flex;flex-direction:column;flex:1;min-height:0;
    width:100%;max-width:none;gap:6px;overflow:hidden;
  }
  body.mm-mobile-workbench .portrait-preview-dock,
  body.mm-mobile-workbench .profile-studio.editing-photo .portrait-preview-dock{
    position:static;z-index:auto;order:0;flex:0 0 auto;
    display:flex;align-items:center;justify-content:center;flex-direction:column;
    padding:5px;border-radius:12px;
    background:#fffafdee;min-height:0;
  }
  body.mm-mobile-workbench .portrait-preview-note{display:block;margin:0 0 4px;font-size:10px;color:#7e4a6b}
  body.mm-mobile-workbench .portrait-stage,
  body.mm-mobile-workbench .profile-studio.editing-photo .portrait-stage{
    display:block;flex:0 0 auto;max-height:40dvh;max-width:100%;min-height:0;
    border-radius:10px;width:min(100%,calc(40dvh * .8));
  }
  body.mm-mobile-workbench .portrait-stage.ratio-3-4,
  body.mm-mobile-workbench .profile-studio.editing-photo .portrait-stage.ratio-3-4{width:min(100%,calc(40dvh * .75))}
  body.mm-mobile-workbench .portrait-stage.ratio-1-1,
  body.mm-mobile-workbench .profile-studio.editing-photo .portrait-stage.ratio-1-1{width:min(100%,40dvh)}
  body.mm-mobile-workbench .mm-photo-tools{
    order:1;flex:1 1 auto;min-height:130px;display:block;
    overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:0 9px 14px;border:1px solid #ead0df;border-radius:12px;background:#fffafd;
  }
  body.mm-mobile-workbench .portrait-quick-edit{
    display:block;margin:0;padding:2px 4px;border:0;background:transparent;
  }
  body.mm-mobile-workbench .portrait-quick-edit .control-group{padding:9px 0;border-bottom:1px solid #f0dce8}
  body.mm-mobile-workbench .profile-settings{margin:0;padding:8px 4px;border:0;background:transparent}
  body.mm-mobile-workbench .portrait-review{margin-top:8px}
  body.mm-mobile-workbench .portrait-stage-actions{display:flex;flex-wrap:wrap;gap:8px}
  body.mm-mobile-workbench .portrait-stage-actions button{min-width:0;flex:1 1 45%}
  body.mm-mobile-workbench .portrait-status{margin:7px 0}
}
@media(max-width:760px) and (orientation:portrait) and (max-height:690px){
  body.mm-mobile-workbench .workspace:not(.expanded):not(.focus-layout) .stage{height:38dvh;min-height:0}
  body.mm-mobile-workbench .portrait-stage,
  body.mm-mobile-workbench .profile-studio.editing-photo .portrait-stage{width:min(100%,calc(34dvh * .8));max-height:34dvh}
  body.mm-mobile-workbench .portrait-stage.ratio-3-4,
  body.mm-mobile-workbench .profile-studio.editing-photo .portrait-stage.ratio-3-4{width:min(100%,calc(34dvh * .75))}
  body.mm-mobile-workbench .portrait-stage.ratio-1-1,
  body.mm-mobile-workbench .profile-studio.editing-photo .portrait-stage.ratio-1-1{width:min(100%,34dvh)}
}


/* v1.5.8: larger camera/photo preview + app-like immediate iPhone controls.
   Desktop and landscape stay exactly as before. */
@media(max-width:760px) and (orientation:portrait){
  body.mm-refined-mobile .workspace:not(.focus-layout){
    height:100dvh!important;min-height:0!important;max-height:none!important;
    display:flex!important;flex-direction:column!important;gap:5px!important;
    padding:5px!important;margin:0 4px!important;overflow:hidden!important;
    background:linear-gradient(145deg,#fff0ec,#f8eafa)!important;
  }
  body.mm-refined-mobile .workspace:not(.focus-layout) .mirror-column{
    height:auto!important;flex:0 0 auto!important;min-height:0!important;position:relative!important;
  }
  body.mm-refined-mobile .workspace:not(.focus-layout) .stage-top{
    display:flex!important;position:static!important;color:#79506c!important;
    align-items:center!important;justify-content:space-between!important;
    gap:5px!important;padding:0 4px 3px!important;height:28px!important;
    background:none!important;pointer-events:auto!important;
  }
  body.mm-refined-mobile .workspace:not(.focus-layout) .stage-top #stateBadge{
    font-size:10px!important;color:#765d70!important;flex:0 1 auto!important;margin-left:auto!important;text-align:right!important;white-space:nowrap!important;letter-spacing:.35px!important;
  }
  body.mm-refined-mobile .workspace:not(.focus-layout) .stage{
    display:block!important;position:relative!important;
    height:min(54dvh,calc(100dvh - 270px))!important;
    min-height:0!important;max-height:none!important;
    border-radius:15px!important;
  }
  body.mm-refined-mobile .workspace:not(.focus-layout).mm-large-preview .stage{
    height:min(67dvh,calc(100dvh - 200px))!important;
  }
  body.mm-refined-mobile .workspace:not(.focus-layout) .mirror-tools{display:none!important}
  .mm-refined-mobile .mm-size-toggle{
    flex:0 0 auto;border:1px solid #dfc4d5!important;border-radius:999px!important;
    padding:3px 9px!important;font-size:10px!important;line-height:1.3!important;
    font-weight:800!important;min-height:24px!important;background:#fff!important;color:#834269!important;
  }
  .mm-refined-mobile .mm-size-toggle[aria-pressed="true"]{background:#8a416c!important;color:#fff!important;}
  .mm-refined-mobile .mm-mobile-ribbon{
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
    gap:5px;margin-top:5px;min-height:65px;
  }
  .mm-refined-mobile .mm-zoom-tile,.mm-refined-mobile .mm-action-tile{
    border:1px solid #e6d4df!important;border-radius:12px!important;
    background:#fffafc!important;color:#6a3e58!important;
    min-width:0!important;min-height:65px!important;
    box-shadow:0 2px 7px rgba(94,42,78,.06);
    display:flex;flex-direction:column;align-items:center;justify-content:center;
    gap:2px!important;padding:5px 3px!important;
  }
  .mm-refined-mobile .mm-action-tile.is-on{background:#f8e5f1!important;border-color:#bf7caa!important;}
  .mm-refined-mobile .mm-mobile-ribbon svg{width:20px;height:20px;display:block;flex:none;}
  .mm-refined-mobile .mm-action-tile span{font-size:11px;font-weight:800;line-height:1.2;}
  .mm-refined-mobile .mm-zoom-title{font-size:10px;font-weight:800;display:flex;align-items:center;gap:4px;line-height:1;}
  .mm-refined-mobile .mm-zoom-title svg{width:15px;height:15px;}
  .mm-refined-mobile .mm-zoom-row{display:flex;width:100%;align-items:center;justify-content:space-between;gap:1px;}
  .mm-refined-mobile .mm-zoom-row button{width:25px;height:27px;min-width:0!important;padding:0!important;
    line-height:1!important;font-size:18px!important;background:#f3e4ed!important;border:1px solid #e8cada!important;
    border-radius:7px!important;color:#804361!important;font-weight:750!important;
  }
  .mm-refined-mobile .mm-zoom-row output{font-size:10px;font-weight:800;white-space:nowrap;}
  body.mm-refined-mobile .workspace:not(.focus-layout) .controls{
    display:block!important;visibility:visible!important;position:relative!important;
    flex:1 1 auto!important;min-height:95px!important;max-height:none!important;
    padding:0 8px 8px!important;margin:0!important;
    overflow-y:auto!important;overflow-x:hidden!important;
    background:#fffafd!important;border-radius:12px!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  .mm-refined-mobile .mm-tabbar{padding:5px 0 7px!important;gap:5px!important;}
  .mm-refined-mobile .mm-tabbar .mm-tab{min-height:43px!important;display:flex;align-items:center;
    flex-direction:column;justify-content:center;gap:2px!important;padding:4px 2px!important;
    font-size:10px!important;border-radius:10px!important;
    border-color:#ead8e1!important;
  }
  .mm-refined-mobile .mm-tabbar .mm-tab svg{width:17px;height:17px;display:block;}
  .mm-refined-mobile .mm-tabbar .mm-tab[aria-selected="true"]{border-color:#b04c80!important;background:#b05285!important;color:#fff!important;}
  .mm-refined-mobile .mm-tab-pane{padding:3px 2px 14px!important;}
  .mm-refined-mobile .mm-mirror-tools .control-group{
    background:#fff!important;border:1px solid #ead9e4!important;
    border-radius:13px!important;padding:11px 10px!important;
    margin:5px 0 9px!important;
  }
  .mm-refined-mobile .mm-mirror-tools .label-row{margin-bottom:6px!important;}
  .mm-refined-mobile .mm-mirror-tools input[type="range"],
  .mm-refined-mobile .mm-photo-tools input[type="range"]{width:100%;accent-color:#a83c78;}
  .mm-refined-mobile .mm-mirror-tools .hint{font-size:11px;line-height:1.45;}
  /* photo editor: the image remains above the tool drawer but gains usable space */
  body.mm-refined-mobile .portrait-stage,
  body.mm-refined-mobile .profile-studio.editing-photo .portrait-stage{
    width:min(100%,calc(min(52dvh,100dvh - 255px) * .8))!important;
    max-height:min(52dvh,calc(100dvh - 255px))!important;
  }
  body.mm-refined-mobile .portrait-stage.ratio-3-4,
  body.mm-refined-mobile .profile-studio.editing-photo .portrait-stage.ratio-3-4{
    width:min(100%,calc(min(52dvh,100dvh - 255px) * .75))!important;
  }
  body.mm-refined-mobile .portrait-stage.ratio-1-1,
  body.mm-refined-mobile .profile-studio.editing-photo .portrait-stage.ratio-1-1{
    width:min(100%,min(52dvh,100dvh - 255px))!important;
  }
  .mm-refined-mobile .mm-photo-tools .control-group{
    border-radius:12px;padding:9px 7px!important;margin-bottom:7px!important;
  }
  .mm-refined-mobile .mm-photo-tools{border-radius:12px!important;}
}
@media(max-width:760px) and (orientation:portrait) and (max-height:670px){
 body.mm-refined-mobile .workspace:not(.focus-layout) .stage{
   height:min(49dvh,calc(100dvh - 235px))!important;
 }
 body.mm-refined-mobile .workspace:not(.focus-layout).mm-large-preview .stage{
   height:min(62dvh,calc(100dvh - 190px))!important;
 }
 .mm-refined-mobile .mm-mobile-ribbon{min-height:57px;}
 .mm-refined-mobile .mm-zoom-tile,.mm-refined-mobile .mm-action-tile{min-height:57px!important;}
}

/* v1.5.11: user-photo previews and one-touch finish actions on iPhone.
   Does not change the large mirror, desktop side-by-side, or local processing. */
.portrait-reset-row{display:flex;align-items:center;justify-content:space-between;gap:12px;grid-column:1/-1}
.portrait-reset-row button{border:1px solid #d8b5cb;background:#fff7fb;color:#823b68;font-weight:750;white-space:nowrap}
.portrait-reset-row span{font-size:11px;color:#736673}
.mm-visual-choices,.mm-workbench-hint{display:none}
@media(max-width:760px) and (orientation:portrait){
  body.mm-visual-editor .profile-studio:not([hidden]) .portrait-quick-edit h3{font-size:16px;margin:2px 0 4px}
  body.mm-visual-editor .portrait-quick-edit .control-group>label{display:block;font-weight:750;margin-bottom:7px}
  body.mm-visual-editor .portrait-quick-edit #portraitFilter,
  body.mm-visual-editor .portrait-quick-edit #portraitFrame{
    position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;
    overflow:hidden!important;clip:rect(0,0,0,0)!important;pointer-events:none!important
  }
  body.mm-visual-editor .mm-visual-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:4px 0 9px}
  body.mm-visual-editor .mm-choice{display:flex;flex-direction:column;justify-content:center;align-items:center;
    min-width:0;min-height:0;padding:6px 4px 7px;background:#fff;border:2px solid #ead7e3;border-radius:12px;
    overflow:hidden;gap:4px;box-shadow:0 2px 5px #39203409}
  body.mm-visual-editor .mm-choice[aria-pressed="true"]{border-color:#a73b7d!important;background:#f9e8f3!important;box-shadow:0 0 0 1px #a73b7d}
  body.mm-visual-editor .mm-choice canvas{display:block;width:min(100%,72px);height:80px;max-width:100%;object-fit:cover;border-radius:7px;background:#efe1e5}
  body.mm-visual-editor .mm-choice-name{font-size:11px;line-height:1.15;font-weight:750;color:#593b50;text-align:center}
  body.mm-visual-editor .mm-workbench-hint{display:block;margin:6px 0 8px;color:#72556b;font-size:11px}
  body.mm-visual-editor .mm-photo-save-dock{order:2;display:flex;flex:0 0 auto;gap:8px;
    padding:8px 4px max(8px,env(safe-area-inset-bottom));background:#fff8fc;
    border:1px solid #e7cddd;border-radius:13px;box-shadow:0 -3px 12px #50294210}
  body.mm-visual-editor .mm-photo-save-dock[hidden]{display:none!important}
  body.mm-visual-editor .mm-photo-save-dock button{min-height:46px;padding:8px 12px;font-size:13px;font-weight:800}
  body.mm-visual-editor .mm-photo-save-dock .mm-dock-reset{flex:0 0 auto;border-color:#e5cad9;color:#7a4863;background:white}
  body.mm-visual-editor .mm-photo-save-dock .mm-dock-save{flex:1 1 auto;background:#9a3c75;border-color:#9a3c75;color:#fff;font-size:14px}
  body.mm-visual-editor .mm-next-photo-actions{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0}
  body.mm-visual-editor .mm-next-photo-actions[hidden]{display:none!important}
  body.mm-visual-editor .mm-next-photo-actions button{flex:1 1 45%;min-width:0}
  body.mm-visual-editor .mm-camera-settings{padding:6px 5px}
  body.mm-visual-editor .mm-camera-settings .control-group{padding:9px 0;border-bottom:1px solid #f1e2eb}
  body.mm-visual-editor .mm-photo-tools .mm-tab[hidden]{display:none!important}
  body.mm-visual-editor .mm-tabbar .mm-tab{flex:1 1 0}
  body.mm-visual-editor .portrait-confirmation{display:block!important;position:static!important}
  body.mm-visual-editor .portrait-confirmation[hidden]{display:none!important}
  body.mm-visual-editor .portrait-confirmation #portraitSaveTop{display:none}
  body.mm-visual-editor .portrait-quick-edit .portrait-reset-row{margin:4px 0 0}
  body.mm-visual-editor .portrait-quick-edit .portrait-reset-row span{display:none}
  body.mm-visual-editor .portrait-quick-edit #portraitResetEdits{display:none}
  body.mm-visual-editor .profile-studio:not(.mm-has-photo) .portrait-quick-edit{display:none}
  body.mm-visual-editor .profile-studio:not(.mm-has-photo) .mm-next-photo-actions{display:none}
}
/* Landscape phone layout: the real photo stays anchored on the LEFT; the
   original editing controls scroll on the RIGHT. No duplicate canvas or actions. */
@media(orientation:landscape) and (max-height:560px) and (max-width:1000px){
 .profile-studio:not([hidden]){
   position:fixed!important;inset:0!important;z-index:80!important;
   width:100%!important;height:100dvh!important;max-width:none!important;
   margin:0!important;padding:4px 10px!important;overflow-y:auto!important;
   overscroll-behavior:contain;background:#fff6fa!important;
 }
 .profile-studio:not([hidden]) .profile-heading{
   position:sticky;top:0;z-index:22;display:flex!important;align-items:center;justify-content:space-between;
   min-height:38px;margin:0!important;padding:2px 2px 4px!important;background:#fff6fa!important
 }
 .profile-studio:not([hidden]) .profile-heading p{display:none}
 .profile-studio:not([hidden]) .profile-heading h2{font-size:21px;margin:0}
 .profile-studio:not([hidden]) .profile-heading .profile-close{min-height:34px;padding:4px 10px}
 .profile-studio:not([hidden]) .profile-layout{display:block!important;max-width:none!important}
 .profile-studio:not([hidden]) .profile-stage-side{display:block!important;max-width:none!important;min-width:0}
 .profile-studio:not([hidden]) .portrait-preview-dock{
   display:flex!important;align-items:center;justify-content:center;flex-direction:column;
   position:fixed!important;top:47px!important;left:9px!important;width:40vw!important;
   height:calc(100dvh - 119px)!important;min-height:0!important;overflow:hidden!important;
   margin:0!important;padding:5px!important;z-index:14!important;background:#fffafd;
 }
 .profile-studio:not([hidden]) .portrait-preview-note{display:none}
 .profile-studio:not([hidden]) .portrait-stage,
 .profile-studio:not([hidden]) .portrait-stage.ratio-3-4,
 .profile-studio:not([hidden]) .portrait-stage.ratio-1-1{
   display:block!important;width:min(100%,calc((100dvh - 149px) * .8))!important;
   height:calc(100dvh - 149px)!important;min-height:0!important;
   max-height:100%!important;max-width:100%!important;aspect-ratio:4/5;
   margin:auto!important;
 }
 .profile-studio:not([hidden]) .portrait-stage.ratio-3-4{aspect-ratio:3/4!important;width:min(100%,calc((100dvh - 149px) * .75))!important}
 .profile-studio:not([hidden]) .portrait-stage.ratio-1-1{aspect-ratio:1!important;width:min(100%,(100dvh - 149px))!important}
 .profile-studio:not([hidden]) .portrait-confirmation,
 .profile-studio:not([hidden]) .portrait-quick-edit,
 .profile-studio:not([hidden]) .profile-settings,
 .profile-studio:not([hidden]) .portrait-editor-actions,
 .profile-studio:not([hidden]) .portrait-stage-actions,
 .profile-studio:not([hidden]) .portrait-review,
 .profile-studio:not([hidden]) #clearPortrait,
 .profile-studio:not([hidden]) .portrait-status{
   width:calc(58vw - 23px)!important;max-width:none!important;
   margin-left:42vw!important;margin-right:0!important;
 }
 .profile-studio:not([hidden]) .portrait-quick-edit{display:block!important;margin-bottom:8px!important;padding:10px!important}
 .profile-studio:not([hidden]) .portrait-quick-edit .control-group{margin:7px 0!important}
 .profile-studio:not([hidden]) .profile-settings{padding:9px!important}
 .profile-studio:not([hidden]) .editor-intro{display:none}
 .profile-studio:not([hidden]) .portrait-confirmation:not([hidden]){
   display:block!important;position:fixed!important;top:auto!important;left:9px!important;
   bottom:6px!important;z-index:18!important;margin:0!important;padding:5px!important;
   width:40vw!important;max-height:73px!important;overflow:hidden!important;
 }
 .profile-studio:not([hidden]) .portrait-confirmation>div{display:none}
 .profile-studio:not([hidden]) .portrait-confirmation #portraitSaveTop{display:block;width:100%;min-height:43px}
 .profile-studio:not([hidden]) .portrait-confirmation .comparison-explanation{display:none}
}

@media(orientation:landscape) and (max-height:560px) and (max-width:1000px){
  .workspace:not(.expanded):not(.focus-layout){
    width:100%!important;max-width:none!important;margin:0!important;
    height:100dvh!important;min-height:0!important;display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(230px,36%)!important;
    gap:7px!important;padding:7px!important;overflow:hidden!important;
  }
  .workspace:not(.expanded):not(.focus-layout) .mirror-column{
    height:100%!important;min-height:0!important;display:flex!important;
    flex-direction:column!important;overflow:hidden!important;
  }
  .workspace:not(.expanded):not(.focus-layout) .stage-top{flex:0 0 auto;padding:0 4px 3px!important}
  .workspace:not(.expanded):not(.focus-layout) .stage{
    flex:1 1 auto!important;height:auto!important;min-height:0!important;
    max-height:none!important;overflow:hidden!important;
  }
  .workspace:not(.expanded):not(.focus-layout) .mirror-tools{flex:0 0 auto!important;position:static!important;padding:4px!important}
  .workspace:not(.expanded):not(.focus-layout) .mirror-tools button{min-height:33px!important;padding:3px 7px!important}
  .workspace:not(.expanded):not(.focus-layout) .quickbar{flex:0 0 auto;gap:4px;margin:3px 0!important}
  .workspace:not(.expanded):not(.focus-layout) .quickbar button{min-height:37px!important;padding:3px 5px!important}
  .workspace:not(.expanded):not(.focus-layout) .status{display:none!important}
  .workspace:not(.expanded):not(.focus-layout) .controls{
    position:static!important;height:100%!important;max-height:none!important;
    overflow-y:auto!important;overscroll-behavior:contain;
    padding:6px 8px!important;margin:0!important;
  }
}

.mm-light-clarity{display:none}
@media(max-width:760px) and (orientation:portrait){
 body.mm-visual-editor .mm-light-clarity{display:block;font-size:11px;line-height:1.45;color:#714e64;margin:6px 3px 11px}
}

/* v1.5.15: Keep sponsors/help accessible without shrinking adjustment panel.
   The compact Help link now lives in the existing mirror title bar. */
.mm-page-more,.mm-page-return{display:none}
@media(max-width:760px) and (orientation:portrait){
  body.mm-mobile-workbench .workspace:not(.focus-layout) .stage-top .mm-page-more{
    display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;
    text-decoration:none;border:1px solid #e4c8d7;background:#fff7fb;
    color:#8d3567;border-radius:99px;padding:3px 7px;
    font-size:10px;line-height:1.25;font-weight:750;letter-spacing:0;
    min-height:23px;touch-action:manipulation;
  }
  body.mm-mobile-workbench .workspace:not(.focus-layout) .stage-top .mm-page-more:focus-visible,
  body.mm-mobile-workbench .partner .mm-page-return:focus-visible{
    outline:3px solid #a83c78;outline-offset:2px;
  }
  body.mm-mobile-workbench .partner .mm-page-return{
    display:inline-flex;min-height:44px;align-items:center;justify-content:center;
    margin-top:14px;padding:9px 15px;border:1px solid #a83c78;
    border-radius:10px;background:#fff;color:#873d6a;
    font-size:13px;font-weight:750;text-decoration:none;touch-action:manipulation;
  }
  /* Continue to sponsors after reaching the end of adjustments. */
  body.mm-mobile-workbench .workspace:not(.focus-layout),
  body.mm-mobile-workbench .workspace:not(.focus-layout) .controls{
    overscroll-behavior-y:auto!important;
  }
  #sponsors-and-help{scroll-margin-top:16px}
  /* Restore the room removed by the old footer link. Short-screen limits
     yield a little mirror height to keep sliders readily usable. */
  body.mm-refined-mobile .workspace:not(.focus-layout){height:100dvh!important}
  body.mm-refined-mobile .workspace:not(.focus-layout) .stage{
    height:min(54dvh,calc(100dvh - 365px))!important;
  }
  body.mm-refined-mobile .workspace:not(.focus-layout).mm-large-preview .stage{
    height:min(67dvh,calc(100dvh - 320px))!important;
  }
}


/* v1.5.16 — Landscape iPhone workbench.  Preserve the same mobile controls and
   editor tabs in either rotation.  Desktop screens and portrait phone are untouched. */
@media (orientation:landscape) and (max-height:560px) and (max-width:1000px) and (pointer:coarse) {
  body.mm-landscape-workbench{overflow-x:hidden;}
  body.mm-landscape-workbench .workspace:not(.focus-layout){
    display:grid!important;grid-template-columns:minmax(0,55fr) minmax(0,45fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
    align-items:stretch!important;gap:7px!important;
    height:100dvh!important;min-height:0!important;max-height:none!important;
    width:100%!important;max-width:none!important;margin:0!important;
    padding:max(5px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))!important;
    background:linear-gradient(145deg,#fff0ec,#f8eafa)!important;
    border-radius:10px!important;overflow:hidden!important;
  }
  body.mm-landscape-workbench #workspace[hidden]{display:none!important;}
  body.mm-landscape-workbench .workspace.mm-large-preview:not(.focus-layout){
    grid-template-columns:minmax(0,63fr) minmax(0,37fr)!important;
  }
  body.mm-landscape-workbench .workspace:not(.focus-layout) .mirror-column{
    display:flex!important;flex-direction:column!important;position:static!important;
    min-width:0!important;min-height:0!important;width:100%!important;height:100%!important;
    overflow:hidden!important;
  }
  body.mm-landscape-workbench .workspace:not(.focus-layout) .stage-top{
    flex:0 0 27px!important;min-height:27px!important;padding:0 4px 3px!important;
    display:flex!important;align-items:center!important;gap:5px!important;
    color:#79506c!important;letter-spacing:.6px!important;
  }
  body.mm-landscape-workbench .workspace:not(.focus-layout) .stage-top #stateBadge{
    margin-left:auto!important;text-align:right!important;white-space:nowrap!important;
    font-size:10px!important;letter-spacing:0!important;
  }
  body.mm-landscape-workbench .workspace:not(.focus-layout) .stage{
    display:block!important;position:relative!important;flex:1 1 auto!important;
    width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;
    border-radius:12px!important;overflow:hidden!important;
  }
  body.mm-landscape-workbench .workspace:not(.focus-layout) .mirror-tools{display:none!important;}
  body.mm-landscape-workbench .workspace:not(.focus-layout) .quickbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:4px 0!important;}
  body.mm-landscape-workbench .workspace:not(.focus-layout) .quickbar button{min-height:39px!important;padding:6px 4px!important;font-size:11px!important;}
  body.mm-landscape-workbench .workspace:not(.focus-layout) .controls{
    display:flex!important;flex-direction:column!important;flex:0 0 auto!important;
    position:static!important;min-height:0!important;max-height:none!important;height:100%!important;
    width:100%!important;min-width:0!important;
    background:#fffafd!important;border:1px solid #ead7e4!important;border-radius:12px!important;
    margin:0!important;padding:6px 7px!important;
    overflow:hidden!important;overscroll-behavior:contain!important;
  }
  body.mm-landscape-workbench .controls .control-header{display:none!important;}
  body.mm-landscape-workbench .controls .mm-mobile-ribbon{
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
    flex:0 0 auto!important;gap:4px!important;margin:0 0 6px!important;min-height:0!important;
  }
  body.mm-landscape-workbench .controls .mm-action-tile{
    min-width:0!important;min-height:53px!important;max-height:55px!important;
    display:flex!important;flex-direction:column!important;align-items:center!important;
    justify-content:center!important;gap:1px!important;padding:3px 1px!important;
    background:#fff7fc!important;color:#784364!important;border:1px solid #e4c9db!important;
    border-radius:9px!important;box-shadow:none!important;
  }
  body.mm-landscape-workbench .controls .mm-action-tile[aria-pressed=true],
  body.mm-landscape-workbench .controls .mm-action-tile.is-on{
    background:#f7dfed!important;border-color:#a83c78!important;
  }
  body.mm-landscape-workbench .controls .mm-action-tile svg{width:17px;height:17px;display:block;flex:0 0 auto;}
  body.mm-landscape-workbench .controls .mm-action-tile span{font-size:10px;font-weight:750;line-height:1.04;text-align:center;}
  body.mm-landscape-workbench .controls .mm-mirror-tools{
    display:block!important;min-height:0!important;flex:1 1 auto!important;
    overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch;
    overscroll-behavior-y:auto!important;
  }
  body.mm-landscape-workbench .mm-tabbar{
    position:sticky!important;top:0!important;z-index:8!important;
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px!important;
    flex:0 0 auto;padding:2px 0 6px!important;margin:0!important;background:#fffafd!important;
  }
  body.mm-landscape-workbench .mm-tabbar .mm-tab{
    display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
    gap:1px!important;min-height:41px!important;min-width:0!important;padding:3px 1px!important;
    background:#fff!important;border:1px solid #ead0df!important;border-radius:9px!important;
    font-size:10px!important;font-weight:750!important;color:#744562!important;
  }
  body.mm-landscape-workbench .mm-tabbar .mm-tab[aria-selected=true]{color:#fff!important;background:#a83c78!important;border-color:#a83c78!important;}
  body.mm-landscape-workbench .mm-tabbar .mm-tab svg{width:15px;height:15px;display:block;flex:0 0 auto;}
  body.mm-landscape-workbench .mm-tab-pane{padding:1px 2px 12px!important;min-width:0!important;}
  body.mm-landscape-workbench .mm-mirror-tools .control-group{background:#fff!important;border:1px solid #eddbe5!important;border-radius:10px!important;padding:9px 8px!important;margin:5px 0!important;}
  body.mm-landscape-workbench .mm-mirror-tools input[type=range]{width:100%;min-height:29px;accent-color:#a83c78;}
  body.mm-landscape-workbench .mm-mirror-tools .hint{font-size:10px;line-height:1.4;}
  body.mm-landscape-workbench .workspace:not(.focus-layout) .status{display:none!important;}
  body.mm-landscape-workbench .workspace:not(.focus-layout) .stage-top .mm-page-more{
    display:inline-flex!important;flex:0 0 auto!important;text-decoration:none!important;
    align-items:center!important;min-height:23px!important;padding:3px 6px!important;
    color:#8d3567!important;background:#fff7fb!important;border:1px solid #e4c8d7!important;
    border-radius:99px!important;font-size:10px!important;font-weight:750!important;
    letter-spacing:0!important;touch-action:manipulation!important;
  }
  body.mm-landscape-workbench .partner .mm-page-return{
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    padding:9px 15px!important;min-height:44px!important;margin-top:12px!important;
    border:1px solid #a83c78!important;border-radius:10px!important;background:#fff!important;
    color:#873d6a!important;text-decoration:none!important;font-size:13px!important;font-weight:750!important;
  }
  /* Photo editor: same tabbed mobile editor, not a squashed MacBook panel. */
  body.mm-landscape-workbench .profile-studio:not([hidden]){
    display:flex!important;flex-direction:column!important;position:fixed!important;inset:0!important;z-index:80!important;
    height:100dvh!important;max-height:none!important;min-height:0!important;width:100%!important;
    max-width:none!important;margin:0!important;padding:max(4px,env(safe-area-inset-top)) 7px max(4px,env(safe-area-inset-bottom))!important;
    overflow:hidden!important;overscroll-behavior:contain!important;
    background:linear-gradient(135deg,#fff1f8,#f6eafa)!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .profile-heading{
    flex:0 0 32px!important;min-height:32px!important;position:static!important;
    padding:0 3px 4px!important;margin:0!important;display:flex!important;
    align-items:center!important;justify-content:space-between!important;background:transparent!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .profile-heading h2{font-size:18px!important;line-height:1.2!important;margin:0!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .profile-heading .profile-close{min-height:31px!important;padding:4px 10px!important;margin:0!important;font-size:11px!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .profile-layout{
    flex:1 1 auto!important;min-height:0!important;min-width:0!important;
    display:block!important;overflow:hidden!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .profile-stage-side{
    display:grid!important;grid-template-columns:minmax(0,47fr) minmax(0,53fr)!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    width:100%!important;max-width:none!important;height:100%!important;min-height:0!important;
    gap:7px!important;overflow:hidden!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-preview-dock{
    display:flex!important;position:static!important;inset:auto!important;
    grid-column:1!important;grid-row:1 / 3!important;
    width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
    align-items:center!important;justify-content:center!important;flex-direction:column!important;
    padding:5px!important;overflow:hidden!important;border:1px solid #e6c3d6!important;
    background:#fffafd!important;border-radius:12px!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-preview-note{display:none!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-stage,
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-stage.ratio-3-4,
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-stage.ratio-1-1{
    flex:0 1 auto!important;height:auto!important;min-height:0!important;
    max-height:calc(100dvh - 62px)!important;max-width:100%!important;
    width:min(100%,calc((100dvh - 62px) * .8))!important;
    margin:auto!important;position:relative!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-stage.ratio-3-4{width:min(100%,calc((100dvh - 62px) * .75))!important;aspect-ratio:3/4!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-stage.ratio-1-1{width:min(100%,(100dvh - 62px))!important;aspect-ratio:1!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .mm-photo-tools{
    display:block!important;grid-column:2!important;grid-row:1!important;
    min-height:0!important;height:100%!important;width:100%!important;
    overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important;
    margin:0!important;padding:4px 8px!important;background:#fffafd!important;
    border:1px solid #ead0df!important;border-radius:12px!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .mm-photo-save-dock{
    display:flex!important;grid-column:2!important;grid-row:2!important;
    min-width:0!important;flex:0 0 auto!important;width:100%!important;
    gap:6px!important;margin:0!important;padding:4px!important;background:#fff8fc!important;
    border:1px solid #ead0df!important;border-radius:10px!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .mm-photo-save-dock[hidden]{display:none!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .mm-photo-save-dock button{min-height:37px!important;padding:5px 7px!important;font-size:12px!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .mm-photo-save-dock .mm-dock-save{
    flex:1 1 auto!important;color:white!important;background:#a83c78!important;border-color:#a83c78!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .mm-photo-tools .mm-tabbar{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  body.mm-landscape-workbench.mm-visual-editor .mm-visual-choices{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:6px 0!important;}
  body.mm-landscape-workbench.mm-visual-editor .mm-choice{min-width:0!important;min-height:0!important;padding:5px 2px!important;border:2px solid #ead7e3!important;border-radius:9px!important;background:#fff!important;display:flex;flex-direction:column;align-items:center;gap:3px;}
  body.mm-landscape-workbench.mm-visual-editor .mm-choice[aria-pressed=true]{border-color:#a83c78!important;background:#f9e8f3!important;}
  body.mm-landscape-workbench.mm-visual-editor .mm-choice canvas{width:min(100%,66px);height:70px;object-fit:cover;border-radius:6px;display:block;}
  body.mm-landscape-workbench.mm-visual-editor .mm-choice-name{font-size:10px;line-height:1.1;}
  body.mm-landscape-workbench.mm-visual-editor .portrait-quick-edit #portraitFilter,
  body.mm-landscape-workbench.mm-visual-editor .portrait-quick-edit #portraitFrame{
    position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;
    overflow:hidden!important;clip:rect(0,0,0,0)!important;pointer-events:none!important;
  }
  body.mm-landscape-workbench.mm-visual-editor .mm-workbench-hint{display:block!important;font-size:10px;margin:3px 0;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-confirmation,
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-quick-edit,
  body.mm-landscape-workbench .profile-studio:not([hidden]) .profile-settings,
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-editor-actions,
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-stage-actions,
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-review,
  body.mm-landscape-workbench .profile-studio:not([hidden]) #clearPortrait,
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-status{
    display:block;width:100%!important;max-width:none!important;margin-left:0!important;margin-right:0!important;
    position:static!important;top:auto!important;bottom:auto!important;left:auto!important;
  }
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-confirmation[hidden],
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-review[hidden],
  body.mm-landscape-workbench .profile-studio:not([hidden]) #clearPortrait[hidden]{display:none!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-stage-actions{display:flex!important;flex-wrap:wrap!important;gap:6px!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-stage-actions button{min-width:0!important;flex:1 1 44%!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-quick-edit{padding:5px!important;margin:0!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .portrait-quick-edit .control-group{margin:5px 0!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .profile-settings{padding:5px!important;}
  body.mm-landscape-workbench.mm-visual-editor .profile-studio:not(.mm-has-photo) .portrait-quick-edit{display:none!important;}
  body.mm-landscape-workbench .profile-studio:not([hidden]) .editor-intro{display:none!important;}
  body.mm-landscape-workbench:has(.profile-studio:not([hidden])){overflow:hidden!important;}
}

/* v1.5.17: distinguish live picture lift from the optional light-colored screen frame. */
#lightOptions>input[type=range]{width:100%}
#lightOptions .hint{margin:2px 0 12px}


/* v1.5.18 — Night Touch-Up: genuine bright screen area + temporary live boost.
   We cannot override physical screen brightness in iOS Safari. */
.mm-night-setting{margin:8px 0 10px;padding:10px;border:1px solid #ead6e2;border-radius:12px;background:#fff9fd}
.mm-night-setting-button{display:flex;align-items:center;gap:7px;width:100%;min-height:43px;border:1px solid #d8b3ca;border-radius:10px;background:#fff;color:#753656;font-size:13px;font-weight:800;padding:8px 11px;cursor:pointer}
.mm-night-setting-button>span{font-size:22px;line-height:1}
.mm-night-setting-button small{margin-left:auto;display:inline-block;font-size:11px;text-transform:uppercase;letter-spacing:.07em}
.mm-night-setting-button[aria-pressed=true]{background:#7b416b;border-color:#7b416b;color:#fff}
.mm-night-setting .mm-night-description{margin:7px 2px 1px!important;font-size:11px;line-height:1.5;color:#6f5669}
.mm-night-levels{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:10px 0 0}
.mm-night-level{min-height:38px;border:1px solid #d8c6d1;border-radius:10px;background:#fff;color:#6a3d59;font-size:12px;font-weight:700;padding:8px 6px;cursor:pointer}
.mm-night-level.is-selected{background:#f7e6f0;border-color:#c76d9a;color:#7c2a58;box-shadow:inset 0 0 0 1px #e4a7c4}
.mm-night-level-hint{margin-top:8px!important}

/* Night makes the surrounding interface a useful broad white reflector.
   The border takes some image area by design; a wider white area creates more
   useful face illumination than a dim translucent decorative outline. */
body.mm-night-active{background:#fff!important}
body.mm-night-active .workspace:not(.focus-layout),
body.mm-night-active .mirror-column,
body.mm-night-active #controls,
body.mm-night-active .mm-mirror-tools,
body.mm-night-active .mm-tabbar,
body.mm-night-active .mm-tab-pane,
body.mm-night-active .mm-mobile-ribbon,
body.mm-night-active .stage-top{background:#fff!important}
body.mm-night-active .stage{border-color:#fff!important;box-shadow:0 0 0 3px #fff!important}
body.mm-night-active .stage .light-frame,
body.mm-night-active .stage .light-frame.on{
  opacity:1!important;
  border-style:solid!important;
  border-color:#fff!important;
  border-width:var(--mm-night-border-width,clamp(34px,8.6vw,60px))!important;
  box-shadow:inset 0 0 20px rgba(255,255,255,.25)!important;
  transition:border-width .15s ease,opacity .15s ease!important;
}
body.mm-night-active .mm-mobile-ribbon .mm-night-tile{background:#6d376a!important;color:#fff!important;border-color:#6d376a!important}
body.mm-night-active #stateBadge{color:#6e3b60!important}
/* Add the one-touch Night tile without increasing the quick-controls row height. */
@media (max-width:760px) and (orientation:portrait){
  body.mm-refined-mobile .mm-mobile-ribbon{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important}
  body.mm-refined-mobile .mm-mobile-ribbon .mm-action-tile{padding:5px 1px!important;min-width:0!important}
  body.mm-refined-mobile .mm-mobile-ribbon .mm-action-tile span{font-size:10px!important;line-height:1.12!important;overflow-wrap:anywhere;text-align:center}
  body.mm-refined-mobile .mm-mobile-ribbon svg{width:19px;height:19px}
  body.mm-night-active.mm-refined-mobile .workspace:not(.focus-layout){background:#fff!important}
  body.mm-night-active .stage .light-frame,
  body.mm-night-active .stage .light-frame.on{border-width:var(--mm-night-border-width-mobile,clamp(30px,10vw,48px))!important}
}
/* Narrow landscape phone: keep four touch-friendly shortcuts, and expose Night
   within the scrollable Adjust tab instead of squeezing five tiny buttons. */
@media (orientation:landscape) and (max-height:560px) and (max-width:1000px) and (pointer:coarse){
  body.mm-landscape-workbench .mm-night-tile{display:none!important}
  body.mm-night-active .stage .light-frame,
  body.mm-night-active .stage .light-frame.on{border-width:var(--mm-night-border-width-landscape,clamp(14px,3.2vw,27px))!important}
  body.mm-night-active .workspace:not(.focus-layout){background:#fff!important}
  body.mm-night-active .controls .mm-night-setting{background:#fff!important}
}
body[data-mm-night-level="subtle"]{--mm-night-border-width:clamp(20px,5.2vw,36px);--mm-night-border-width-mobile:clamp(18px,6vw,30px);--mm-night-border-width-landscape:clamp(10px,2.1vw,18px)}
body[data-mm-night-level="balanced"]{--mm-night-border-width:clamp(28px,7vw,48px);--mm-night-border-width-mobile:clamp(24px,8vw,40px);--mm-night-border-width-landscape:clamp(12px,2.6vw,22px)}
body[data-mm-night-level="bright"]{--mm-night-border-width:clamp(36px,9.5vw,64px);--mm-night-border-width-mobile:clamp(32px,10.8vw,52px);--mm-night-border-width-landscape:clamp(15px,3.4vw,28px)}
@media(prefers-reduced-motion:reduce){body.mm-night-active .stage .light-frame{transition:none!important}}

/* v1.5.27 — open directly into the live mirror from site CTAs.
   No extra start screen or second permission button is shown while access is pending. */
html.mm-mirror-first .intro{display:none!important}
html.mm-mirror-first .workspace:not(.expanded){margin-top:clamp(8px,1.5vw,18px)}
html.mm-mirror-first #empty .empty-mirror{display:none}
html.mm-mirror-first #empty #openStage[hidden]{display:none!important}
html.mm-mirror-first #empty{padding:22px}
html.mm-mirror-first #empty h2{margin-top:10px}
html.mm-mirror-first .workspace:focus{outline:none}
@media(max-width:760px){html.mm-mirror-first .workspace:not(.expanded){margin-top:4px}}


/* v1.5.30 — Mac/desktop enlarged view must retain reachable controls.
   The classic Expand Mirror button gives the mirror the left work area and
   keeps the full controls at right, with independent scrolling. The separate
   immersive Full Screen button remains the clean, tap-to-show experience. */
@media (min-width:761px) and (min-height:561px){
  #workspace.expanded:not(.focus-layout){
    position:fixed!important;inset:0!important;width:100%!important;
    height:100dvh!important;max-width:none!important;max-height:none!important;
    margin:0!important;padding:clamp(8px,1.1vw,15px)!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) clamp(278px,26vw,370px)!important;
    gap:clamp(8px,1.1vw,16px)!important;align-items:stretch!important;
    background:#fff4f8!important;overflow:hidden!important;
    z-index:10000!important;border-radius:0!important;
  }
  #workspace.expanded:not(.focus-layout) .mirror-column{
    display:flex!important;flex-direction:column!important;
    min-width:0!important;min-height:0!important;height:100%!important;
    overflow:hidden!important;
  }
  #workspace.expanded:not(.focus-layout) .stage-top{
    display:flex!important;flex:0 0 auto!important;position:static!important;
    align-items:center!important;padding:0 4px 8px!important;
  }
  #workspace.expanded:not(.focus-layout) .stage{
    display:block!important;position:relative!important;flex:1 1 auto!important;
    width:100%!important;height:auto!important;min-height:0!important;
    max-height:none!important;margin:0!important;border-radius:12px!important;
  }
  #workspace.expanded:not(.focus-layout) .mirror-tools{
    position:static!important;display:flex!important;flex:0 0 auto!important;
    padding:6px 0 0!important;z-index:auto!important;
  }
  #workspace.expanded:not(.focus-layout) .quickbar{
    position:static!important;display:flex!important;flex:0 0 auto!important;
    flex-wrap:wrap!important;align-items:center!important;justify-content:center!important;
    gap:6px!important;margin:0!important;padding:8px 0 0!important;
    background:none!important;
  }
  #workspace.expanded:not(.focus-layout) .quickbar button{
    min-height:38px!important;font-size:11px!important;
    padding:6px 9px!important;line-height:1.3!important;
  }
  #workspace.expanded:not(.focus-layout) .controls{
    display:block!important;position:relative!important;
    width:100%!important;height:100%!important;max-height:none!important;
    min-width:0!important;min-height:0!important;
    overflow-y:auto!important;overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    padding:16px!important;margin:0!important;
    background:#fffafd!important;border:1px solid #edd2e1!important;
  }
  #workspace.expanded:not(.focus-layout) .status{display:none!important}
  #workspace.expanded:not(.focus-layout) #fullscreen{
    background:#8a416c!important;color:white!important;border-color:#8a416c!important;
  }
  #workspace.expanded:not(.focus-layout) #fullscreen:focus-visible,
  #workspace.expanded:not(.focus-layout) .controls :focus-visible{
    outline:3px solid #d95a96!important;outline-offset:2px!important;
  }
}
