:root {
  --bg: #0a0e14;
  --surface: #11161e;
  --surface-2: #1a1f2e;
  --text: #f5f5f5;
  --text-dim: #9ca3af;
  --text-mute: #6b7280;
  --accent: #e63946;
  --accent-dim: #b32d39;
  --border: #2a3142;
  --border-light: #3a4252;
  --ok: #10b981;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.brand { color: var(--accent); font-weight: 800; letter-spacing: 1px; font-size: 14px; }
.brand a { color: var(--text-dim); font-weight: 500; }
.brand-back { display: inline-block; color: var(--text-dim); font-weight: 700; font-size: 16px; text-decoration: none; margin-right: 4px; padding: 2px 6px; border-radius: 6px; }
.brand-back:hover { color: var(--accent); background: var(--surface); }
.progress {
  font-size: 12px; color: var(--text-mute); letter-spacing: 1px;
}

/* Progress bar */
.progress-bar {
  height: 3px; background: var(--border); border-radius: 2px;
  overflow: hidden; margin-bottom: 32px;
}
.progress-bar-fill {
  height: 100%; background: var(--accent); transition: width 0.3s ease;
}

/* Landing page */
.hero {
  text-align: center; padding: 32px 0 40px;
}
.hero-tag {
  display: inline-block; color: var(--accent);
  font-size: 12px; letter-spacing: 3px; font-weight: 700;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 40px); font-weight: 900;
  letter-spacing: -1.5px; line-height: 1.15; margin-bottom: 16px;
}
.hero-sub {
  color: var(--text-dim); font-size: 16px; line-height: 1.6;
}

.tiers {
  display: flex; flex-direction: column; gap: 16px; margin: 32px 0;
}
.tier-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 24px 20px; text-align: left;
  transition: all 0.2s; cursor: pointer;
  display: block;
}
.tier-card:hover, .tier-card:active {
  border-color: var(--accent); transform: translateY(-1px);
}
.tier-card.featured {
  border-color: var(--accent-dim);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(230,57,70,0.05) 100%);
}
.tier-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px;
}
.tier-name { font-size: 20px; font-weight: 800; }
.tier-price { font-size: 22px; font-weight: 900; color: var(--accent); }
.tier-desc { color: var(--text-dim); font-size: 14px; margin-bottom: 16px; }
.tier-features { list-style: none; }
.tier-features li {
  font-size: 14px; padding: 6px 0;
  color: var(--text);
}
.tier-features li::before {
  content: '✓'; color: var(--accent); margin-right: 8px; font-weight: 700;
}
.tier-cta {
  display: inline-block; margin-top: 16px;
  color: var(--accent); font-weight: 700; font-size: 14px;
  letter-spacing: 1px;
}

/* Question screen */
.q-screen { animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.q-num {
  font-size: 12px; color: var(--text-mute);
  letter-spacing: 2px; font-weight: 700; margin-bottom: 8px;
}
.q-title {
  font-size: 22px; font-weight: 800; line-height: 1.4;
  margin-bottom: 8px; letter-spacing: -0.5px;
}
.q-hint {
  color: var(--text-dim); font-size: 14px; margin-bottom: 24px;
}
.q-sub {
  font-size: 14px; color: var(--text-dim);
  margin: 24px 0 8px; font-weight: 600;
}

/* Click options */
.options {
  display: flex; flex-direction: column; gap: 10px;
}
.options.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.opt {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 16px 18px;
  text-align: left; font-size: 16px; font-weight: 500;
  width: 100%; transition: all 0.15s;
  border-radius: 0;
}
.opt:hover { border-color: var(--border-light); background: var(--surface-2); }
.opt.selected {
  border-color: var(--accent); background: var(--accent);
  color: white; font-weight: 800;
  box-shadow: 0 0 0 1px var(--accent);
}
.opt.selected::after {
  content: '✓'; float: right; color: white; font-weight: 900;
}

/* Chip multi-select */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px;
  font-size: 14px; font-weight: 500;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--border-light); }
.chip.selected {
  border-color: var(--accent); background: var(--accent);
  color: white; font-weight: 800;
}

/* Text input */
.t-input, .t-area {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 14px 16px;
  font-size: 16px; line-height: 1.5;
  transition: border-color 0.15s;
  resize: vertical;
}
.t-input:focus, .t-area:focus {
  outline: none; border-color: var(--accent);
}
.t-area { min-height: 100px; }
.t-counter {
  display: block; text-align: right; font-size: 12px; color: var(--text-mute);
  margin-top: 6px;
}
.t-counter.over { color: var(--accent); }

