/* Camera and editor share the same safe portrait viewport. */
.studio-page{background:#08080a}.studio-head{z-index:4;top:calc(var(--safe-t) + 12px)}.studio-head strong{font-size:18px;letter-spacing:-.02em;display:grid;text-align:center;gap:3px}.studio-head strong small{font-size:8px;color:#c5c2ce;letter-spacing:.22em}.studio-head .icon-btn,.studio-tools .tool{background:#16161c9c;backdrop-filter:blur(16px);border:1px solid #ffffff20;border-radius:50%;min-width:44px;min-height:44px}.studio-tools{gap:12px;top:calc(var(--safe-t) + 90px);z-index:3}.studio-tools .tool{font-size:10px;font-weight:700}.studio-shade{background:linear-gradient(#0009,transparent 22%,transparent 54%,#000 100%)}.studio-bottom{gap:12px;bottom:calc(var(--safe-b) + 14px);z-index:3}.studio-effects{padding:6px 20px;gap:9px}.studio-effects button{display:grid;justify-items:center;border:0;background:transparent;font-size:10px;padding:4px 6px;gap:6px;color:#ddd;min-width:54px}.studio-effects button:before{content:'';width:32px;height:32px;border-radius:50%;background:linear-gradient(125deg,#dce7fa,#738a96,#c789a1);box-shadow:0 0 0 2px #ffffff20}.studio-effects button[aria-pressed=true]{background:transparent;color:white}.studio-effects button[aria-pressed=true]:before{box-shadow:0 0 0 3px #fff,0 0 0 6px #ffffff18}.studio-effects button[data-effect=warm]:before{background:linear-gradient(120deg,#eec888,#bc6e57)}.studio-effects button[data-effect=cool]:before{background:linear-gradient(120deg,#b9e2e8,#758ab8)}.studio-effects button[data-effect=mono]:before{background:linear-gradient(120deg,#eee,#333)}.studio-modes{gap:clamp(8px,4vw,22px);font-size:12px}.studio-modes button{font-size:12px}.studio-modes [aria-pressed=true]{border:0;color:white;position:relative}.studio-modes [aria-pressed=true]:after{content:'';position:absolute;bottom:1px;left:45%;width:5px;height:5px;background:#fff;border-radius:50%}.studio-capture .shutter{width:78px;height:78px;border:3px solid #fff;box-shadow:0 0 0 6px #ffffff15;background:#ffffff0d}.studio-capture .shutter span{display:block;width:100%;height:100%;border-radius:50%;background:#fff}.studio-capture .shutter.recording span{background:#ff335a;border-radius:8px;width:35%;height:35%;margin:auto}.studio-labels{font-size:8px;color:#bdbbc5;letter-spacing:.06em}.studio-lens{position:absolute;left:20px;bottom:calc(var(--safe-b) + 256px);display:flex;gap:12px;align-items:center;z-index:3;max-width:calc(100% - 90px);flex-wrap:wrap}.studio-lens>span{font-size:9px;letter-spacing:.06em;background:#0007;border-radius:12px;padding:6px 9px}.studio-lens label{font-size:10px;display:grid;gap:2px}.studio-lens input{width:90px}.studio-grid{position:absolute;inset:0;background:linear-gradient(to right,transparent 33.1%,#ffffff55 33.3%,transparent 33.5%,transparent 66.4%,#ffffff55 66.6%,transparent 66.8%),linear-gradient(to bottom,transparent 33.1%,#ffffff55 33.3%,transparent 33.5%,transparent 66.4%,#ffffff55 66.6%,transparent 66.8%);pointer-events:none}.studio-status{font-size:13px;max-width:280px;margin:auto;line-height:1.5;padding:10px;border-radius:15px}.studio-status:empty{display:none}.studio-review>img,.studio-review>video{max-height:48dvh}
.sheet-creator{padding:0!important;width:min(100vw,900px)!important;max-width:100vw!important;max-height:100dvh!important;height:100dvh!important;margin:0 auto!important;inset:0!important;background:#08080a!important;border:0!important;border-radius:0!important}.sheet-creator .sheet-panel{height:100%;max-height:100%;display:flex;flex-direction:column;overflow:hidden;padding:0!important;border-radius:0;background:#08080a}.creator-head{display:flex;align-items:center;justify-content:space-between;padding:calc(var(--safe-t) + 8px) 16px 8px;flex:none;gap:10px;border-bottom:1px solid #ffffff12}.creator-head strong{font-size:14px}.creator-stage{position:relative;min-height:100px;flex:1;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#000}.creator-stage canvas{height:100%;width:auto;max-width:100%;object-fit:contain}.creator-format{position:absolute;left:12px;top:10px;color:#fff9;font-size:10px;background:#0007;padding:5px 8px;border-radius:15px}.creator-play{position:absolute;right:14px;bottom:12px;background:#0007;border:1px solid #fff4;border-radius:50%}#creator-status{min-height:22px;font-size:11px;color:#c9c6d2;padding:4px 16px;margin:0;text-align:center;flex:none}.creator-tabs{display:flex;justify-content:space-around;border-block:1px solid #ffffff18;flex:none}.creator-tabs button{padding:13px 8px;font-size:12px;color:#aaa;min-height:44px}.creator-tabs [aria-pressed=true]{color:#fff;box-shadow:inset 0 -2px #d7c6ff}.creator-controls{height:210px;flex:none;overflow:auto;padding:14px 16px calc(var(--safe-b) + 12px);display:grid;gap:12px;align-content:start}.creator-controls input:not([type=range]):not([type=color]):not([type=file]),.creator-controls textarea,.creator-controls select{width:100%;background:#1a191e;color:white;border:1px solid #ffffff20;border-radius:10px;padding:10px;font-size:13px;min-width:0}.creator-controls input[type=color]{height:30px;width:50px;border:0;background:none}.creator-field{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:#d1ced8}.creator-field input[type=number]{max-width:100px}.creator-range-grid{display:grid;gap:10px}.creator-range-grid label{display:grid;grid-template-columns:100px 1fr}.creator-controls input[type=range],.producer-mixer input{accent-color:#c3a7ff;min-width:0;width:100%}.theme-list{display:flex;gap:10px;overflow-x:auto;padding:3px;scrollbar-width:none}.theme-preview{flex:none;width:76px;min-height:94px;border:1px solid #ffffff25;border-radius:12px;background:#22212b;display:grid;align-content:center;gap:8px;text-align:center;color:white}.theme-preview span{font:700 28px Georgia}.theme-preview small{font-size:9px}.theme-preview[aria-pressed=true]{outline:2px solid #c9b0ff;outline-offset:1px}.theme-paper{background:#eae3d4;color:#28231e}.theme-quote{background:#302237}.theme-instant{background:#e9e7e2;color:#1d1b1b;border:8px solid #fff}.theme-neon{background:#181323;box-shadow:inset 0 0 14px #a855f777}.theme-cinema{background:linear-gradient(#000 15%,#30414a 15%,#30414a 85%,#000 85%)}.sound-current{display:flex;gap:7px;align-items:center;flex-wrap:wrap;font-size:12px}.sound-current strong{flex:1;overflow-wrap:anywhere}.sound-choice{display:inline-flex;gap:8px;align-items:center;padding:10px;font-size:12px;border:1px solid #ffffff22;border-radius:12px;max-width:100%;overflow-wrap:anywhere}#saved-sounds{display:flex;gap:8px;flex-wrap:wrap}.sound-choice svg{width:18px}.creator-controls .fine{font-size:10px;line-height:1.5}.creator-controls .btn{font-size:11px;min-height:40px;padding:8px 12px}#creator-cancel-export{margin:0 16px calc(var(--safe-b) + 8px);flex:none}.producer-options{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}.producer-options label{display:grid;gap:8px;color:#aaa;font-size:12px}.producer-options select{min-width:0;width:100%;background:#1c1b20;border:1px solid #333;border-radius:10px;padding:10px;color:#fff}.producer-arrangement{display:flex;border-radius:10px;overflow:hidden;min-height:38px;background:#272032}.producer-arrangement span{flex:1;text-align:center;padding:12px 0;font-size:8px;letter-spacing:.07em;border-right:2px solid #000}.producer-arrangement span:nth-child(2){background:#4c365b;flex:2}.producer-arrangement span:nth-child(3){background:#33294d;flex:2}.producer-mixer{background:#17161c;padding:15px;border:1px solid #ffffff14;border-radius:16px}.producer-mixer summary{font-size:13px;cursor:pointer}.producer-mixer label{display:grid;grid-template-columns:65px 1fr;gap:15px;align-items:center;font-size:12px;margin-top:18px;text-transform:capitalize}.producer-output{background:linear-gradient(150deg,#2a2136,#14131b);border:1px solid #ffffff22;border-radius:20px;padding:20px;display:grid;gap:15px}.producer-output[hidden]{display:none}.producer-output h2{font-size:20px}.producer-output audio{width:100%}.producer-output .btn{font-size:12px}.music-page .study-hero{padding:18px 0}.music-page .study-hero h2{font-size:30px}.music-page #beat-art{height:190px;object-position:center}.music-page .beat-controls{gap:18px}.music-page .study-hero p{font-size:14px;color:#bbb;line-height:1.6}.music-page #beat-status{min-height:24px;color:#d8c9ff}
@media(min-width:768px){#studio-camera{width:auto;max-width:100%;margin:auto;aspect-ratio:9/16;object-fit:cover}.studio-lens{left:calc(50% - 200px)}.studio-grid{left:calc(50% - 28.125dvh);right:calc(50% - 28.125dvh)}.sheet-creator .creator-controls{height:220px}.music-page{max-width:720px;margin:auto}.studio-head{max-width:560px}.studio-tools{right:max(24px,calc(50% - 250px))}}
@media(max-height:600px){.studio-effects button:before{width:23px;height:23px}.studio-bottom{gap:4px}.studio-capture .shutter{width:55px;height:55px}.studio-lens{bottom:190px}.studio-tools{top:65px;gap:4px}.creator-controls{height:150px}.creator-head{padding-top:5px}.creator-tabs button{padding:6px;min-height:34px}}

.saved-sound{display:flex;align-items:center;max-width:100%;border:1px solid #ffffff22;border-radius:12px}.saved-sound .sound-choice{border:0;min-width:0}.saved-sound .icon-btn{flex:none;width:40px;height:40px}.creator-slides{display:flex;gap:10px;overflow:auto}.creator-slides>span{position:relative;flex:none}.creator-slides [data-slide]{width:55px;height:70px;border:2px solid transparent;border-radius:8px;overflow:hidden}.creator-slides [aria-pressed=true]{border-color:#c9b0ff}.creator-slides img{width:100%;height:100%;object-fit:cover}.creator-slides [data-remove-slide]{position:absolute;right:0;top:0;background:#000a;border-radius:50%;width:24px;height:24px;color:white}

#studio-ar-overlay{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}.studio-ar-panel{position:absolute;z-index:5;left:16px;top:calc(var(--safe-t) + 75px);width:min(240px,calc(100% - 100px));padding:12px;background:#111b;backdrop-filter:blur(16px);border:1px solid #ffffff25;border-radius:16px}.studio-ar-panel[hidden]{display:none}.studio-ar-panel label{display:grid;gap:8px;font-size:12px}.studio-ar-panel select{padding:9px;background:#202027;color:white;border:1px solid #ffffff33;border-radius:9px;width:100%}#studio-ar-status{display:block;font-size:10px;color:#d8c6ff;margin-top:8px;line-height:1.4}.studio-tools [aria-pressed=true]{border-color:#cab0ff;background:#4b356a99}@media(min-width:768px){#studio-ar-overlay{width:auto;max-width:100%;margin:auto;aspect-ratio:9/16;object-fit:cover}.studio-ar-panel{left:max(16px,calc(50% - 240px));}}@media(max-height:600px){.studio-tools{grid-template-columns:repeat(2,44px);gap:5px}.studio-ar-panel{top:55px;left:10px;width:200px;}.studio-tools .tool{min-height:38px;min-width:38px}}
/* Template discovery stays inside the sheet, including narrow phones. */
.template-intro{font-size:18px;line-height:1.35;color:#eee}.template-pick{width:100%;min-height:46px;justify-content:center;gap:8px}.template-pick svg{width:20px;height:20px}#template-status{font-size:12px;line-height:1.5;color:#aaa;min-height:36px}#template-search{width:100%;min-width:0;margin-bottom:14px}.template-count{display:flex;align-items:center;gap:4px;font-size:10px;color:#d2c7eb;margin-top:9px}.template-count svg{width:12px;height:12px;margin-left:auto}.template-card small{line-height:1.45;min-height:30px}.template-card{min-width:0}.template-browser .template-gallery{padding-bottom:20px}.lens-category[hidden],.fx-item[hidden]{display:none!important}
.template-browser #template-search{border:1px solid #ffffff25;border-radius:12px;background:#222;color:#fff;padding:12px 14px;font:inherit;appearance:none}.template-browser #template-search:focus{outline:2px solid #bdabf6;outline-offset:2px}.template-count{font-size:11px;line-height:1.4}.template-count svg{display:none}
.theme-preview canvas{width:100%;height:108px;object-fit:cover;border-radius:8px}.theme-preview{padding:4px;align-content:start;gap:5px}.theme-preview small{padding:0 2px 4px}.theme-list{padding-block:4px}
.discard-dialog{width:min(360px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:24px;border:1px solid #fff2;border-radius:22px;background:#171719;color:#fff;box-shadow:0 20px 90px #0009}.discard-dialog::backdrop{background:#0009;backdrop-filter:blur(8px)}.discard-dialog h2{font-size:21px;line-height:1.3;margin:0 0 12px}.discard-dialog p{font-size:14px;line-height:1.6;color:#bdbdc4;margin:0 0 20px}.discard-dialog button{display:block;width:100%;min-height:46px;border-radius:12px;background:#fff;color:#111;font-size:14px;font-weight:650;margin-top:9px}.discard-dialog #discard-confirm{background:#ff315a;color:#fff}.photo-effects{flex:none;min-width:0;background:#101012;padding:8px 0 5px}.photo-effects>p{display:flex;justify-content:space-between;gap:8px;padding:0 14px;font-size:11px;margin:0 0 4px}.photo-effects>p small{color:#929299;font-size:10px}.photo-effect-strip{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;padding:4px calc(50% - 36px);scrollbar-width:none;overscroll-behavior:contain;position:relative;touch-action:pan-x}.photo-effect-strip button{flex:0 0 72px;width:72px;scroll-snap-align:center;display:grid;justify-items:center;gap:4px;min-width:0;background:none;color:#aaa}.photo-effect-strip small{font-size:9px;max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.effect-swatch{display:block;width:42px;height:42px;border-radius:50%;border:2px solid #ffffff25;background:linear-gradient(125deg,#b8c8d2,#627b8e,#ca9c93)}.photo-effect-strip [aria-selected=true]{color:#fff}.photo-effect-strip [aria-selected=true] .effect-swatch{border-color:#fff;box-shadow:0 0 0 2px #ffffff30}.swatch-mono,.swatch-noir{background:linear-gradient(125deg,#fff,#777,#171717)}.swatch-warm,.swatch-golden{background:linear-gradient(125deg,#f7d7a5,#ab7059,#493c3b)}.swatch-creative,.swatch-ar-lenses{background:linear-gradient(125deg,#7ca4d0,#9c719f,#e8c7ab)}.swatch-worlds{background:linear-gradient(125deg,#183a58,#9a5b75,#c6ab87)}.quick-view canvas{width:100%;height:100%;max-height:100%;object-fit:contain;touch-action:pan-y}.quick-view [hidden]{display:none!important}#studio-original{white-space:nowrap}.cam-modes{max-width:100%;gap:0}.cam-modes button{padding-inline:clamp(6px,2.8vw,16px)}.creator-head{gap:6px}.creator-head strong{min-width:0}.creator-head #creator-original{flex:none;width:38px;height:38px}.keyboard-open .photo-effects{display:none}
@media(max-width:340px){.quick-head{gap:4px;padding-inline:6px}.quick-head>span{display:none}.quick-edit{padding-inline:9px;font-size:11px}.cam-modes button{padding-inline:7px;font-size:12px}.lens-categories button{padding-inline:9px}.creator-head strong{font-size:12px}.creator-head{padding-inline:8px}}@media(max-height:600px){.photo-effects{padding-top:3px}.photo-effect-strip .effect-swatch{width:32px;height:32px}.photo-effects>p{margin-bottom:0}.photo-effect-strip{padding-block:1px}.quick-head{min-height:44px}.creator-head{min-height:44px}}
.quick-view .photo-effects{position:absolute;left:0;right:0;bottom:0;z-index:3;background:linear-gradient(transparent,#08080bd9 22%);padding-top:15px}.quick-view .photo-effects>p{color:#fff}.quick-view .photo-effect-strip small{text-shadow:0 1px 4px #000}.quick-view .photo-effect-strip button{background:none}

.quick-view img,.quick-view canvas{touch-action:pan-y}

/* Keep the camera/editor at the layout viewport scale when iOS focuses fields. */
@media(pointer:coarse){.sheet input:not([type=range]):not([type=color]),.sheet textarea,.sheet select,.cam input:not([type=range]),.cam textarea{font-size:16px!important}.creator-controls{overscroll-behavior-y:contain}.quick-caption textarea{font-size:16px!important}}
.device-save-dialog{width:min(360px,calc(100vw - 32px));padding:24px;background:#171719;color:#fff;border:1px solid #fff3;border-radius:22px;max-height:calc(var(--viewport-h,100dvh) - 40px);overflow:auto}.device-save-dialog::backdrop{background:#0009}.device-save-dialog h2{font-size:21px}.device-save-dialog p{font-size:14px;line-height:1.5;overflow-wrap:anywhere;color:#c3c3cc}.device-save-dialog button{display:block;min-height:46px;width:100%;border-radius:12px;margin-top:12px;background:#fff;color:#111}.device-save-dialog #device-save-done{background:#33343a;color:#fff}.device-save-dialog button:disabled{opacity:.45}
.cam-quality{position:absolute;top:72px;left:14px;z-index:5;background:#0007;color:#fff;padding:6px 10px;border:1px solid #fff3;border-radius:20px;font-size:11px;min-height:32px;max-width:calc(100% - 85px)}.cam-quality[aria-pressed=false]{color:#bbb}.photo-effect-strip .effect-swatch{object-fit:cover}
.fx-item>.fx-cover{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.fx-item canvas{position:relative;opacity:0}.fx-item.has-thumb canvas{opacity:1}.fx-grid button{position:relative}.fx-grid .fx-cover{position:absolute;top:0;left:50%;transform:translateX(-50%);width:54px;height:54px;object-fit:cover;border-radius:50%}.fx-grid button canvas{position:relative;opacity:0}.fx-grid button.has-thumb canvas{opacity:1}.fx-grid button.has-thumb .fx-cover{visibility:hidden}
@media(max-height:450px){.cam-quality{top:58px;left:10px}}

.creator-stage{touch-action:none;overscroll-behavior:contain}.creator-stage canvas{user-select:none;-webkit-user-select:none}.quick-view img{-webkit-user-drag:none;user-select:none}

/* Keep the expanded tool rail above capture modes; its extra tools scroll inside it. */
.cam-rail.expanded{max-height:calc(100% - 276px);z-index:7}.cam-rail .cam-tool{flex-shrink:0}.cam-rail.expanded .cam-rail-extra{min-height:0;flex-shrink:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}.cam-rail-extra::-webkit-scrollbar{display:none}
@media(max-height:500px){.cam-rail,.cam-rail.expanded{max-height:calc(100% - 120px);overflow-y:auto;overscroll-behavior:contain;z-index:7}.cam-rail.expanded .cam-rail-extra{flex-shrink:0;overflow:visible}}
