:root {
  --cream: #fdf8f4;
  --blush: #f6e3e1;
  --rose: #e8b4b8;
  --rose-deep: #c9868d;
  --mauve: #9a6b74;
  --cocoa: #4a3238;
  --ink: #2e2226;
  --white: #fffdfb;
  --kakao: #fee500;
  --naver: #03c75a;
  --line: rgba(74, 50, 56, .13);
  --serif: 'Cormorant Garamond', 'Noto Serif KR', serif;
  --kserif: 'Noto Serif KR', 'Cormorant Garamond', serif;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, system-ui, sans-serif;
  --bar: 56px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
button, input { font: inherit; color: inherit; }

.bar {
  height: var(--bar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.logo { font-family: var(--serif); font-size: 1.3rem; letter-spacing: .3em; font-weight: 500; color: var(--cocoa); text-decoration: none; }
.bar-title { font-size: .85rem; color: var(--mauve); }

/* 1단계: 소개 */
.intro {
  min-height: calc(100vh - var(--bar));
  min-height: calc(100dvh - var(--bar));
  display: grid; place-content: center; justify-items: center;
  text-align: center;
  padding: 48px 20px 64px;
  background: linear-gradient(165deg, var(--blush) 0%, var(--cream) 55%, #f8efe6 100%);
}
.kicker { font-family: var(--serif); font-style: italic; color: var(--rose-deep); font-size: 1.2rem; margin: 0 0 10px; letter-spacing: .04em; }
.intro h1 { font-family: var(--kserif); font-weight: 300; font-size: clamp(1.8rem, 6vw, 2.7rem); line-height: 1.4; margin: 0 0 18px; color: var(--cocoa); }
.intro h1 em { font-style: normal; color: var(--rose-deep); }
.lead { color: var(--mauve); line-height: 1.75; margin: 0 0 32px; max-width: 30em; }
.privacy-box {
  max-width: 25em; margin: 28px 0 0; padding: 14px 18px;
  border: 1px solid rgba(201, 134, 141, .35); border-radius: 16px;
  background: rgba(255, 253, 251, .75);
  text-align: left; font-size: .86rem; line-height: 1.6; color: var(--mauve);
}
.privacy-box p { margin: 0; }
.privacy-box .privacy-title { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-weight: 600; color: var(--cocoa); }
.privacy-title svg { color: var(--rose-deep); flex: none; }
.privacy { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: .78rem; line-height: 1.55; color: var(--mauve); }
.privacy svg { flex: none; margin-top: .22em; color: var(--rose-deep); }
.owner { margin: -8px 0 0; font-size: .7rem; line-height: 1.5; color: var(--mauve); opacity: .75; }
.intro .owner { max-width: 25em; margin-top: 30px; }

.tips { list-style: none; padding: 0; margin: 22px 0 0; max-width: 25em; text-align: left; display: grid; gap: 10px; font-size: .9rem; color: var(--cocoa); }
.tips li { position: relative; padding-left: 20px; line-height: 1.55; }
.tips li::before { content: ''; position: absolute; left: 3px; top: .58em; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--white); color: var(--cocoa);
  font-size: .92rem; font-weight: 500;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--rose); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--cocoa); border-color: var(--cocoa); color: var(--white); }
.btn.primary:hover { background: var(--ink); }
.btn.big { min-height: 54px; padding: 0 34px; font-size: 1.02rem; box-shadow: 0 16px 40px -18px rgba(74, 50, 56, .6); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: .84rem; }
.btn:disabled { opacity: .55; pointer-events: none; }

/* 2·3단계: 작업 화면 */
.work {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  height: calc(100vh - var(--bar));
  height: calc(100dvh - var(--bar));
}
.stage { position: relative; overflow: hidden; background: #ece3de; touch-action: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.zoom { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.zoom button, .hold {
  border: 1px solid var(--line); background: rgba(255, 253, 251, .93); color: var(--cocoa);
  cursor: pointer; box-shadow: 0 6px 16px -8px rgba(46, 34, 38, .35);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.zoom button { width: 40px; height: 40px; border-radius: 12px; font-size: 1.15rem; line-height: 1; }
.hold { position: absolute; left: 12px; bottom: 12px; min-height: 40px; padding: 0 16px; border-radius: 999px; font-size: .84rem; touch-action: none; -webkit-touch-callout: none; }
.hold:active { background: var(--cocoa); color: var(--white); }
.toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3;
  width: max-content; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px;
  background: rgba(46, 34, 38, .92); color: #fff;
  font-size: .88rem; line-height: 1.5; text-align: center;
}

.panel { background: var(--white); border-left: 1px solid var(--line); overflow-y: auto; }
.pane { display: grid; gap: 18px; align-content: start; padding: 24px 22px 32px; }
.step-no { margin: 0; font-family: var(--serif); font-size: .82rem; letter-spacing: .2em; color: var(--rose-deep); }
.pane h2 { margin: -10px 0 0; font-family: var(--kserif); font-weight: 400; font-size: 1.3rem; color: var(--cocoa); }
.hint { margin: 0; font-size: .87rem; line-height: 1.65; color: var(--mauve); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 999px; background: var(--blush); }
.seg button { min-height: 38px; border: 0; border-radius: 999px; background: transparent; color: var(--mauve); font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--white); color: var(--cocoa); box-shadow: 0 2px 8px -3px rgba(74, 50, 56, .3); }

