:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #2b2b3a;
  --sub: #6b6b7b;
  --line: #ece4d8;
  --accent: #ff7a59;
  --accent-ink: #ffffff;
  --soft: #fff0e6;
  --radius: 18px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
#app { max-width: 480px; margin: 0 auto; padding: 20px 16px 48px; min-height: 100vh; }
.screen { display: none; animation: fade .25s ease; }
.screen.active { display: block; }
.screen.center.active { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

h1 { font-size: 34px; line-height: 1.25; margin: 6px 0 14px; letter-spacing: -0.02em; }
h2 { font-size: 24px; line-height: 1.3; margin: 6px 0 16px; letter-spacing: -0.01em; }
.eyebrow { display: inline-block; margin: 0; font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.lead { color: var(--sub); margin: 0 0 28px; }
.fine { font-size: 12.5px; color: var(--sub); text-align: center; margin: 14px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 18px; border-radius: 14px;
  border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 700; font-size: 15.5px; text-decoration: none; cursor: pointer;
  box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.big { width: 100%; min-height: 56px; font-size: 17px; }
.btn.ghost { width: 100%; margin-top: 18px; border-color: var(--line); box-shadow: none; color: var(--sub); }

.back { border: 0; background: none; font-size: 22px; padding: 6px 8px 6px 0; cursor: pointer; color: var(--ink); }

/* 시작 */
.intro-chars { display: flex; justify-content: center; gap: 2px; margin: 18px 0 18px; }
.intro-chars svg { width: 30%; max-width: 128px; height: auto; }
.intro-chars svg:nth-child(2) { transform: translateY(-10px); }

/* 직군 */
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role {
  text-align: left; padding: 16px 14px; border-radius: var(--radius);
  border: 2px solid var(--line); background: var(--card); cursor: pointer; font: inherit; color: var(--ink);
}
.role:hover, .role:focus-visible { border-color: var(--ink); outline: none; }
.role .emoji { font-size: 26px; display: block; margin-bottom: 4px; }
.role b { display: block; font-size: 16px; }
.role small { color: var(--sub); font-size: 12.5px; line-height: 1.4; display: block; margin-top: 2px; }

/* 문항 */
.quiz-top { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.progress { flex: 1; height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .25s; }
.count { font-size: 13px; color: var(--sub); min-width: 38px; text-align: right; }
.q-title { font-size: 25px; margin-bottom: 6px; }
.q-ex { color: var(--sub); margin: 0 0 24px; font-size: 15px; }
.q-label { font-weight: 700; font-size: 14px; margin: 18px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 11px 15px; border-radius: 99px; border: 2px solid var(--line); background: var(--card);
  font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; min-height: 46px;
}
.chip.on { border-color: var(--ink); background: var(--ink); color: #fff; }

/* 로딩 */
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; margin-bottom: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 결과 */
.result-card {
  background: var(--card); border: 2px solid var(--ink); border-radius: 24px;
  padding: 22px 18px 18px; text-align: center; box-shadow: 0 5px 0 var(--ink);
}
.char-big { width: 190px; margin: 4px auto 0; border-radius: 50%; }
.char-big svg { width: 100%; height: auto; display: block; }
.r-type { font-size: 30px; margin: 4px 0 6px; }
.r-tag { color: var(--sub); margin: 0 0 16px; font-size: 15px; }
.r-numbers { background: var(--soft); border-radius: 16px; padding: 16px 12px; display: grid; gap: 10px; }
.n-label { display: block; font-size: 13px; color: var(--sub); }
.n-big { display: block; font-size: 38px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.n-range { display: block; font-size: 13px; color: var(--sub); }
.n-year { border-top: 1px dashed #e3cfbd; padding-top: 10px; font-weight: 800; font-size: 20px; }
.n-year small { display: block; font-weight: 400; font-size: 12px; color: var(--sub); }
.r-now { font-size: 13.5px; color: var(--sub); margin: 12px 0 0; }
.estimate-note { font-size: 12.5px; color: #b0553a; margin: 6px 0 0; }

.sec-title { font-size: 17px; font-weight: 800; margin: 28px 0 10px; }
.top3 { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: t; }
.top3 li {
  background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px 14px 14px 52px;
  position: relative; counter-increment: t;
}
.top3 li::before {
  content: counter(t); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center;
}
.top3 b { display: block; }
.top3 .save { color: var(--accent); font-weight: 700; font-size: 14px; }
.top3 .how { display: block; color: var(--sub); font-size: 14px; margin-top: 4px; }
.top3 .empty { padding-left: 14px; }
.top3 .empty::before { display: none; }

.assume { margin-top: 16px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.assume summary { cursor: pointer; font-weight: 700; font-size: 14.5px; }
.assume-body { font-size: 13.5px; color: #44444f; }
.assume-body ul { padding-left: 18px; margin: 8px 0; }
.rate-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.rate-table th, .rate-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rate-table td:last-child, .rate-table th:last-child { text-align: right; white-space: nowrap; }

.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cta { margin-top: 28px; background: var(--ink); color: #fff; border-radius: 22px; padding: 20px 16px; display: grid; gap: 10px; }
.cta-lead { margin: 0 0 4px; font-weight: 800; font-size: 18px; text-align: center; }
.cta .btn { border-color: #fff; box-shadow: 0 3px 0 #000; }
.cta .fine { color: #c9c9d6; margin-top: 2px; }
.cta-setup { margin-top: 12px; background: #2f6fae; }
.handle-line { margin-top: 18px; }

/* 모달 */
.modal { position: fixed; inset: 0; background: rgba(30, 28, 40, .72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal-inner { background: var(--bg); border-radius: 20px; padding: 16px; width: 100%; max-width: 420px; max-height: 94vh; overflow: auto; position: relative; }
.modal-inner img { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: #eee; }
.modal-close { position: absolute; top: 6px; right: 10px; border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--ink); }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

@media (min-width: 520px) {
  #app { padding-top: 40px; }
  h1 { font-size: 40px; }
}

/* 사업자 정보 (하단) */
.biz-foot { max-width: 480px; margin: 0 auto; padding: 8px 16px 40px; font-size: 12px; color: var(--sub); }
.biz-foot summary { cursor: pointer; font-weight: 700; }
.biz-foot dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 10px 0; }
.biz-foot dd { margin: 0; }
.biz-foot .links { margin: 10px 0 0; }
.biz-foot a { color: var(--sub); }
