@font-face {
  font-family: Manrope;
  src: url("assets/manrope.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #f4f5fb;
  --paper: #fff;
  --ink: #161b33;
  --muted: #505970;
  --line: #d6d9e7;
  --accent: #263dc6;
  --accent-dark: #1a2b99;
  --deep: #172355;
  --lime: #e4f297;
  --danger: #952933;
  --brand-font: Manrope, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-color: #8e98bf var(--background); }
body {
  background: var(--background);
  color: var(--ink);
  font-family: var(--brand-font);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
button { font: inherit; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { opacity: .55; }
::selection { color: var(--deep); background: var(--lime); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.shell { width: min(100% - 80px, 1160px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.masthead, .footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.masthead { min-height: 72px; }
.wordmark {
  border: 0;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 4px 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.brand-mark { display: grid; grid-template-columns: repeat(2, 8px); gap: 3px; transform: rotate(-8deg); }
.brand-mark i { width: 8px; height: 8px; background: var(--accent); border-radius: 2px; }
.brand-mark i:last-child { background: var(--lime); border: 1px solid var(--accent); }
.header-note { font-size: .875rem; color: var(--muted); font-weight: 700; }
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: clamp(36px, 7vw, 114px);
  padding-block: clamp(48px, 8vw, 110px) clamp(42px, 7vw, 88px);
}
.hero h1 {
  font-size: clamp(3.35rem, 6vw, 5.5rem);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -.04em;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.intro {
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.85;
  max-width: 26em;
  margin-block: 26px 30px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  transition: background-color .16s, border-color .16s, color .16s;
}
.primary { background: var(--accent); color: var(--paper); }
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.secondary { border-color: var(--line); background: var(--paper); color: var(--ink); }
.secondary:hover { background: #e8ebff; border-color: #a1aaf1; }
#start { min-width: 162px; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin-top: 16px;
  color: var(--muted);
  font-size: .875rem;
}
.hero-meta span + span { margin-left: 10px; padding-left: 10px; border-left: 1px solid #a8afc8; }
.map {
  color: var(--paper);
  background: var(--deep);
  padding: 24px;
  border-radius: 16px;
  min-width: 0;
}
.map-header {
  display: flex;
  justify-content: space-between;
  color: #dfe5ff;
  font-weight: 750;
  font-size: .875rem;
  margin: 0 3px 14px;
}
.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.map-cell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1.23;
  color: var(--deep);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(14px, 2vw, 26px);
  border-radius: 3px;
}
.energy { background: var(--lime); }
.information { background: #dee5ff; }
.decision { background: #d3caef; }
.planning { background: #f8d3b8; }
.cell-letters {
  font-size: clamp(2.2rem, 4.2vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 800;
}
.cell-letters span { opacity: .72; margin-inline: .06em; font-weight: 500; }
.cell-name { font-size: .875rem; font-weight: 750; margin-top: 6px; }
.cell-symbol { position: absolute; z-index: -1; width: 54%; height: 64%; top: 0; right: 0; }
.energy .cell-symbol { border: 1px solid #7d911b; border-radius: 0 0 0 100%; }
.energy .cell-symbol::after,
.planning .cell-symbol::after { content: ""; position: absolute; inset: 0 0 24% 24%; border: inherit; border-radius: inherit; }
.information .cell-symbol {
  background: linear-gradient(135deg, transparent 49.5%, #798bd4 50%, transparent 50.5%);
  border-left: 1px solid #798bd4;
  border-bottom: 1px solid #798bd4;
}
.decision .cell-symbol {
  background: radial-gradient(circle at 100% 0, transparent 48%, #8771bb 49%, transparent 50%),
    radial-gradient(circle at 100% 0, transparent 71%, #8771bb 72%, transparent 73%);
}
.planning .cell-symbol { border: 1px solid #a76c44; transform: rotate(-12deg) translate(15%, -8%); }
.instructions {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  padding: 28px 0 42px;
}
.instructions h2, .result-body h2, .reflection h2 { font-size: 1.35rem; font-weight: 800; }
.instructions p, .section-description { color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); }
.footer-content { padding-block: 20px; color: var(--muted); font-size: .875rem; }
.stage { max-width: 754px; margin-inline: auto; padding-block: clamp(32px, 5vw, 64px); }
.stage-head { margin-bottom: 22px; }
.stage-title-row, .progress-row, .actions, .preference-title, .preference-ends {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stage h1 { font-size: clamp(1.65rem, 5vw, 2.4rem); font-weight: 800; }
.page-count, #progress-label { flex: none; font-size: .875rem; color: var(--muted); font-weight: 800; }
.progress-row { margin-block: 14px 8px; }
progress {
  appearance: none;
  inline-size: 100%;
  block-size: 7px;
  border: 0;
  border-radius: 9px;
  background: #dce1f6;
  color: var(--accent);
}
progress::-webkit-progress-bar { background: #dce1f6; border-radius: 9px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 9px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 9px; }
.stage-description { color: var(--muted); }
.scale-key {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  list-style: none;
  padding: 0;
  margin: 9px 0 0;
  font-size: .875rem;
  color: var(--muted);
}
.scale-key li { display: inline-flex; gap: 4px; }
.scale-key strong { color: var(--accent-dark); }
#question-list { display: grid; gap: 13px; }
.question {
  display: block;
  min-inline-size: 0;
  padding: 16px clamp(14px, 4vw, 30px) 18px;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.question legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 750;
  line-height: 1.65;
}
.question-number { color: var(--accent); font-variant-numeric: tabular-nums; flex: none; }
.scale, .scale-notes { clear: both; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.scale label { position: relative; cursor: pointer; min-width: 0; }
.scale input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.scale-cell {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #c4cbe8;
  border-radius: 6px;
  background: #f1f3fb;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  transition: background-color .16s, border-color .16s, color .16s;
}
.scale label:nth-child(4) .scale-cell { background: var(--paper); }
.scale label:hover .scale-cell { background: #e3e8ff; border-color: #8c9bed; }
.scale input:checked + .scale-cell { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.scale input:checked + .scale-cell::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.scale input:focus-visible + .scale-cell { outline: 2px solid var(--accent); outline-offset: 2px; }
.scale-notes { color: var(--muted); font-size: .875rem; margin-top: 7px; }
.scale-notes span:nth-child(1) { grid-column: 1 / 4; }
.scale-notes span:nth-child(2) { grid-column: 4; text-align: center; }
.scale-notes span:nth-child(3) { grid-column: 5 / 8; text-align: right; }
.question[data-unanswered] { border-color: var(--danger); }
#form-alert { margin: 0 0 15px; }
.alert { color: var(--danger); margin-top: 15px; font-weight: 700; }
.actions { margin-top: 24px; }
.result-top { background: var(--deep); color: var(--paper); padding: clamp(24px, 5vw, 42px); border-radius: 16px; }
.result-top h1 { font-size: 1.15rem; color: #dfe5ff; }
.result-top h1:focus { outline-color: var(--lime); }
.result-code { font-size: clamp(4rem, 13vw, 7rem); line-height: 1.12; color: var(--lime); letter-spacing: -.04em; font-weight: 800; margin-block: 4px 12px; }
#result-summary { max-width: 34em; }
.result-body, .reflection, .type-directory { margin-top: 30px; }
.section-description { margin-top: 8px; }
#result-list { margin-top: 15px; border-top: 1px solid var(--line); }
.preference { padding: 16px 0; border-bottom: 1px solid var(--line); }
.preference h3 { font-size: 1.0625rem; }
.preference-title span { color: var(--accent-dark); font-weight: 750; font-size: .875rem; }
.preference p { color: var(--muted); font-size: .9375rem; margin-top: 4px; }
.preference-track {
  height: 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #bfcaff, #e1e5f3 50%, #e4e8f3 50%, #c7d78d);
  margin: 15px 6px 8px;
  position: relative;
}
.preference-track::before, .preference-track::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}
.preference-track::before { left: 50%; width: 1px; height: 10px; background: #6f789a; }
.preference-track::after { left: var(--marker, 50%); background: var(--deep); border: 2px solid var(--paper); width: 16px; height: 16px; border-radius: 50%; }
.preference-ends { font-size: .875rem; }
.preference-ends strong { color: var(--accent-dark); }
.reflection { padding: 20px; background: var(--lime); border-radius: 12px; }
.reflection p { margin-top: 8px; }
.type-directory { padding-block: 13px; border-block: 1px solid var(--line); }
.type-directory summary { font-weight: 800; color: var(--accent-dark); }
#type-list { padding-top: 12px; }
#type-list p { padding-block: 10px; display: grid; grid-template-columns: 3.25rem 1fr; gap: 8px; }
#type-list p + p { border-top: 1px solid var(--line); }
#type-list strong { color: var(--accent-dark); }

@media (max-width: 760px) {
  .shell { width: min(100% - 36px, 540px); }
  .masthead { min-height: 60px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-block: 36px 32px; }
  .hero h1 { font-size: clamp(2.7rem, 10.5vw, 4.4rem); }
  .intro { margin-block: 17px 20px; }
  .map { padding: 14px; }
  .map-grid { gap: 5px; }
  .map-cell { aspect-ratio: 1.54; }
  .cell-letters { font-size: clamp(2.05rem, 8.8vw, 3.25rem); }
  .instructions { grid-template-columns: 1fr; gap: 9px; padding: 20px 0 32px; }
  .desktop-break { display: none; }
  .footer-content { flex-wrap: wrap; gap: 4px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media (forced-colors: active) {
  .scale input:checked + .scale-cell {
    forced-color-adjust: none;
    background: Highlight;
    border-color: Highlight;
    color: HighlightText;
  }
  .scale input:focus-visible + .scale-cell { outline-color: Highlight; }
}
