:root {
  --bg: #f3f2ed;
  --surface: #ffffff;
  --surface-muted: #f8f7f3;
  --ink: #171717;
  --muted: #696966;
  --line: #deddd7;
  --accent: #ff5b2c;
  --accent-soft: #fff0e9;
  --good: #176846;
  --good-soft: #eaf6ef;
  --warn: #8d5a00;
  --warn-soft: #fff4dc;
  --bad: #a13333;
  --bad-soft: #fff0f0;
  --blue: #305d9b;
  --blue-soft: #edf3fb;
  --shadow: 0 22px 70px rgba(29, 28, 25, 0.09);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 15px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background:
    radial-gradient(circle at 90% 4%, rgba(255, 91, 44, 0.14), transparent 30rem),
    radial-gradient(circle at 4% 42%, rgba(48, 93, 155, 0.07), transparent 28rem),
    var(--bg);
}

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

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

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  padding: 52px 0 28px;
}

.eyebrow,
.step-label,
.card-label,
.verdict-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 13px;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.8;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(23, 104, 70, 0.12);
}

.progress {
  margin-bottom: 16px;
  padding: 0 16px;
}

.progress ol {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa9a4;
  transition: color 0.2s ease;
}

.progress-item span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #cbc9c2;
  border-radius: 50%;
  background: var(--bg);
  font-size: 0.74rem;
  font-weight: 850;
}

.progress-item small {
  font-size: 0.74rem;
  font-weight: 750;
  white-space: nowrap;
}

