:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --surface: #ffffff;
  --surface-soft: #f0f4f3;
  --border: #d8ded8;
  --text: #17201c;
  --muted: #607067;
  --accent: #0f766e;
  --accent-strong: #134e4a;
  --danger: #c2410c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Hiragino Sans", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 3px;
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.intro,
.result {
  display: grid;
  gap: 16px;
}

.hero {
  padding: 28px 0 12px;
}

.eyebrow,
.qid {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 10px;
}

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

.hero h1,
.result-hero h1,
.question-card h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
  margin-bottom: 14px;
}

.hero p,
.question-card .description,
.result-hero p,
.surface p,
.surface li {
  color: var(--muted);
  line-height: 1.8;
}

.badges,
.result-meta,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badges span,
.confidence,
.near-type {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.badges span {
  padding: 8px 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.surface,
.question-card,
.result-hero,
.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 14px 34px rgba(23, 32, 28, 0.07);
}

.axis-grid,
.grid-two,
.mini-grid {
  display: grid;
  gap: 14px;
}

.axis-grid {
  grid-template-columns: repeat(4, 1fr);
}

.axis-grid > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}

.axis-grid p {
  margin: 8px 0 0;
  font-size: 13px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
}

.red {
  background: #dc2626;
}

.amber {
  background: #d97706;
}

.green {
  background: #059669;
}

.purple {
  background: #7c3aed;
}

.note,
.status {
  color: var(--muted) !important;
  font-size: 13px;
  margin-bottom: 0;
}

.primary,
.secondary,
.option {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.primary,
.secondary {
  width: fit-content;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: 8px;
  font-weight: 800;
}

.primary {
  border: 1px solid var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent-strong);
}

.primary:hover,
.secondary:hover,
.option:hover {
  transform: translateY(-1px);
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 12px;
}

.ghost {
  background: transparent;
  border: 0;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 0;
}

.progress {
  height: 8px;
  background: #e2e8e3;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress > div {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.22s ease;
}

.section-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.section-steps span {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.section-steps span.active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: #dff3ef;
}

.section-steps span.done {
  color: #31544d;
  background: #edf5f2;
}

.options {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.option {
  width: 100%;
  min-height: 64px;
  padding: 16px 18px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.option.picked {
  border-color: var(--accent);
  background: #e3f4f1;
}

.result-hero {
  border-color: color-mix(in srgb, var(--result-color), white 42%);
  box-shadow: inset 6px 0 0 var(--result-color), 0 14px 34px rgba(23, 32, 28, 0.07);
}

.result-hero h2 {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 14px;
}

.confidence,
.near-type {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  min-width: 150px;
  padding: 12px 14px;
}

.confidence span,
.near-type span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.confidence strong {
  font-size: 28px;
}

.confidence small {
  color: var(--danger);
  font-weight: 800;
}

.near-type strong {
  font-size: 16px;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.score-row {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.score-row > div:first-child,
.candidates li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.score-track {
  height: 8px;
  background: #e2e8e3;
  border-radius: 999px;
  overflow: hidden;
}

.score-track > div {
  height: 100%;
  background: var(--accent);
}

.candidates {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}

.candidates strong {
  color: var(--accent-strong);
  white-space: nowrap;
}

.surface ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.share-card {
  border-color: color-mix(in srgb, var(--result-color), white 45%);
  background: color-mix(in srgb, var(--result-color), white 92%);
}

.share-card p,
.share-card span {
  color: color-mix(in srgb, var(--result-color), black 30%);
  font-weight: 800;
}

.share-card h3 {
  font-size: clamp(26px, 4vw, 42px);
  margin-bottom: 8px;
}

.share-card strong {
  display: block;
  margin-bottom: 14px;
}

.compact-scores {
  display: grid;
  gap: 16px;
}

.mini-grid {
  grid-template-columns: repeat(3, 1fr);
}

.mini-grid p {
  margin: 8px 0 0;
  font-size: 13px;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 980px);
    padding-top: 20px;
  }

  .hero {
    padding-top: 18px;
  }

  .axis-grid,
  .grid-two,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .surface,
  .question-card,
  .result-hero,
  .share-card {
    padding: 18px;
  }

  .primary,
  .secondary {
    width: 100%;
  }
}
