:root {
  --bg: #efefec;
  --bg-2: #c7c7c3;
  --surface: #ffffff;
  --ink: #2b2b2b;
  --ink-2: #4a4a48;
  --ink-3: #77776f;
  --line: rgba(43, 43, 43, .16);
  --gold: #334f43;
  --gold-soft: #c7c7c3;
  --smp: #2b2b2b;
  --care: #334f43;
  --care-soft: #dde5e0;
  --brand: #334f43;
  --radius: 20px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
em { font-style: normal; }

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100svh;
  position: relative;
}
.screen { display: none; min-height: 100svh; padding: 0 20px; }
.screen.is-active { display: block; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 버튼 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 54px; padding: 14px 20px;
  border-radius: 16px; font-weight: 700; font-size: 16px; text-decoration: none; text-align: center;
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-ghost { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
.btn-lg { min-height: 62px; font-size: 18px; border-radius: 18px; }
.link-btn { display: block; margin: 20px auto 0; padding: 10px; font-size: 14px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }

/* ---------- 인트로 ---------- */
.intro {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 4px 40px;
}
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--gold); margin-bottom: 20px; }
.intro h1 { font-size: clamp(34px, 10vw, 44px); line-height: 1.22; font-weight: 800; letter-spacing: -.03em; }
.intro h1 em { position: relative; z-index: 0; }
.intro h1 em::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: 3px; height: 14px;
  background: var(--gold-soft); opacity: .9; z-index: -1; border-radius: 4px;
}
.lead { margin-top: 22px; font-size: 18px; color: var(--ink-2); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 36px; }
.chips li { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); }
.fine { margin-top: 16px; font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* ---------- 질문 ---------- */
.quiz-head {
  display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 0 14px;
}
.icon-btn { width: 40px; height: 40px; border-radius: 12px; font-size: 28px; line-height: 1; display: grid; place-items: center; }
.icon-btn:active { background: var(--bg-2); }
.progress { flex: 1; height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--ink); transition: width .35s ease; }
.count { font-size: 14px; font-weight: 700; color: var(--ink-2); min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.quiz-body { padding: 36px 2px 40px; }
.q-cat { font-size: 13px; font-weight: 700; color: var(--gold); margin-bottom: 14px; }
.q-text { font-size: 24px; line-height: 1.42; font-weight: 700; letter-spacing: -.02em; min-height: 5.6em; }
.options { display: grid; gap: 12px; margin-top: 28px; }
.option {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 16px 18px;
  border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line);
  font-size: 17px; font-weight: 600; text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.option:active { transform: scale(.985); }
.option .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-3); flex: none; transition: all .15s ease; }
.option.is-picked { border-color: var(--ink); background: #fff; }
.option.is-picked .dot { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 4px #fff; }

/* ---------- 로딩 ---------- */
.loading { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--bg-2); border-top-color: var(--ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { margin-top: 28px; font-size: 20px; font-weight: 700; }
.loading-sub { margin-top: 8px; color: var(--ink-3); font-size: 15px; min-height: 1.5em; }

/* ---------- 결과 ---------- */
.result { padding: 36px 0 120px; }
.r-top { padding: 8px 2px 24px; }
.r-badge { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--gold-soft); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.r-top h2 { margin-top: 18px; font-size: clamp(30px, 8.6vw, 38px); line-height: 1.26; font-weight: 800; letter-spacing: -.03em; }
.r-top h2 em { box-shadow: inset 0 -12px 0 rgba(199, 199, 195, .9); }
.r-sum { margin-top: 16px; color: var(--ink-2); font-size: 16.5px; }

.card { background: var(--surface); border-radius: var(--radius); padding: 22px 20px; margin-top: 14px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.meter + .meter { margin-top: 20px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.meter-top strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.meter-top small { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.bar { height: 12px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; animation: grow .9s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left; }
.meter.smp .bar span { background: var(--smp); }
.meter.care .bar span { background: var(--care); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.picked { list-style: none; display: grid; gap: 10px; }
.picked li { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.picked .lvl { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.tag { flex: none; font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 8px; }
.tag.smp { background: var(--smp); color: #fff; }
.tag.care { background: var(--care-soft); color: #334f43; }

.cta-block { margin-top: 22px; padding: 22px 18px; border-radius: var(--radius); background: var(--brand); color: #fff; }
.offer { font-size: 15px; font-weight: 700; color: var(--gold-soft); text-align: center; margin-bottom: 14px; }
.cta-row { display: grid; gap: 10px; }
.cta-block .btn-primary { background: var(--gold-soft); color: var(--ink); }
.cta-block .btn-ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.cta-hint { margin-top: 12px; font-size: 12.5px; color: rgba(255, 255, 255, .62); text-align: center; }

.sec-title { margin: 36px 2px 4px; font-size: 20px; font-weight: 800; }
.sec-label { margin: 22px 2px 0; font-size: 13.5px; font-weight: 700; color: var(--ink-3); }

.svc { background: var(--surface); border-radius: var(--radius); margin-top: 14px; overflow: hidden; border: 1.5px solid transparent; }
article.svc.smp { border-color: var(--smp); }
article.svc.care { border-color: var(--care); }
.svc-head { display: flex; align-items: center; gap: 8px; padding: 18px 20px 4px; }
.svc-head h3 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.svc-head .badge, .svc-head .order { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; background: var(--gold-soft); color: var(--ink); }
.svc-head .order { background: var(--ink); color: #fff; }
.svc-head h3 { margin-left: 2px; }
details.svc summary { list-style: none; display: flex; align-items: center; cursor: pointer; padding-right: 20px; }
details.svc summary::-webkit-details-marker { display: none; }
details.svc summary .svc-head { flex: 1; padding-bottom: 18px; }
.chev { width: 10px; height: 10px; border-right: 2.5px solid var(--ink-3); border-bottom: 2.5px solid var(--ink-3); transform: rotate(45deg); transition: transform .2s ease; }
details[open] .chev { transform: rotate(-135deg); }
.svc-body { padding: 4px 20px 22px; }
.svc-tag { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.svc-intro { font-size: 15.5px; color: var(--ink-2); }
.svc-body h4 { margin: 22px 0 10px; font-size: 14px; font-weight: 800; }
.check-list { list-style: none; display: grid; gap: 8px; }
.check-list li { position: relative; padding-left: 26px; font-size: 15px; color: var(--ink-2); }
.check-list li::before {
  content: ""; position: absolute; left: 3px; top: 5px; width: 6px; height: 11px;
  border-right: 2.5px solid var(--care); border-bottom: 2.5px solid var(--care); transform: rotate(40deg);
}
.svc.smp .check-list li::before { border-color: var(--smp); }
.steps { list-style: none; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-2); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.steps strong { font-size: 15px; }
.steps p { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.svc-note { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--bg); font-size: 12.5px; color: var(--ink-3); }

.share-row { display: grid; gap: 10px; margin-top: 28px; }
.shop-info { list-style: none; margin-top: 28px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); display: grid; gap: 10px; font-size: 14.5px; }
.shop-info span { display: inline-block; min-width: 76px; font-weight: 700; color: var(--ink-3); }
.disclaimer { margin-top: 24px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }

/* 하단 고정 CTA */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(239, 239, 236, 0));
  transform: translateY(110%); transition: transform .3s ease;
  max-width: 520px; margin: 0 auto;
}
.sticky-cta.show { transform: none; }
.sticky-cta .cta-row { grid-auto-flow: column; grid-auto-columns: 1fr; }
.sticky-cta .btn { min-height: 52px; font-size: 15px; padding: 12px 10px; }
.sticky-cta .btn-primary { background: var(--brand); color: #fff; }
.sticky-cta .btn-ghost { background: var(--bg); }

/* 토스트 / 개발 안내 */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 40;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 14px;
  background: rgba(43, 43, 43, .94); color: #fff; font-size: 14px; font-weight: 600; text-align: center;
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dev-note { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 6px 12px; background: #fff3c4; color: #5c4a00; font-size: 11.5px; text-align: center; }

@media (min-width: 560px) {
  body { background: var(--bg-2); }
  .app { background: var(--bg); box-shadow: 0 0 60px rgba(0, 0, 0, .08); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
