/* ---------------------------------------------------------------- 토큰 */
:root {
  color-scheme: light dark;
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f2efea;
  --text: #1c1a18;
  --muted: #6b645c;
  --line: #e2ddd5;
  --accent: #b4552d;
  --accent-soft: #f6e7df;
  --focus: #2f6fd0;
  --radius: 14px;
  --maxw: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151a;
    --surface: #1f1e24;
    --surface-2: #26252c;
    --text: #ece9e4;
    --muted: #9b948c;
    --line: #33313a;
    --accent: #e08a5f;
    --accent-soft: #33241d;
    --focus: #7aa9f0;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo",
        "Malgun Gothic", "Noto Sans KR", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  left: 12px; top: 12px; z-index: 10;
  background: var(--surface); padding: 8px 12px; border-radius: 8px;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- 레이아웃 */
.site {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 8px;
}
.site__brand {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit;
}
.site__mark { font-size: 22px; }
.site__name { font-weight: 700; letter-spacing: -0.01em; font-size: 19px; }
.site__tagline { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px 64px;
}

.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 48px;
  color: var(--muted);
  font-size: 13px;
}

.loading, .error { color: var(--muted); padding: 32px 0; }

/* ---------------------------------------------------------------- 목록 */
.card-list { display: grid; gap: 12px; margin-top: 16px; }

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, border-color .12s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card__title { font-weight: 650; font-size: 17px; margin: 0 0 4px; }
.card__desc { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.card__meta { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- 진행 */
.progress {
  height: 4px; background: var(--surface-2);
  border-radius: 99px; overflow: hidden; margin: 4px 0 20px;
}
.progress__bar {
  height: 100%; background: var(--accent);
  transition: width .25s ease;
}
.step-count { font-size: 13px; color: var(--muted); margin: 0 0 6px; }

.q-title {
  font-size: 21px; line-height: 1.45; font-weight: 650;
  margin: 0 0 6px; letter-spacing: -0.01em;
}
.q-hint { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- 선택지 */
.options { display: grid; gap: 10px; margin: 0 0 24px; }

.option {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font: inherit; color: inherit; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.option:hover { border-color: var(--accent); }
.option[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft);
}
.option__key {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 12px; color: var(--muted); margin-top: 2px;
}
.option[aria-pressed="true"] .option__key {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* 스케일 */
.scale { margin: 0 0 24px; }
.scale__row { display: flex; gap: 8px; }
.scale__btn {
  flex: 1; padding: 14px 0; font: inherit; cursor: pointer;
  background: var(--surface); color: inherit;
  border: 1px solid var(--line); border-radius: 10px;
}
.scale__btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.scale__labels {
  display: flex; justify-content: space-between;
  font-size: 12.5px; color: var(--muted); margin-top: 8px;
}

/* 자유 응답 */
.textarea {
  width: 100%; min-height: 120px; resize: vertical;
  background: var(--surface); color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; font: inherit; margin-bottom: 8px;
}
.counter { font-size: 12.5px; color: var(--muted); margin: 0 0 20px; text-align: right; }

/* ---------------------------------------------------------------- 버튼 */
.actions { display: flex; gap: 10px; align-items: center; }

.btn {
  font: inherit; cursor: pointer; border-radius: 10px;
  padding: 12px 18px; border: 1px solid var(--line);
  background: var(--surface); color: inherit;
}
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------------------------- 결과 */
.result__kicker { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.result__title { font-size: 30px; margin: 0 0 4px; letter-spacing: -0.02em; }
.result__summary { color: var(--accent); font-weight: 600; margin: 0 0 20px; }
.result__body { margin: 0 0 28px; }

.axes { display: grid; gap: 12px; margin: 0 0 28px; }
.axis__head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.axis__name { font-weight: 600; }
.axis__pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.axis__track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.axis__fill { height: 100%; background: var(--accent); border-radius: 99px; }
.axis__fill--dim { background: var(--line); }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin: 0 0 24px;
}
.panel__title { font-size: 14px; font-weight: 650; margin: 0 0 10px; }
.panel ul { margin: 0; padding-left: 18px; }
.panel li { margin-bottom: 8px; }
.panel li:last-child { margin-bottom: 0; }

.quote {
  margin: 0; padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted); font-style: italic;
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 99px; font-size: 14px;
}
