/* 편집기 화면: 좌 단계 · 가운데 입력 · 우 폰 무대 */
body.edit { height: 100svh; overflow: hidden; }
.top { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 20px 0 24px; border-bottom: 1px solid var(--line); background: var(--paper); position: relative; z-index: 5; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand b { font: 300 25px/1 var(--serif); letter-spacing: -.01em; }
.brand i { font: italic 300 18px/1 var(--serif); color: var(--lune-2); }
.top .spacer { flex: 1; }
.saved { font-size: 12.5px; color: var(--mute); display: flex; align-items: center; gap: 7px; }
.saved::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.saved.busy::before { background: var(--lune); animation: pulse 1s infinite; }
.saved.err::before { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }
.ring { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 8px; border-radius: 12px; }
.ring:hover { background: var(--paper-2); }
.ring svg { width: 34px; height: 34px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--lune); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ring span { font-size: 12px; text-align: left; line-height: 1.25; color: var(--ink-2); }
.ring span b { display: block; font-size: 14px; color: var(--ink); }
.plan-chip { white-space: nowrap; font-size: 12px; padding: 6px 12px; border-radius: 99px; background: var(--paper-2); color: var(--ink-2); }
.plan-chip.paid { background: #e6eee5; color: var(--ok); }

.shell { display: grid; grid-template-columns: 232px minmax(380px, 1fr) minmax(440px, 46%); height: calc(100svh - 64px); }
/* 단계 */
.steps { border-right: 1px solid var(--line); padding: 22px 12px; overflow: auto; display: grid; align-content: start; gap: 2px; }
.steps button { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 0; background: none; text-align: left; color: var(--ink-2); font-size: 14px; transition: .15s; }
.steps button:hover { background: var(--paper-2); }
.steps button.on { background: var(--ink); color: var(--paper); }
.steps button .n { font: italic 300 18px/1 var(--serif); color: var(--mute); }
.steps button.on .n { color: var(--lune); }
.steps button .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.steps button .dot.ok { background: var(--ok); }
.steps button .lk { width: 10px; height: 11px; background: currentColor; opacity: .5; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 10"><path d="M2 4V3a2.5 2.5 0 0 1 5 0v1h1v6H1V4h1Zm1 0h3V3a1.5 1.5 0 0 0-3 0v1Z"/></svg>') center/contain no-repeat; }
.steps .side-cta { margin: 18px 4px 0; padding: 18px; border-radius: 16px; background: var(--night); color: #e8e0d2; display: grid; gap: 8px; }
.steps .side-cta b { font: 300 20px/1.2 var(--serif); word-break: keep-all; }
.steps .side-cta p { margin: 0; font-size: 12.5px; color: #a8a093; }

/* 입력 */
.form { overflow: auto; padding: 38px clamp(22px, 4vw, 56px) 120px; scroll-behavior: smooth; }
.form h1 { font: 300 46px/1.05 var(--serif); margin: 8px 0 6px; letter-spacing: -.015em; }
.form .lead { color: var(--ink-2); margin: 0 0 30px; max-width: 46ch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px 22px 6px; margin-bottom: 16px; }
.card h3 { margin: 0 0 16px; font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card .sub { font-size: 12.5px; color: var(--mute); margin: -10px 0 16px; }
.next-row { display: flex; justify-content: space-between; margin-top: 26px; }
.locked-wrap { position: relative; }
.locked-wrap.locked > :not(.lock-card) { filter: blur(1.5px) saturate(.6); opacity: .45; pointer-events: none; user-select: none; }
.lock-card { position: sticky; top: 0; z-index: 2; margin-bottom: 18px; padding: 22px; border-radius: 20px; background: linear-gradient(140deg, #1b1c22, #121318); color: #ebe3d4; display: grid; gap: 10px; box-shadow: 0 20px 50px -24px #000; }
.lock-card b { font: 300 26px/1.15 var(--serif); }
.lock-card p { margin: 0; color: #aaa295; font-size: 13.5px; }
.lock-card .btn { justify-self: start; }

/* 디자인 고르기 */
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.design { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 0; overflow: hidden; transition: .2s var(--ease); position: relative; }
.design:hover { transform: translateY(-2px); border-color: var(--ink-2); }
.design.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.design .sw { height: 92px; display: grid; place-items: center; font: 300 26px/1 var(--serif); letter-spacing: .02em; }
.design .meta { padding: 12px 14px 14px; display: grid; gap: 4px; }
.design .meta b { font-weight: 500; font-size: 14px; }
.design .meta small { color: var(--mute); font-size: 12px; line-height: 1.35; }
.design .chip { position: absolute; top: 10px; right: 10px; height: 22px; font-size: 11px; }
.sw.classic { background: #f3ede2; color: #3b3229; }
.sw.cinematic { background: #101012; color: #e9e2d4; font-style: italic; }
.sw.blooming { background: radial-gradient(circle at 30% 30%, #f6d8e4, transparent 60%), radial-gradient(circle at 70% 70%, #cfe3f7, transparent 60%), #f7f3f9; color: #4b3f58; }
.sw.prism { background: linear-gradient(120deg, #d9f1ff, #f3d9ff 40%, #fff2cf 70%, #d9fff0); color: #2b2b38; }
.sw.vernissage { background: #e9e6df; color: #20201e; font-style: italic; }
.sw.muk { background: #f1ece1; color: #141210; font-family: "Gowun Batang", serif; }

/* 인사말 문구 고르기 */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.presets button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 14px; font-size: 13px; }
.presets button:hover { border-color: var(--lune); color: var(--lune-2); }

/* 목록 행 */
.rows { display: grid; gap: 10px; margin-bottom: 16px; }
.item { border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 0; background: #fff; position: relative; }
.item .del { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--mute); font-size: 18px; width: 30px; height: 30px; border-radius: 50%; }
.item .del:hover { background: var(--paper-2); color: var(--warn); }
.item .field { margin-bottom: 12px; }
.add { width: 100%; height: 46px; border: 1px dashed var(--line-2); border-radius: 14px; background: none; color: var(--ink-2); font-size: 14px; margin-bottom: 18px; }
.add:hover { border-color: var(--ink); color: var(--ink); }
.flags { display: flex; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; }

/* 사진 */
.slot { border: 1px dashed var(--line-2); border-radius: 16px; background: #fff; min-height: 150px; display: grid; place-items: center; text-align: center; color: var(--mute); font-size: 13px; position: relative; overflow: hidden; cursor: pointer; }
.slot:hover { border-color: var(--ink); color: var(--ink); }
.slot img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.slot.has { border-style: solid; aspect-ratio: 4 / 5; min-height: 0; cursor: crosshair; }
.slot .focus { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0006, 0 0 20px #0008; pointer-events: none; }
.slot .tools { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; gap: 4px; justify-content: flex-end; }
.slot .tools button { white-space: nowrap; height: 26px; min-width: 26px; padding: 0 7px; font-size: 11.5px; border-radius: 99px; border: 0; background: #fffe; font-size: 12px; box-shadow: 0 2px 8px #0002; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 18px; }
.photo-grid .slot { min-height: 0; aspect-ratio: 4 / 5; }
.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.uploading { position: absolute; inset: 0; display: grid; place-items: center; background: #fffc; font-size: 12px; }

/* 폰 무대 */
.stage { position: relative; background: radial-gradient(120% 80% at 50% 0%, #2a2a33 0%, var(--night) 55%); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; color: #e8e0d2; }
.stage::before { content: ""; position: absolute; width: 520px; height: 520px; left: 50%; top: -260px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, #f6e7c833, transparent 65%); pointer-events: none; }
.stage-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px 0; position: relative; }
.stage-head .eyebrow { color: #8f887c; }
.try { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 0 16px 18px; position: relative; }
.try button { height: 32px; padding: 0 13px; border-radius: 99px; border: 1px solid #ffffff22; background: #ffffff0d; color: #cfc6b6; font-size: 12.5px; transition: .2s; }
.try button:hover { border-color: #ffffff66; color: #fff; }
.try button.on { background: #f4f0e8; color: #111; border-color: #f4f0e8; }
.try button em { font-style: normal; font-size: 10px; letter-spacing: .12em; color: #c9a774; margin-left: 5px; }
.phone-wrap { display: grid; place-items: center; min-height: 0; padding: 10px 0; position: relative; }
.phone { --w: 390px; --h: 820px; width: var(--w); height: var(--h); border-radius: 54px; padding: 12px; background: linear-gradient(145deg, #3a3a42, #0b0b0e 40%, #26262c); box-shadow: 0 0 0 1px #ffffff1a inset, 0 50px 120px -40px #000, 0 0 0 1px #000; position: relative; transform-origin: center center; }
.phone .screen { width: 100%; height: 100%; border-radius: 43px; overflow: hidden; background: #fff; position: relative; isolation: isolate; }
.phone iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.phone .notch { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 108px; height: 31px; border-radius: 20px; background: #000; z-index: 4; }
.phone .wm { position: absolute; inset: 0; z-index: 3; pointer-events: none; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="170"><text x="10" y="100" transform="rotate(-24 120 85)" font-family="Georgia,serif" font-size="19" fill="rgba(20,18,16,0.13)" letter-spacing="3">W.Deluna · SAMPLE</text></svg>'); }
.phone .wm::after { content: "결제 후 워터마크 없이 발행돼요"; position: absolute; left: 50%; top: 62px; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; padding: 7px 13px; border-radius: 99px; background: #111111d9; color: #f1e9da; backdrop-filter: blur(8px); }
.phone .wait { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; gap: 12px; text-align: center; background: #f4f0e8; color: var(--ink); padding: 30px; font-size: 14px; }
.phone .wait b { font: 300 28px/1.1 var(--serif); }
.phone .wait .bar { width: 160px; height: 2px; background: var(--line); margin: 6px auto 0; overflow: hidden; border-radius: 2px; }
.phone .wait .bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--lune); animation: slide 1.4s infinite var(--ease); }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.stage-foot { display: flex; justify-content: center; gap: 10px; padding: 0 0 18px; position: relative; }
.stage-foot .btn { background: #ffffff10; color: #eee; border-color: #ffffff26; }
.stage-foot .btn:hover { border-color: #fff; }

/* 준비도 팝오버 */
.pop { position: absolute; top: 60px; right: 230px; width: 300px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: 0 30px 60px -30px #0005; z-index: 20; animation: rise .25s var(--ease); }
.pop li { list-style: none; display: flex; justify-content: space-between; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.pop ul { margin: 8px 0 0; padding: 0; }
.pop li.ok { color: var(--mute); }
.pop li.ok::after { content: "완료"; color: var(--ok); font-size: 12px; }
.pop li.need::after { content: "필수"; color: var(--warn); font-size: 12px; }
.pop li.opt::after { content: "추천"; color: var(--lune-2); font-size: 12px; }

/* 발행 완료 */
.done { text-align: center; }
.done .qr { width: 180px; height: 180px; margin: 18px auto; background: #fff; padding: 12px; border-radius: 16px; }
.done .qr img { width: 100%; height: 100%; }
.linkbox { display: flex; gap: 8px; margin: 10px 0; }
.linkbox input { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 12px; background: #fff; font-size: 13px; }

/* 모바일: 입력 전체 + 미리보기 버튼 */
.peek { display: none; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 200px 1fr; }
  .stage { position: fixed; inset: 0; z-index: 30; display: none; }
  body.show-stage .stage { display: grid; }
  .peek { display: inline-flex; position: fixed; right: 18px; bottom: 18px; z-index: 25; }
  .stage .close-stage { display: inline-flex; }
}
@media (max-width: 760px) {
  .top { padding: 0 12px; gap: 8px; height: 56px; }
  .brand i, .ring span, .saved span, .top .hide-m, .plan-chip { display: none; }
  .shell { grid-template-columns: 1fr; height: calc(100svh - 56px); }
  .steps { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; gap: 4px; position: sticky; top: 0; }
  .steps button { grid-template-columns: auto auto; white-space: nowrap; padding: 8px 12px; }
  .steps button .dot, .steps button .lk, .steps .side-cta { display: none; }
  body.edit .shell { display: block; overflow: auto; }
  .form { overflow: visible; padding: 26px 18px 120px; }
  .form h1 { font-size: 36px; }
  .row, .row3, .hero-row { grid-template-columns: 1fr; }
  .pop { right: 10px; left: 10px; width: auto; }
}
.close-stage { display: none; }
.bulk { width: 100%; display: grid; gap: 6px; text-align: left; padding: 22px 24px; margin-bottom: 22px; border-radius: 20px; border: 0; background: linear-gradient(135deg, #1b1c22, #2a2620); color: #efe6d6; box-shadow: 0 18px 40px -22px #000; transition: .2s var(--ease); }
.bulk:hover { transform: translateY(-2px); }
.bulk b { font: 300 26px/1.1 var(--serif); }
.bulk b::before { content: "＋ "; color: #c9a774; }
.bulk span { font-size: 13px; color: #b3aa9b; max-width: 56ch; }
