:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #152033;
  --muted: #5f6b7a;
  --line: #dbe2ea;
  --accent: #3157d5;
  --accent-2: #0f766e;
  --soft: #eef3ff;
  --soft-2: #ecfdf5;
  --danger: #b42318;
  --shadow: 0 22px 70px rgba(21, 32, 51, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, #eaf0ff 0, transparent 32%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.55;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.hero-copy {
  margin: 16px 0 0;
  max-width: 820px;
  color: var(--muted);
  font-size: 17px;
}

.hero-card {
  background: linear-gradient(145deg, #13203a, #263b70);
  color: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.hero-card strong { font-size: 20px; }
.hero-card span {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 7px 10px;
  color: rgba(255,255,255,.88);
}

.panel {
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(219,226,234,.8);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.question-view { padding: 28px; }
.progress-wrap {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.progress-track {
  height: 11px;
  background: #e9edf5;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width .25s ease;
}

.question-title {
  margin: 0;
  font-size: clamp(23px, 3vw, 34px);
  letter-spacing: -0.035em;
}
.question-hint {
  margin: 8px 0 22px;
  color: var(--muted);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option-card {
  position: relative;
  min-height: 112px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  padding: 18px 18px 18px 54px;
  transition: .16s ease;
}
.option-card:hover { transform: translateY(-1px); border-color: #9aacd9; box-shadow: 0 10px 28px rgba(21,32,51,.08); }
.option-card.selected { background: var(--soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.option-card .check {
  position: absolute;
  left: 18px;
  top: 20px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid #9aa8b8;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: white;
  background: white;
}
.option-card.selected .check { background: var(--accent); border-color: var(--accent); }
.option-card strong { display: block; font-size: 17px; margin-bottom: 6px; }
.option-card span { color: var(--muted); font-size: 14px; }

.warning {
  min-height: 24px;
  color: var(--danger);
  font-weight: 700;
  margin: 14px 0 0;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font-weight: 800;
  background: #e9edf5;
  color: var(--text);
}
.btn.primary { background: var(--accent); color: white; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.result-view { padding: 28px; }
.result-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}
.result-header h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -.04em;
}
.result-header p { margin: 8px 0 0; color: var(--muted); }

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 24px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2f7;
  color: #344054;
  border: 1px solid #d8dee9;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}
.badge.emph { background: var(--soft-2); color: #047857; border-color: #b7ebd2; }

.result-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 18px;
}
.cards { display: grid; gap: 16px; }
.reco-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 12px 36px rgba(21,32,51,.06);
}
.reco-card.top { border-color: rgba(49, 87, 213, .42); box-shadow: 0 18px 45px rgba(49,87,213,.12); }
.rank-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}
.rank {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #152033;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
}
.score { color: var(--muted); font-weight: 900; }
.scorebar { height: 8px; background: #e9edf5; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.scorebar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.reco-card h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.meta { color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.research-title {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 14px 0;
}
.research-title strong { display: block; margin-bottom: 5px; }
.reco-card ul { margin: 8px 0 0 20px; padding: 0; }
.reco-card li { margin: 4px 0; }
.link-line a { color: var(--accent); font-weight: 800; text-decoration: none; }

.side-panel {
  background: #111827;
  color: white;
  border-radius: 24px;
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 18px;
}
.side-panel h3 { margin: 0 0 12px; }
.side-panel p { color: rgba(255,255,255,.72); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list .badge { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.18); }
.answer-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.answer-list li { border-top: 1px solid rgba(255,255,255,.12); padding-top: 10px; color: rgba(255,255,255,.8); }
.answer-list strong { color: white; display: block; }

.empty-state {
  padding: 40px;
  text-align: center;
}

@media (max-width: 860px) {
  .hero, .result-grid, .result-header { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
  .question-view, .result-view { padding: 20px; }
  .side-panel { position: static; }
}