/* Sub-question grouping (for multi-axis questions) */
.sub-group { margin-bottom: 18px; }
.sub-group:last-child { margin-bottom: 0; }
.sub-label {
  font-size: 13px; color: var(--text-dim);
  font-weight: 600; margin-bottom: 8px;
}
.scale-row {
  display: flex; gap: 4px;
}
.scale-row .opt {
  flex: 1; text-align: center; padding: 12px 4px;
  font-size: 12px; line-height: 1.3;
}

/* Navigation — sticks to the bottom of the viewport on long screens so
   다음/건너뛰기 is always reachable with a thumb without scrolling. */
.nav-row {
  display: flex; gap: 10px; margin-top: 32px;
  position: sticky; bottom: 0; z-index: 5;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(10,14,20,0) 0%, var(--bg) 28%);
}
.btn {
  flex: 1; padding: 16px 20px;
  font-size: 16px; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: all 0.15s;
}
.btn:hover { border-color: var(--border-light); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: white;
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-primary:disabled {
  background: var(--surface); color: var(--text-mute);
  border-color: var(--border); cursor: not-allowed;
}
.btn-back {
  flex: 0 0 auto; padding: 16px 18px;
  color: var(--text-dim); background: var(--bg); border: 1px solid var(--border);
  white-space: nowrap;
}
/* All-optional question with nothing filled — an honest, visible skip */
.btn-primary.btn-skip {
  background: var(--surface); border-color: var(--border-light);
  color: var(--text-dim); font-weight: 600;
}
.btn-primary.btn-skip:hover { border-color: var(--accent); color: var(--text); }

/* Final screens */
.final-card {
  background: var(--surface); border: 1px solid var(--border);
  padding: 24px 20px; margin: 16px 0;
}
.final-card h3 {
  font-size: 14px; color: var(--text-dim); font-weight: 600;
  letter-spacing: 1px; margin-bottom: 12px; text-transform: uppercase;
}
.review-q {
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.review-q:last-child { border-bottom: none; }
.review-q-label { color: var(--text-dim); font-size: 12px; margin-bottom: 2px; }
.review-q-val { color: var(--text); }

/* Bank info card */
.bank-card {
  background: var(--surface);
  border: 2px solid var(--accent);
  padding: 24px 20px;
  margin: 20px 0;
}
.bank-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.bank-row:last-child { margin-bottom: 0; }
.bank-label { color: var(--text-dim); font-size: 13px; min-width: 64px; }
.bank-val { color: var(--text); font-size: 17px; font-weight: 700; flex: 1; }
.bank-copy {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); padding: 6px 12px;
  font-size: 12px; font-weight: 600;
}
.bank-copy:hover { color: var(--accent); border-color: var(--accent); }
.bank-copy.copied { color: var(--ok); border-color: var(--ok); }

.order-id {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 15px; color: var(--accent); font-weight: 800;
  letter-spacing: 1px;
}

.notice {
  font-size: 13px; color: var(--text-dim); line-height: 1.6;
  background: var(--surface-2); border-left: 2px solid var(--accent);
  padding: 12px 14px; margin: 16px 0;
}

.done-screen {
  text-align: center; padding: 40px 0;
}
.done-icon {
  font-size: 48px; color: var(--accent); margin-bottom: 16px;
}
.done-screen h2 {
  font-size: 24px; font-weight: 800; margin-bottom: 12px;
}
.done-screen p {
  color: var(--text-dim); font-size: 15px;
}

/* Mobile tuning */
@media (max-width: 480px) {
  .wrap { padding: 16px 14px 60px; }
  .q-title { font-size: 19px; }
  .q-hint { font-size: 13px; }
  .opt { padding: 14px 16px; font-size: 15px; }
  .scale-row { gap: 2px; }
  .scale-row .opt {
    padding: 10px 2px; font-size: 11px; line-height: 1.2;
  }
  .chip { padding: 9px 12px; font-size: 13px; }
  .btn { padding: 14px 16px; font-size: 15px; }
  .bank-val { font-size: 15px; word-break: break-all; }
  .tier-card { padding: 20px 16px; }
  .tier-name { font-size: 18px; }
  .tier-price { font-size: 20px; }
}

/* 카톡 스크린샷 업로드 (deep 심층분석 recent-chat) */
.img-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.img-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border, #2a2f3a); background: var(--surface-2, #12161f); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-rm { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.img-rm:hover { background: #e63946; }
.img-add { min-width: 84px; height: 84px; padding: 8px; border: 1.5px dashed var(--border-light, #3a414f); border-radius: 10px; background: transparent; color: var(--text-dim, #9aa3b2); font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1.35; }
/* Before any photo is picked, make the upload button a full-width tap target */
.img-add:first-child { width: 100%; height: 64px; font-size: 15px; }
.img-add:hover:not(:disabled) { border-color: var(--accent, #e63946); color: var(--text, #e8ecf3); }
.img-add:disabled { opacity: .4; cursor: default; }