.slider { display: grid; grid-template-columns: 7.2em 1fr; align-items: center; gap: 12px; font-size: .87rem; color: var(--cocoa); }
.slider input { width: 100%; margin: 0; accent-color: var(--rose-deep); }
.slider.sub { margin-top: -6px; }
.slider.sub span { padding-left: 1.1em; font-size: .8rem; color: var(--mauve); }
.slider.sub span::before { content: '└'; margin: 0 .3em 0 -1.1em; opacity: .55; }

.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row .btn { flex: 1 1 auto; }
.row.end { justify-content: space-between; margin-top: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 5px; margin: -6px 0 -6px; }
.filter {
  flex: none; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--mauve); font-size: .84rem; font-weight: 500; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.filter.on { background: var(--cocoa); border-color: var(--cocoa); color: var(--white); }
.designs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.design {
  display: grid; gap: 6px; padding: 6px 6px 9px;
  border: 1.5px solid var(--line); border-radius: 16px; background: var(--white);
  text-align: center; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.design:hover { border-color: var(--rose); }
.design.on { border-color: var(--rose-deep); box-shadow: 0 0 0 3px rgba(201, 134, 141, .2); }
.design .thumb { display: block; width: 100%; height: auto; border-radius: 10px; }
.dname { font-size: .85rem; font-weight: 500; color: var(--cocoa); }
.dname small { display: block; margin-top: 2px; font-size: .72rem; font-weight: 400; color: var(--mauve); }

.group { display: grid; gap: 12px; }
.group-title, .group summary { margin: 0; font-size: .8rem; letter-spacing: .06em; color: var(--mauve); }
.group summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: '+'; font-size: 1rem; line-height: 1; }
.group[open] summary::after { content: '−'; }
details.group { padding-top: 2px; }
/* details 안은 grid gap이 안 먹어서 안쪽 상자로 간격을 줘요 */
.group-body { display: grid; gap: 14px; padding-top: 14px; }
.group-body .btn { justify-self: start; }

.cta {
  display: grid; gap: 12px;
  margin-top: 4px; padding: 20px 18px 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--blush) 0%, #fbf1ec 100%);
  text-align: center;
}
.cta-title { margin: 0; font-family: var(--kserif); font-size: 1.08rem; line-height: 1.5; color: var(--cocoa); }
.cta-text { margin: 0 0 4px; font-size: .84rem; line-height: 1.6; color: var(--mauve); }
.cta .row .btn { flex: 1 1 0; padding: 0 10px; white-space: nowrap; }
.btn.kakao { background: var(--kakao); border-color: var(--kakao); color: #3c1e1e; }
.btn.naver { background: var(--naver); border-color: var(--naver); color: #fff; }
.btn.kakao:hover, .btn.naver:hover { filter: brightness(.96); }
a.btn { text-decoration: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: grid; justify-items: center; gap: 5px; width: 56px; padding: 0; border: 0; background: none; font-size: .72rem; color: var(--mauve); cursor: pointer; }
.chip i { display: block; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.chip.on { color: var(--cocoa); font-weight: 600; }
.chip.on i { box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--rose-deep); }

@media (max-width: 820px) {
  .bar { padding: 0 16px; }
  .work { display: block; height: auto; }
  .stage { position: sticky; top: 0; z-index: 2; height: 54vh; height: 54dvh; }
  .panel { border-left: 0; overflow: visible; }
  .pane { padding: 20px 16px 40px; }
  .designs { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .design { scroll-snap-align: start; }
}