.progress-item.active,
.progress-item.complete { color: var(--ink); }
.progress-item.active span { border-color: var(--ink); background: var(--ink); color: #fff; }
.progress-item.complete span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.progress-line {
  flex: 1;
  height: 1px;
  margin: 0 12px;
  background: var(--line);
}

.panel {
  border: 1px solid rgba(222, 221, 215, 0.9);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.questionnaire { padding: clamp(24px, 4vw, 48px); }

.step-screen { animation: fade-in 0.22s ease; }
.step-screen[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-heading { margin-bottom: 28px; }
.screen-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.045em;
}
.screen-heading > p:last-child {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compact-heading,
.result-topline,
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.question-counter {
  flex-shrink: 0;
  margin: 6px 0 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.form-stack { display: grid; gap: 24px; }

.field,
.field-set { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.field > span,
.field-set legend {
  font-size: 0.84rem;
  font-weight: 800;
}
.field small { color: var(--muted); line-height: 1.55; }

input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 91, 44, 0.12);
}

.input-with-unit { display: flex; align-items: stretch; }
.input-with-unit input { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-with-unit span {
  display: inline-flex;
  align-items: center;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: #efeee9;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  white-space: nowrap;
}

.choice-grid { display: grid; gap: 12px; }
.category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hesitation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.choice-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.choice-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(23, 23, 23, 0.06); }
.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(255, 91, 44, 0.1);
}
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card strong { font-size: 0.95rem; }
.choice-card small { color: var(--muted); line-height: 1.55; }
.choice-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
}
.text-card { min-height: 118px; }

.screen-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 820;
  font-size: 0.84rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { min-width: 160px; background: var(--ink); color: #fff; box-shadow: 0 10px 22px rgba(23, 23, 23, 0.16); }
.button-secondary { border-color: rgba(255, 91, 44, 0.25); background: var(--accent-soft); color: var(--accent); }
.button-ghost { border-color: var(--line); background: #fff; color: var(--muted); }

.form-error { min-height: 1.4em; margin: 12px 0 0; color: var(--bad); font-size: 0.82rem; font-weight: 750; }

.question-stage {
  min-height: 330px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-muted);
}
.question-context { margin-bottom: 10px; color: var(--accent); font-size: 0.78rem; font-weight: 800; }
.question-stage h3 { margin-bottom: 12px; font-size: clamp(1.45rem, 3vw, 2.15rem); letter-spacing: -0.035em; }
.question-help { margin-bottom: 26px; color: var(--muted); line-height: 1.7; }

.answer-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.answer-option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 66px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  font-weight: 760;
  line-height: 1.45;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.answer-option:hover { transform: translateY(-1px); }
.answer-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.answer-option input { position: absolute; opacity: 0; pointer-events: none; }

.number-answer { max-width: 520px; }
.number-answer .input-with-unit input { background: #fff; }

.result-topline { margin-bottom: 24px; }
.result-topline h2 { margin-bottom: 0; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.045em; }

.verdict-card {
  margin-bottom: 18px;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid rgba(141, 90, 0, 0.2);
  border-radius: var(--radius-xl);
  background: var(--warn-soft);
}
.verdict-card.good { border-color: rgba(23, 104, 70, 0.2); background: var(--good-soft); }
.verdict-card.bad { border-color: rgba(161, 51, 51, 0.2); background: var(--bad-soft); }
.verdict-card.try { border-color: rgba(48, 93, 155, 0.2); background: var(--blue-soft); }
.verdict-card.good .verdict-kicker { color: var(--good); }
.verdict-card.bad .verdict-kicker { color: var(--bad); }
.verdict-card.try .verdict-kicker { color: var(--blue); }
.verdict-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.verdict-heading h3 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -0.06em; }
.verdict-tag { padding: 8px 11px; border: 1px solid currentColor; border-radius: 999px; color: var(--warn); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.1em; }
.verdict-card.good .verdict-tag { color: var(--good); }
.verdict-card.bad .verdict-tag { color: var(--bad); }
.verdict-card.try .verdict-tag { color: var(--blue); }
.verdict-summary { max-width: 800px; margin: 18px 0 0; line-height: 1.8; }

.result-grid,
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.result-card,
.detail-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}
.result-card h3 { margin-bottom: 10px; font-size: 1.25rem; letter-spacing: -0.025em; }
.result-card p:last-child { margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.cost-card { background: var(--surface-muted); }

.axis-section { margin: 28px 0; }
.section-title-row { margin-bottom: 14px; align-items: end; }
.section-title-row h3 { margin-bottom: 0; }
.section-title-row small { color: var(--muted); }
.axis-list { display: grid; gap: 12px; }
.axis-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 54px;
  gap: 15px;
  align-items: center;
}
.axis-name { font-size: 0.82rem; font-weight: 800; }
.axis-track { height: 10px; border-radius: 999px; background: #e8e7e2; overflow: hidden; }
.axis-fill { height: 100%; border-radius: inherit; background: var(--ink); }
.axis-label { text-align: right; color: var(--muted); font-size: 0.76rem; font-weight: 800; }

.detail-grid { margin-top: 16px; }
.detail-card ul { display: grid; gap: 10px; margin: 0; padding-left: 1.15rem; }
.detail-card li { color: var(--muted); line-height: 1.65; }
.condition-card { background: var(--accent-soft); border-color: rgba(255, 91, 44, 0.2); }

.next-action-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
}
.next-action-card .card-label { color: #ff9b7d; }
.next-action-card h3 { margin-bottom: 8px; font-size: 1.35rem; }
.next-action-card p:last-child { margin-bottom: 0; color: #cecece; line-height: 1.7; }
.action-icon { font-size: 2rem; }

.answer-review { margin-top: 18px; border-top: 1px solid var(--line); }
.answer-review summary { padding: 18px 0 8px; cursor: pointer; color: var(--muted); font-weight: 750; }
.answer-review dl { display: grid; grid-template-columns: minmax(150px, 0.45fr) 1fr; gap: 8px 18px; margin: 12px 0 0; }
.answer-review dt { color: var(--muted); font-size: 0.8rem; }
.answer-review dd { margin: 0; font-weight: 700; }

.disclaimer { margin: 20px 0 0; color: var(--muted); font-size: 0.73rem; line-height: 1.65; }
footer { padding: 24px 0 42px; text-align: center; color: var(--muted); font-size: 0.74rem; }
footer p { margin: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hesitation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .site-header { display: grid; padding-top: 34px; }
  .privacy-badge { justify-self: start; }
  .progress { padding: 0 4px; }
  .progress-item small { display: none; }
  .progress-line { margin-inline: 8px; }
  .questionnaire { border-radius: 22px; }
  .category-grid,
  .hesitation-grid,
  .answer-options,
  .result-grid,
  .detail-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 108px; }
  .compact-heading,
  .result-topline,
  .section-title-row { display: grid; }
  .question-counter { justify-self: start; }
  .verdict-heading { align-items: flex-start; flex-direction: column; }
  .axis-row { grid-template-columns: 88px minmax(0, 1fr) 44px; gap: 10px; }
  .screen-actions { justify-content: stretch; }
  .screen-actions .button { flex: 1; }
  .answer-review dl { grid-template-columns: 1fr; gap: 3px; }
  .answer-review dd { margin-bottom: 10px; }
}

@media (max-width: 430px) {
  .site-header,
  .app-shell,
  footer { width: min(100% - 20px, 1120px); }
  .category-grid { grid-template-columns: 1fr; }
  .questionnaire { padding: 20px; }
  .question-stage { padding: 22px; }
  .screen-actions { flex-direction: column-reverse; }
  .button-primary { width: 100%; }
}
