:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --text: #1a1f29;
  --text-sub: #5a6677;
  --text-mute: #8a94a6;
  --line: #e7eaf0;
  --line-strong: #d5dae3;
  --primary: #3182f6;
  --primary-press: #1b64da;
  --primary-soft: #eaf2ff;
  --warn: #d63b3b;
  --warn-soft: #fdecec;
  --good: #16a34a;
  --good-soft: #e8f6ee;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-soft);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo",
    "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

ul, ol { padding: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* App layout */
.app {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.topbar-inner {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0;
}
.brand-word { display: inline-flex; align-items: baseline; }
.brand-light { font-weight: 500; color: var(--text-sub); }
.brand-bold  { font-weight: 800; color: var(--text); margin-left: 2px; }

main {
  flex: 1;
  padding: 20px 20px 80px;
}

.screen { animation: fadeIn .18s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Landing */
.landing { padding-top: 24px; }
.eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.hero-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.hero-desc {
  color: var(--text-sub);
  font-size: 15px;
  margin-bottom: 20px;
}
.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.meta li {
  font-size: 12px;
  color: var(--text-sub);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
}
.disclaimer-sm {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.6;
}
.result-top-disclaimer {
  text-align: center;
  margin: 0 0 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  background: transparent;
}
.btn + .btn { margin-top: 8px; }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-press); }
.btn-primary:disabled {
  background: var(--line);
  color: var(--text-mute);
  cursor: not-allowed;
}
.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { background: #eef0f4; }
.btn-text {
  background: transparent;
  color: var(--primary);
  height: 44px;
}

/* Wizard */
.progress { margin-bottom: 24px; }
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width .25s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 8px;
}

.question { margin-bottom: 24px; }
#qTitle {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-bottom: 6px;
}
.q-hint {
  font-size: 12px;
  color: var(--text-mute);
  background: var(--bg-soft);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
  font-weight: 500;
}
.q-hint--multi {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.option {
  width: 100%;
  text-align: left;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  transition: background .12s ease, border-color .12s ease;
}
.option:hover { background: var(--bg-soft); }
.option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-press);
  font-weight: 600;
}

/* multi-select 옵션: 좌측 체크박스 표시 */
.option-multi {
  display: flex;
  align-items: center;
  gap: 12px;
}
.option-check {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
  position: relative;
  transition: background .12s ease, border-color .12s ease;
}
.option-multi.selected .option-check {
  background: var(--primary);
  border-color: var(--primary);
}
.option-multi.selected .option-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.option-label { flex: 1; }

.wizard-actions {
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: 0;
  padding: 12px 0;
  background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0));
}
.wizard-actions .btn {
  flex: 1;
  margin-top: 0;
}
.wizard-actions .btn-ghost { flex: 0 0 96px; }

/* Result */
.result-head {
  text-align: center;
  padding: 8px 0 24px;
}
.result-emoji {
  font-size: 64px;
  line-height: 1;
  margin: 12px 0 8px;
}
.result-nickname {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.result-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 4px 0 8px;
}
.result-oneliner {
  font-size: 14px;
  color: var(--text-sub);
  font-style: italic;
  margin-bottom: 12px;
}
.result-summary {
  color: var(--text-sub);
  font-size: 15px;
  line-height: 1.6;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 10px;
}
.card-note {
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.5;
  margin: -4px 0 12px;
}
.card li {
  font-size: 15px;
  color: var(--text);
  padding: 6px 0;
  line-height: 1.5;
}

.dot-list li,
.check-list li,
.warn-list li,
.num-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.dot-list li::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-mute);
  margin-top: 10px;
  flex-shrink: 0;
}
.check-list li::before {
  content: "✓";
  color: var(--good);
  font-weight: 700;
  flex-shrink: 0;
  width: 16px;
  margin-top: 1px;
}
.rec-body { flex: 1; min-width: 0; }
.rec-name {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}
.ticker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ticker-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
  cursor: pointer;
}
.ticker-chip:hover {
  background: #eef0f4;
  border-color: var(--line-strong);
}
.ticker-chip:hover .ticker-ext { color: var(--primary); }
.ticker-ext {
  font-size: 11px;
  color: var(--text-mute);
  margin-left: 2px;
  line-height: 1;
  transition: color .12s ease;
}
.ticker-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-mute);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ticker-name { color: var(--text); }
.ticker-meta {
  color: var(--text-mute);
  font-weight: 500;
  font-size: 11px;
  padding-left: 8px;
  margin-left: 4px;
  border-left: 1px solid var(--line-strong);
  line-height: 1;
}
.warn-list li::before {
  content: "!";
  color: var(--warn);
  font-weight: 700;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}
.num-list { counter-reset: step; }
.num-list li {
  counter-increment: step;
}
.num-list li::before {
  content: counter(step);
  color: var(--primary);
  font-weight: 700;
  flex-shrink: 0;
  width: 16px;
}

/* Landing nickname input */
.landing-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  margin-bottom: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .12s ease;
}
.landing-input:focus { border-color: var(--primary); }

/* 이미지 캡처 영역 — html2canvas 가 PNG 로 저장 */
#resultCapture {
  background: #ffffff;
}
.capture-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-mute);
  padding: 8px 0 4px;
  margin: 8px 0 0;
  font-family: "Outfit", inherit;
  letter-spacing: -0.01em;
}

.result-actions {
  margin-top: 20px;
  margin-bottom: 16px;
}

.disclaimer {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.6;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: rgba(26, 31, 41, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
