/* 손글씨: 나눔손글씨 펜(SIL Open Font License 1.1 — fonts/OFL.txt). 원본 그대로 woff2로만 바꿈 */
@font-face{font-family:'AdHand';src:url('fonts/NanumPenScript-Regular.woff2') format('woff2');font-weight:400;font-display:block}
:root{--bg:#0b1220;--panel:#121a2b;--line:rgba(255,255,255,.1);--txt:#e8eefc;--sub:rgba(232,238,252,.6);--acc:#4a9eff}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--txt);font-family:-apple-system,'Segoe UI','Apple SD Gothic Neo','Malgun Gothic',sans-serif}
.wrap{max-width:560px;margin:0 auto;padding:18px 14px 96px}
h1{font-size:18px;margin:0 0 4px}
.note{font-size:12px;color:var(--sub);margin:0 0 14px}
.sec{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px;margin-bottom:12px}
.sec h2{font-size:13px;margin:0 0 10px;color:var(--sub);font-weight:600}

/* ── 웹(넓은 화면): 왼쪽 미리보기·사진·가게 이름 / 오른쪽 글·완성 */
@media (min-width:900px){
  .wrap{max-width:1100px;padding:28px 24px 40px}
  .layout{display:grid;grid-template-columns:1.15fr 1fr;gap:16px;align-items:start}
  .col-l{position:sticky;top:16px}
  .finishbar{position:static !important;background:none !important;border:none !important;padding:0 !important;backdrop-filter:none !important}
}

/* ── 미리보기: 그림판(canvas) 하나에 그린다 → 미리보기 = 완성 파일. 점선 자리·진행 막대는 그림판 밖(파일에 안 들어감) */
.stage-scale{width:100%;aspect-ratio:360/140;position:relative}
#stage{position:absolute;left:0;top:0;width:360px;height:140px;transform-origin:0 0;border-radius:14px;overflow:hidden;background:#1d2a44}
#cv{position:absolute;inset:0;width:360px;height:140px}
.prog{position:absolute;left:0;bottom:0;height:3px;background:var(--acc);width:0;z-index:3}
.zone{position:absolute;z-index:2;border:1.5px dashed rgba(255,255,255,.45);border-radius:8px;display:none;align-items:flex-end;justify-content:flex-end;
      font-size:9px;color:rgba(255,255,255,.8);cursor:pointer;padding:2px}
.zone span{background:rgba(0,0,0,.55);padding:0 5px;border-radius:4px;line-height:14px}
.zone:hover{background:rgba(74,158,255,.12)}
.zone.on{border-color:var(--acc);border-style:solid}
.zone.on span{display:none}
#stage.editing .zone{display:flex}
.z-tl{left:8px;top:32px;width:168px;height:42px}
.z-tc{left:184px;top:32px;width:168px;height:42px}
.z-bl{left:8px;bottom:12px;width:344px;height:46px}
.rec{position:absolute;z-index:4;left:50%;top:50%;transform:translate(-50%,-50%);display:none;background:rgba(0,0,0,.6);color:#fff;font-size:12px;
     padding:5px 12px;border-radius:999px;pointer-events:none}
.rec.on{display:block}
.ctl{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-top:10px;font-size:12px;color:var(--sub)}
.ctl button{border-radius:8px;padding:7px 12px;cursor:pointer;font-size:13px;background:linear-gradient(90deg,#4a9eff,#34d399);color:#0b1220;border:none;font-weight:800}

/* ── 사진·영상 */
.photos{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.thumb{width:72px;height:48px;border-radius:8px;background-size:cover;background-position:center;position:relative;border:1px solid var(--line)}
.vthumb{width:110px;height:48px;border-radius:8px;border:1px solid var(--line);position:relative;display:flex;align-items:center;justify-content:center;font-size:12px;background:#1f2a40}
.thumb button,.vthumb button{position:absolute;right:-6px;top:-6px;width:20px;height:20px;border-radius:50%;border:none;background:#ef4444;color:#fff;font-size:11px;cursor:pointer;line-height:20px;padding:0}
.addph{width:72px;height:48px;border-radius:8px;border:1px dashed rgba(255,255,255,.3);display:flex;align-items:center;justify-content:center;color:var(--sub);cursor:pointer;font-size:12px;text-align:center}
.minfo{font-size:12px;color:var(--sub);margin-top:8px}
input[type=text]{width:100%;background:#0d1526;border:1px solid var(--line);color:var(--txt);border-radius:9px;padding:10px 11px;font-size:15px;outline:none}
input[type=text]:focus{border-color:var(--acc)}
input.over{border-color:#f87171}

/* ── 시간 막대 = 글 1·2·3 고르는 칸 */
.tl-scale{display:flex;justify-content:space-between;font-size:10px;color:var(--sub);margin-bottom:4px}
.tl{position:relative;height:46px;border-radius:10px;display:flex;user-select:none;touch-action:none}
.seg{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:12px;font-weight:800;color:#0b1220;
     cursor:pointer;opacity:.55;overflow:hidden;padding:0 4px}
.seg small{font-size:10px;font-weight:600;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:.8}
.seg.s0{background:#7dd3fc;border-radius:10px 0 0 10px}.seg.s1{background:#a7f3d0}.seg.s2{background:#fcd34d;border-radius:0 10px 10px 0}
.seg.sel{opacity:1;box-shadow:inset 0 0 0 3px #fff}
.seg.bad{background:#fca5a5}
.handle{position:absolute;top:0;width:24px;margin-left:-12px;height:100%;cursor:ew-resize;display:flex;justify-content:center;z-index:2}
.handle::before{content:'';width:4px;height:100%;background:#0b1220;border-radius:2px;box-shadow:0 0 0 2px rgba(255,255,255,.85)}
.playhead{position:absolute;top:-3px;bottom:-3px;width:2px;background:#fff;pointer-events:none;z-index:3;display:none}
.tl.playing .playhead{display:block}
.hint{font-size:11.5px;color:var(--sub);margin-top:8px}
.ed-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:14px;font-weight:800}
.ed-h .dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px}
.cnt{font-size:12px;color:var(--sub);font-weight:500}
.cnt.over{color:#f87171;font-weight:700}
.chips{display:flex;gap:6px;margin-top:8px}
.chip{flex:1;text-align:center;border:1px solid var(--line);border-radius:999px;padding:7px 0;font-size:14px;cursor:pointer;color:var(--sub);background:none}
.chip.on{border-color:var(--acc);background:rgba(74,158,255,.14);color:#fff}
.f-basic{font-weight:600}.f-bold{font-weight:900}.f-hand{font-family:'AdHand',cursive}
.chip.f-hand{font-size:18px;padding:4px 0}
.req{font-size:11px;color:#fcd34d;font-weight:500;margin-left:4px}

/* ── 완성 — 폰에선 아래에 붙은 막대, 웹에선 오른쪽 칸 맨 아래 */
.finishbar{position:fixed;left:0;right:0;bottom:0;padding:10px 14px calc(10px + env(safe-area-inset-bottom));background:rgba(11,18,32,.92);
           border-top:1px solid var(--line);backdrop-filter:blur(8px);z-index:10}
.finishbar .in{max-width:560px;margin:0 auto}
.finish{width:100%;padding:13px;border:none;border-radius:12px;font-size:15px;font-weight:800;cursor:pointer;background:linear-gradient(90deg,#4a9eff,#34d399);color:#0b1220}
.finish:disabled{opacity:.4;cursor:not-allowed}
.err{font-size:12px;color:#f87171;margin:6px 0 0}
.err:empty{display:none}
.done-ov{position:fixed;inset:0;background:rgba(0,0,0,.7);display:none;align-items:center;justify-content:center;z-index:20;padding:16px}
.done-ov.on{display:flex}
.done{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:18px;width:100%;max-width:520px;text-align:center}
.done h3{margin:0 0 4px;font-size:17px}
.done p{margin:0 0 12px;font-size:12px;color:var(--sub)}
.done video{width:100%;aspect-ratio:360/140;border-radius:12px;background:#000;display:block;margin-bottom:12px}
.done a.dl{display:block;padding:13px;border-radius:12px;background:linear-gradient(90deg,#4a9eff,#34d399);color:#0b1220;font-weight:800;text-decoration:none;font-size:15px}
.done button{margin-top:8px;background:none;border:1px solid var(--line);color:var(--sub);border-radius:10px;padding:9px 14px;cursor:pointer;width:100%}

/* (서비스판 추가) 인라인 style 속성 대신 */
.ed-wrap{margin-top:14px}
.sub-t{font-size:12px;color:var(--sub);font-weight:500}
.how{margin-top:12px}
.how ol{margin:0;padding-left:18px;font-size:13px;line-height:1.9;color:var(--sub)}
.how b{color:var(--txt)}
.foot{margin-top:18px;font-size:11px;color:rgba(232,238,252,.4);line-height:1.7;text-align:center}
.recnote{font-size:12px;color:#fcd34d;margin:6px 0 0;display:none}
.recnote.on{display:block}
@media (max-width:899px){ .how{display:none} }
