/* 커브: 아이콘과 같은 색. 짙은 와인 바탕, 흰 그림 단추, 핫핑크 강조. 사진이 화면 가득, 도구는 엄지 아래 */
:root{--bg:#1B0A11;--surface:#22101A;--ink:#FFF3F1;--muted:#C7A2AE;--line:#4A2633;--accent:#E23A68;--accent-ink:#FFFFFF;--wine:#5A1630;--butter:#FFB3C7;--stage:#0E0B12;
--display:"Gowun Batang","AppleMyungjo","Nanum Myeongjo","Noto Serif KR",serif;--body:"Gowun Dodum","Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR",sans-serif;color-scheme:dark}
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%;margin:0}
body{background:var(--bg);color:var(--ink);font:15px/1.5 var(--body);overflow:hidden;-webkit-text-size-adjust:100%}
button,input,textarea{font:inherit;color:inherit}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.app{height:100%;max-width:480px;margin:0 auto;display:flex;flex-direction:column}
.btn{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:8px 14px;min-height:40px;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}
.btn.primary{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.btn:disabled{opacity:.45;cursor:default}
.row{display:flex;align-items:center;gap:10px}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
.top{display:flex;align-items:center;gap:8px;padding:10px 16px 8px}
.top h1{font:700 22px/1 var(--display);margin:0 auto 0 6px;position:relative;isolation:isolate;letter-spacing:-.01em}
.top h1::before{content:"";position:absolute;left:-7px;top:-5px;width:24px;height:24px;border-radius:50%;background:var(--butter);z-index:-1}
:root[data-theme="dark"] .top h1::before{opacity:.35}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .top h1::before{opacity:.35}}
.pick:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.work{flex:1;min-height:0;display:flex;flex-direction:column;padding:0 16px}
.stage-wrap{flex:1;min-height:0;display:grid;place-items:center}
.stage{position:relative;background:var(--stage);border-radius:14px;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;box-shadow:0 14px 30px -20px rgba(43,34,51,.55)}
#gl{display:block;width:100%;height:100%}
.layers{position:absolute;inset:0;pointer-events:none}
.layer{position:absolute;cursor:grab;touch-action:none;pointer-events:auto}
.layer .txt{white-space:pre;text-align:center;line-height:1.3;padding:.12em .38em;border-radius:.22em}
.layer.sel::after{content:"";position:absolute;inset:-5px;border:1.5px dashed #fff;border-radius:6px;box-shadow:0 0 0 1px rgba(43,34,51,.45);pointer-events:none}
.handle{position:absolute;width:28px;height:28px;border-radius:50%;background:#fff;color:#2B2233;border:1px solid rgba(43,34,51,.35);display:grid;place-items:center;padding:0;z-index:1}
.handle svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.handle.del{left:-20px;top:-20px;cursor:pointer}
.handle.size{right:-20px;bottom:-20px;cursor:nwse-resize}
.guides{position:absolute;inset:0;pointer-events:none;z-index:3}
.guides>*{position:absolute;pointer-events:auto;touch-action:none}
.guides span{position:absolute;font-size:10px;line-height:1;background:rgba(43,34,51,.7);color:#fff;border-radius:999px;padding:3px 7px;white-space:nowrap;pointer-events:none}
.g-face{border:2px dashed #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 0 1px rgba(43,34,51,.4);cursor:move}
.g-face span{left:50%;top:-20px;transform:translateX(-50%)}
.g-face i{position:absolute;left:88%;top:90%;width:20px;height:20px;margin:-10px;border-radius:50%;background:#fff;border:1px solid rgba(43,34,51,.4);cursor:nwse-resize}
.g-waist{width:26px;height:26px;border-radius:50%;background:rgba(255,255,255,.9);border:2px solid #B8325F;transform:translate(-50%,-50%);cursor:move}
.g-waist span{left:30px;top:5px}
.g-leg{left:0;right:0;height:26px;transform:translateY(-50%);cursor:ns-resize}
.g-leg::before{content:"";position:absolute;left:0;right:0;top:12px;border-top:2px dashed #fff;filter:drop-shadow(0 0 1px rgba(43,34,51,.8))}
.g-leg span{left:6px;top:-6px}
.safe{position:absolute;inset:0;pointer-events:none}
.safe span{position:absolute;left:0;right:0;background:rgba(43,34,51,.45);color:#fff;font-size:11px;display:grid;place-items:center;text-align:center;padding:0 8px}
.safe .t{top:0;height:11.46%;border-bottom:1.5px dashed rgba(255,255,255,.85)}
.safe .b{bottom:0;height:23.44%;border-top:1.5px dashed rgba(255,255,255,.85)}
.sample-tag{position:absolute;left:8px;top:8px;font-size:11px;background:rgba(43,34,51,.62);color:#fff;border-radius:999px;padding:2px 9px;pointer-events:none}
.nogl{position:absolute;inset:0;display:grid;place-items:center;padding:16px;text-align:center;font-size:13px;color:var(--muted)}
.under{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;min-height:48px}
.pill{border:1px solid var(--line);background:transparent;border-radius:999px;padding:5px 12px;font-size:13px;min-height:32px;cursor:pointer;white-space:nowrap}
.pill[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.pill:disabled{opacity:.4;cursor:default}
.play{display:flex;align-items:center;gap:8px}
.time{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.hold{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.stage.safe-on .sample-tag{top:calc(11.46% + 8px)}
.panel{background:var(--surface);border-top:1px solid var(--line);padding:12px 16px 8px;max-height:52vh;overflow-y:auto}
.pane{display:flex;flex-direction:column;gap:10px}
.strip{display:flex;gap:10px;overflow-x:auto;margin:0 -16px;padding:4px 16px 4px;scrollbar-width:none}
.strip::-webkit-scrollbar,.chips::-webkit-scrollbar{display:none}
.mood{flex:0 0 auto;width:60px;border:0;background:none;padding:0;cursor:pointer;display:grid;gap:5px;justify-items:center;font-size:12px;line-height:1.3;color:var(--muted)}
.mood canvas{width:58px;height:76px;border-radius:29px 29px 9px 9px;display:block;background:var(--stage)}
.mood[aria-pressed="true"]{color:var(--ink)}
.mood[aria-pressed="true"] canvas{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
.row>.lab{flex:0 0 auto;min-width:56px;font-size:13px;color:var(--muted)}
input[type=range]{flex:1;min-width:0;accent-color:var(--accent);height:28px;margin:0}
output{flex:0 0 auto;min-width:44px;text-align:right;font-size:13px;font-variant-numeric:tabular-nums;color:var(--muted)}
.chips{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:2px;flex:0 0 auto}
.chip{flex:0 0 auto;border:1px solid var(--line);background:transparent;border-radius:999px;padding:4px 11px;font-size:13px;min-height:32px;cursor:pointer;white-space:nowrap}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.chip.on::after{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-left:6px;vertical-align:middle}
.link{border:0;background:none;padding:4px 0;font-size:13px;color:var(--accent);cursor:pointer;align-self:flex-start;text-decoration:underline;text-underline-offset:3px}
textarea{flex:1;min-width:0;border:1px solid var(--line);border-radius:12px;background:var(--bg);padding:8px 12px;resize:none;height:40px;line-height:1.4}
.swatches{display:flex;gap:6px;padding:2px}
.sw{width:28px;height:28px;border-radius:50%;border:1px solid var(--line);padding:0;cursor:pointer;flex:0 0 auto}
.sw[aria-pressed="true"]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
.sticker{flex:0 0 auto;width:56px;height:56px;border-radius:14px;border:1px solid var(--line);background:var(--bg);padding:7px;cursor:pointer}
.sticker canvas{width:100%;height:100%;display:block}
.ratio{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.ratio button{border:1px solid var(--line);background:transparent;border-radius:12px;padding:8px 4px 6px;display:grid;justify-items:center;gap:3px;font-size:13px;line-height:1.3;cursor:pointer}
.ratio i{display:block;border:1.5px solid currentColor;border-radius:3px;height:20px}
.ratio small{color:var(--muted);font-size:11px}
.ratio button[aria-pressed="true"]{border-color:var(--accent);color:var(--accent)}
.hint{margin:0;font-size:12px;color:var(--muted)}
.grow{flex:1;min-width:0}
.tabs{display:flex;background:var(--surface);border-top:1px solid var(--line);padding:4px 6px 6px}
.tab{flex:1;min-width:0;border:0;background:none;padding:6px 0 4px;display:grid;justify-items:center;gap:2px;font-size:12px;line-height:1.3;color:var(--muted);cursor:pointer;min-height:48px;border-radius:10px}
.tab svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.tab[aria-selected="true"]{color:var(--accent)}
.sheet-back{position:fixed;inset:0;background:rgba(27,20,32,.5);display:grid;align-items:end;justify-items:center;z-index:10}
.sheet{width:100%;max-width:480px;background:var(--surface);border-radius:20px 20px 0 0;padding:20px 16px 16px;display:grid;gap:12px;max-height:92%;overflow:auto}
.sheet h2{font:700 20px/1.2 var(--display);margin:0;text-wrap:balance}
.sheet p{margin:0;font-size:14px}
.result img,.result video,.result canvas{display:block;max-height:36vh;max-width:100%;margin:0 auto;border-radius:10px}
.result a{display:block;text-align:center;margin-top:8px;color:var(--accent)}
.progress{height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.progress div{height:100%;width:0;background:var(--accent)}
.msg{color:var(--muted);min-height:1.5em}
.sheet .row{justify-content:flex-end}
.toast{position:fixed;left:50%;bottom:246px;transform:translateX(-50%);background:var(--ink);color:var(--bg);padding:8px 14px;border-radius:999px;font-size:13px;z-index:20;max-width:88%;text-align:center}

/* ---- 사진을 화면 가득: 도구는 사진 위에 얹고, 세부 조절은 눌렀을 때만 아래에서 올라온다 ---- */
.app{position:relative;max-width:560px;background:#0E0B12}
.top{position:absolute;left:0;right:0;top:0;z-index:6;padding:10px 12px 22px;background:linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,0));pointer-events:none}
.top>*{pointer-events:auto}
.top h1{color:#fff;font-size:18px;text-shadow:0 1px 4px rgba(0,0,0,.5)}
.top h1::before{opacity:.55;width:20px;height:20px}
.top .btn{background:rgba(20,16,24,.55);color:#fff;border-color:rgba(255,255,255,.35);min-height:36px;padding:6px 12px;font-size:13px}
.top .btn.primary{background:var(--accent);color:var(--accent-ink);border-color:transparent}
.work{position:absolute;inset:0;padding:0}
.stage{border-radius:0;box-shadow:none}
.under{position:absolute;left:10px;bottom:12px;z-index:5;padding:0;min-height:0;flex-direction:column;align-items:flex-start;gap:6px}
.under .pill{background:rgba(20,16,24,.55);color:#fff;border-color:rgba(255,255,255,.35)}
.under .pill[aria-pressed="true"]{background:#fff;color:#2B2233;border-color:#fff}
.under .time{color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.6)}
.rail{position:absolute;right:8px;bottom:12px;z-index:5;display:flex;flex-direction:column;gap:8px}
.q{width:64px;border:1px solid rgba(255,255,255,.22);border-radius:18px;background:rgba(20,16,24,.58);color:#fff;padding:8px 2px 6px;display:grid;justify-items:center;gap:2px;font-size:12px;line-height:1.25;cursor:pointer;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.q svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.q small{font-size:10px;color:var(--butter);min-height:13px;white-space:nowrap}
.q:active{transform:scale(.95)}
.flash{position:absolute;left:50%;top:16%;transform:translateX(-50%);z-index:6;background:rgba(20,16,24,.72);color:#fff;font:700 19px/1.2 var(--display);padding:10px 18px;border-radius:999px;pointer-events:none;white-space:nowrap}
.tools{position:absolute;left:0;right:0;bottom:0;z-index:7}
.tools-close{position:absolute;right:10px;top:-40px;border:1px solid rgba(255,255,255,.35);background:rgba(20,16,24,.6);color:#fff;border-radius:999px;padding:5px 12px;font-size:13px;min-height:32px;cursor:pointer}
.app.tools-on .work{bottom:var(--tools-h,248px)}
.app.tools-on .rail,.app.tools-on .under{display:none}
.toast{bottom:96px}

/* ---- 직접 조절: 부위별 묶음을 고르면 그 부위의 조절 막대가 전부 한꺼번에 보인다 ---- */
.cats{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px 2px;border-bottom:1px solid var(--line)}
.cats::-webkit-scrollbar{display:none}
.catb{flex:0 0 auto;border:0;background:none;padding:8px 10px 9px;font-size:14px;color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap}
.catb[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--accent)}
.catb.on::after{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-left:5px;vertical-align:middle}
.cat{display:flex;flex-direction:column;gap:6px}
.sl{display:flex;align-items:center;gap:10px;min-height:36px}
.sl>span{flex:0 0 76px;font-size:14px}
.sl>button{flex:0 0 44px;border:0;background:none;font-size:13px;color:var(--muted);text-align:right;padding:6px 0;font-variant-numeric:tabular-nums;cursor:pointer}
.sl.on>span{color:var(--accent)}

/* ---- 커브: 아이콘과 같은 색(핫핑크·흰색·와인). 글자 대신 그림 단추, 이름은 길게 누르면 뜨는 설명과 화면 낭독용으로만 남긴다 ---- */
.ic{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;display:block;flex:0 0 auto;pointer-events:none}
.ic .f{fill:currentColor;stroke:none}
.ib{width:44px;height:44px;border-radius:50%;border:1px solid rgba(255,255,255,.3);background:rgba(27,10,17,.55);color:#fff;display:inline-grid;place-items:center;padding:0;cursor:pointer;flex:0 0 auto;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.ib.primary{background:var(--accent);border-color:transparent}
.ib.line{background:transparent;border-color:var(--line);color:var(--ink);-webkit-backdrop-filter:none;backdrop-filter:none}
.ib.wide{width:auto;flex:1;border-radius:999px}
.ib[aria-pressed="true"]{background:#fff;color:var(--wine);border-color:#fff}
.ib:disabled{opacity:.35;cursor:default}
.ib:active,.chip:active,.tab:active,.catb:active,.mood:active{transform:scale(.94)}
.top{padding:10px 12px 24px}
.top h1{margin:0 auto 0 4px;line-height:0}
.top h1::before{display:none}
.top h1 img{height:26px;width:auto;display:block;filter:drop-shadow(0 1px 3px rgba(0,0,0,.5))}
.is-sample .pick{background:var(--accent);border-color:transparent;animation:nudge 1.8s ease-out infinite}
@keyframes nudge{0%{box-shadow:0 0 0 0 rgba(226,58,104,.75)}70%,100%{box-shadow:0 0 0 12px rgba(226,58,104,0)}}
.under{gap:8px}
.q{width:52px;height:58px;border-radius:18px;padding:0;gap:5px;align-content:center;background:rgba(27,10,17,.58)}
.q small{min-height:0;display:block}
.q small:empty{display:none}
.segs{display:flex;gap:2px;justify-content:center}
.segs i{width:5px;height:5px;border-radius:50%;background:rgba(255,255,255,.38)}
.segs i.on{background:#FF6F95}
#qMoodOut .segs,#qFxOut .segs{gap:1px}
#qMoodOut .segs i,#qFxOut .segs i{width:3px;border-radius:1px}
.q{height:54px}
.flash{display:flex;flex-direction:column;align-items:center;gap:12px;padding:18px 24px;border-radius:26px;background:rgba(27,10,17,.74);top:20%}
.flash .ic{width:46px;height:46px;stroke-width:1.5}
.flash .segs{gap:5px}
.flash .segs i{width:9px;height:9px}
.flash .segs i:first-child:last-child{display:none}
.tools-close{width:52px;height:34px;display:grid;place-items:center;padding:0;right:50%;transform:translateX(50%);top:-40px;background:rgba(27,10,17,.62)}
.tab{min-height:50px;place-items:center;padding:0}
.tab[aria-selected="true"]{color:var(--accent)}
.catb{position:relative;padding:6px 13px 9px}
.catb.on::after{position:absolute;right:6px;top:4px;margin:0}
.chip{position:relative;display:inline-grid;place-items:center;min-width:48px;min-height:42px;padding:4px 10px;font-size:17px}
.chip[aria-pressed="true"]{background:var(--accent);color:#fff;border-color:var(--accent)}
.chip.on::after{position:absolute;right:5px;top:5px;margin:0}
.prow{display:flex;align-items:center;gap:8px}
.pl{flex:0 0 auto;color:var(--muted)}
.sl>span{flex:0 0 32px;display:grid;place-items:center;color:var(--muted)}
.sl.on>span{color:#FF6F95}
.row>.lab{min-width:32px;display:grid;place-items:center}
.mood{gap:0}
.ratio small{font-size:14px;color:inherit}
.safe span{background:repeating-linear-gradient(135deg,rgba(27,10,17,.55) 0 8px,rgba(27,10,17,.35) 8px 16px)}
.g-waist{border-color:var(--accent)}
.sheet .row{justify-content:stretch}
.sheet p{text-align:center;color:var(--muted)}
.msg .ic{color:#FF6F95;width:34px;height:34px;margin:0 auto 4px}
.result a{display:grid;place-items:center;width:44px;height:44px;margin:8px auto 0;border-radius:50%;border:1px solid var(--line);color:var(--ink)}
textarea{background:#2C1621}

/* ---- 새 기능 칸, 도움말, 얼굴 고르기, 포즈 코치 ---- */
.lablist,.helplist{display:flex;flex-direction:column;gap:8px}
.labrow{display:flex;gap:12px;align-items:center;text-align:left;border:1px solid var(--line);border-radius:14px;background:transparent;padding:10px 12px;color:var(--ink);width:100%}
button.labrow{cursor:pointer}
.labrow>.ic{color:#FF6F95}
.labrow b{display:block;font-size:14px;font-weight:700}
.labrow small{display:block;font-size:12px;line-height:1.45;color:var(--muted)}
.labrow[aria-pressed="true"]{border-color:var(--accent);background:rgba(226,58,104,.18)}
.labin{border:1px solid var(--line);border-radius:12px;background:#2C1621;color:var(--ink);padding:9px 12px;min-height:40px;width:100%;font:inherit;font-size:13px}
.q{height:50px}
.rail{gap:6px}
.help{max-height:88%}
.facepick{position:absolute;inset:0;z-index:4}
.facepick button{position:absolute;transform:translate(-50%,-50%);width:54px;height:54px;border-radius:50%;border:3px solid #fff;background:rgba(27,10,17,.45);color:#fff;font:700 20px/1 var(--body);cursor:pointer;box-shadow:0 0 0 1px rgba(0,0,0,.4)}
.facepick button.on{border-color:var(--accent);background:rgba(226,58,104,.55)}
.shots{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.shots button{border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--muted);padding:6px;display:grid;gap:4px;justify-items:center;font-size:12px;cursor:pointer}
.shots canvas{width:100%;height:auto;max-height:26vh;object-fit:contain;border-radius:8px;display:block}
.coach{position:fixed;inset:0;z-index:30;background:#000;display:grid}
.coach video{width:100%;height:100%;object-fit:cover;grid-area:1/1}
.coach video.mirror{transform:scaleX(-1)}
.coach .tip{grid-area:1/1;align-self:start;justify-self:center;margin:18px 16px 0;background:rgba(27,10,17,.78);color:#fff;border-radius:16px;padding:10px 16px;font-size:16px;line-height:1.4;text-align:center;max-width:92%}
.coach .bar{grid-area:1/1;align-self:end;display:flex;align-items:center;justify-content:space-around;padding:0 20px 28px}
.coach .shut{width:74px;height:74px;border-radius:50%;border:5px solid #fff;background:var(--accent);cursor:pointer}

/* 정밀 인식을 불러오는 동안 얼굴 단추에 도는 고리 */
.q{position:relative}
.mp-wait #qFace::after{content:"";position:absolute;right:5px;top:5px;width:10px;height:10px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#FF6F95;animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
