:root {
  color-scheme: light;
  --paper: #f2e8d3;
  --paper-light: #fbf5e8;
  --paper-deep: #dfceb0;
  --ink: #182821;
  --ink-soft: #4d594f;
  --green: #355e4b;
  --green-dark: #244436;
  --green-pale: #b8c3aa;
  --terracotta: #bf6041;
  --terracotta-dark: #8f402c;
  --line: rgba(38, 65, 51, 0.22);
  --shadow: 0 18px 55px rgba(25, 37, 30, 0.18);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

html {
  min-width: 320px;
  background: var(--green-dark);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 12%, rgba(242, 232, 211, 0.13), transparent 24rem),
    linear-gradient(145deg, #1d382c, #294a3a 58%, #1a3228);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

.music-toggle {
  position: fixed;
  z-index: 30;
  top: max(0.8rem, env(safe-area-inset-top));
  left: calc(50% + min(260px, 50vw) - 3.4rem);
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  place-items: center;
  color: var(--paper-light);
  border: 1px solid rgba(251, 245, 232, 0.45);
  border-radius: 50%;
  background: rgba(36, 68, 54, 0.88);
  box-shadow: 0 5px 18px rgba(24, 40, 33, 0.2);
  backdrop-filter: blur(8px);
}

.music-toggle[aria-pressed="false"] {
  color: rgba(251, 245, 232, 0.58);
}

@media (max-width: 520px) {
  .music-toggle { right: 0.8rem; left: auto; }
}

button {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

#app {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: clip;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.access-gate {
  display: grid;
  align-content: center;
  min-height: 100dvh;
  padding: 2rem;
}

.access-gate h1 {
  max-width: 9em;
  margin: 0.5rem 0 1rem;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 10vw, 3.5rem);
  line-height: 1.15;
}

.access-gate > p:last-of-type {
  max-width: 25rem;
  color: var(--ink-soft);
}

.access-pulse {
  width: 3rem;
  height: 3px;
  margin-top: 1.5rem;
  background: var(--terracotta);
  animation: access-pulse 1.1s ease-in-out infinite alternate;
}

.access-ticket {
  margin: 1rem 0 0;
  padding-left: 0.85rem;
  color: var(--green-dark);
  border-left: 3px solid var(--terracotta);
  font-size: 0.86rem;
  font-weight: 700;
}

@keyframes access-pulse {
  to { width: 8rem; opacity: 0.45; }
}

.app-page {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(155deg, var(--paper-light), var(--paper) 52%, #eadcc2);
  animation: page-arrival 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.paper-grain {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, transparent 0 2px, rgba(72, 65, 47, 0.045) 2.6px 3px),
    repeating-linear-gradient(91deg, transparent 0 7px, rgba(116, 92, 63, 0.025) 8px 9px);
  background-size: 19px 17px, 31px 29px;
  mix-blend-mode: multiply;
}

.kicker,
.question-prompt,
.section-number,
.portrait-kicker,
.module-name,
.module-count {
  margin: 0;
  color: var(--terracotta-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.question-prompt {
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  line-height: 1.55;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
}

.primary-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 0;
  border-radius: 2px;
  padding: 0.85rem 1.25rem;
  color: var(--paper-light);
  background: var(--green-dark);
  box-shadow: 4px 5px 0 rgba(191, 96, 65, 0.8);
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.primary-button:hover:not(:disabled) {
  background: var(--green);
  transform: translate(-1px, -1px);
  box-shadow: 6px 7px 0 rgba(191, 96, 65, 0.8);
}

.primary-button:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 2px 0 rgba(191, 96, 65, 0.8);
}

.primary-button:disabled {
  opacity: 0.45;
  box-shadow: none;
}

/* Welcome */
.welcome-page::before,
.welcome-page::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(53, 94, 75, 0.18);
  border-radius: 49% 51% 45% 55%;
  content: "";
}

.welcome-page::before {
  width: 420px;
  height: 240px;
  top: -90px;
  right: -220px;
  transform: rotate(-18deg);
  box-shadow: 0 0 0 14px rgba(53, 94, 75, 0.04), 0 0 0 31px rgba(53, 94, 75, 0.035);
}

.welcome-page::after {
  width: 330px;
  height: 190px;
  bottom: -82px;
  left: -180px;
  transform: rotate(22deg);
  box-shadow: 0 0 0 16px rgba(191, 96, 65, 0.04), 0 0 0 34px rgba(191, 96, 65, 0.03);
}

.welcome {
  display: flex;
  width: 100%;
  min-height: 100dvh;
  flex-direction: column;
  justify-content: center;
  padding: max(2rem, env(safe-area-inset-top)) 1.5rem max(1.5rem, env(safe-area-inset-bottom));
}

.welcome-compass {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 0 2rem auto;
  transform: rotate(8deg);
}

.compass-ring {
  position: absolute;
  inset: 7px;
  border: 1px solid var(--green);
  border-radius: 50%;
  box-shadow: inset 0 0 0 8px rgba(53, 94, 75, 0.06), 0 0 0 3px var(--paper), 0 0 0 4px rgba(53, 94, 75, 0.28);
}

.compass-ring::before,
.compass-ring::after {
  position: absolute;
  background: var(--green);
  content: "";
}

.compass-ring::before {
  width: 1px;
  height: 112px;
  top: -15px;
  left: 49px;
}

.compass-ring::after {
  width: 112px;
  height: 1px;
  top: 49px;
  left: -15px;
}

.compass-needle {
  position: absolute;
  z-index: 1;
  width: 24px;
  height: 72px;
  top: 20px;
  left: 44px;
  background: linear-gradient(to bottom, var(--terracotta) 0 50%, var(--green-dark) 50%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: needle-find 1.2s 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.compass-letter {
  position: absolute;
  top: -8px;
  left: 51px;
  color: var(--terracotta-dark);
  font: 800 0.7rem/1 var(--serif);
}

.welcome-copy {
  position: relative;
}

.welcome-copy::before {
  display: block;
  width: 34px;
  height: 5px;
  margin-bottom: 0.75rem;
  background: var(--terracotta);
  content: "";
}

.welcome h1 {
  max-width: 9em;
  margin: 0.7rem 0 1.15rem;
  font-size: clamp(2.45rem, 11vw, 3.75rem);
  letter-spacing: -0.055em;
}

.welcome-lede {
  max-width: 29rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.9;
}

.welcome-cta {
  width: 100%;
  margin-top: 2.35rem;
  justify-content: space-between;
  padding-inline: 1.4rem;
}

/* Assessment */
.assessment-shell,
.values-shell {
  width: 100%;
  min-height: 100dvh;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
}

.module-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 1rem;
  align-items: center;
}

.back-button {
  display: inline-flex;
  min-width: 64px;
  min-height: 44px;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  padding: 0;
  color: var(--green-dark);
  background: transparent;
  cursor: pointer;
}

.back-button span:first-child {
  font-size: 1.25rem;
}

.module-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.module-count {
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.progress-track {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  background: rgba(53, 94, 75, 0.14);
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--terracotta), #d68a5e);
  transition: width 260ms ease;
}

.question-panel {
  display: flex;
  min-height: calc(100dvh - 100px);
  flex-direction: column;
  padding: clamp(2.5rem, 8vh, 5rem) 0 1rem;
}

.module-intro {
  margin: -1.6rem 0 1.4rem;
  border-left: 3px solid var(--green-pale);
  padding-left: 0.8rem;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.question-panel h1 {
  max-width: 13em;
  margin: 0.6rem 0 0;
  font-size: clamp(1.55rem, 6.2vw, 2.05rem);
  letter-spacing: -0.025em;
}

.values-panel h1 {
  max-width: 13em;
  margin: 0.6rem 0 clamp(2rem, 6vh, 3.5rem);
  font-size: clamp(1.55rem, 6.2vw, 2.05rem);
  letter-spacing: -0.025em;
}

.answer-list {
  display: grid;
  gap: 0.75rem;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.answer-option {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  gap: 0.85rem;
  border: 1px solid rgba(53, 94, 75, 0.3);
  border-radius: 2px;
  padding: 0.8rem 1rem;
  color: var(--ink);
  background: rgba(251, 245, 232, 0.58);
  text-align: left;
  cursor: pointer;
  animation: option-rise 360ms calc(50ms + var(--option-index, 0) * 42ms) both;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .answer-option:hover:not(:disabled) {
    border-color: var(--green);
    transform: translateX(3px);
  }
}

.answer-option.is-selected {
  border-color: var(--terracotta);
  background: rgba(191, 96, 65, 0.12);
  transform: translateX(5px);
}

.answer-option:disabled {
  opacity: 0.82;
}

.answer-option.is-selected:disabled {
  opacity: 1;
}

.option-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid var(--green);
  border-radius: 50%;
}

.is-selected .option-mark {
  border: 5px solid var(--terracotta);
}

.followup-panel {
  padding-top: clamp(2rem, 5vh, 3.4rem);
}

.followup-panel h1 {
  margin-bottom: 1.6rem;
  font-size: clamp(1.45rem, 6vw, 2rem);
}

.followup-list {
  margin-top: 0;
}

.activity-option {
  min-height: 78px;
  align-items: flex-start;
}

/* Values */
.values-panel {
  padding: 2.15rem 0 1rem;
}

.values-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.selection-count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--green-dark);
  font-size: 0.8rem;
}

.selection-count strong {
  color: var(--terracotta-dark);
  font-size: 1rem;
}

.values-panel h1 {
  margin-bottom: 1.65rem;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.value-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 128px;
  flex-direction: column;
  align-items: flex-start;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0.85rem;
  background: rgba(251, 245, 232, 0.36);
  text-align: left;
  cursor: pointer;
  animation: option-rise 360ms calc(40ms + var(--option-index) * 35ms) both;
  transition: background-color 150ms ease, color 150ms ease;
}

.value-option strong {
  margin: 0.4rem 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.value-option > span:last-child {
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.55;
}

.value-option.is-selected {
  color: var(--paper-light);
  background: var(--green);
}

.value-option.is-selected > span:last-child {
  color: rgba(251, 245, 232, 0.78);
}

.value-check {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid rgba(53, 94, 75, 0.38);
  border-radius: 50%;
  font-size: 0.72rem;
}

.is-selected .value-check {
  border-color: var(--paper-light);
}

.inline-notice {
  min-height: 1.5rem;
  margin: 0.7rem 0;
  color: var(--terracotta-dark);
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0;
  text-align: center;
}

.inline-notice.is-visible {
  opacity: 1;
}

.generate-button {
  width: 100%;
}

.sheet-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(17, 29, 24, 0.55);
  backdrop-filter: blur(3px);
  animation: fade-in 180ms ease both;
}

.confirmation-sheet {
  width: min(100%, 520px);
  border-radius: 18px 18px 0 0;
  padding: 0.75rem 1.4rem max(1.4rem, env(safe-area-inset-bottom));
  background: var(--paper-light);
  box-shadow: 0 -14px 50px rgba(16, 29, 23, 0.28);
  animation: sheet-up 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sheet-handle {
  display: block;
  width: 42px;
  height: 4px;
  margin: 0 auto 1.25rem;
  border-radius: 2px;
  background: var(--paper-deep);
}

.confirmation-sheet h2 {
  margin: 0.5rem 0 0.65rem;
  font-size: 1.55rem;
}

.confirmation-sheet > p:not(.kicker) {
  margin: 0 0 1.4rem;
  color: var(--ink-soft);
}

.sheet-actions {
  display: grid;
  gap: 0.7rem;
}

.text-button {
  min-height: 48px;
  border: 0;
  color: var(--green-dark);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

/* Loading */
.loading-view {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.loading-view h1 {
  margin: 0.7rem 0;
  font-size: clamp(2rem, 8.2vw, 2.85rem);
}

.loading-view > p:last-child {
  max-width: 20em;
  margin: 0;
  color: var(--ink-soft);
}

.unfolding-map {
  position: relative;
  display: flex;
  width: 238px;
  height: 150px;
  align-items: stretch;
  justify-content: center;
  margin-bottom: 2.8rem;
  perspective: 700px;
  filter: drop-shadow(0 14px 15px rgba(31, 50, 40, 0.16));
}

.map-fold {
  position: relative;
  width: 33.333%;
  border: 1px solid rgba(53, 94, 75, 0.32);
  background:
    repeating-radial-gradient(ellipse at 20% 20%, transparent 0 12px, rgba(53, 94, 75, 0.09) 13px 14px),
    var(--paper-light);
  transform-origin: center;
}

.map-fold-left {
  transform-origin: right center;
  animation: unfold-left 1.25s cubic-bezier(0.22, 1, 0.36, 1) infinite alternate;
}

.map-fold-center {
  z-index: 2;
}

.map-fold-right {
  transform-origin: left center;
  animation: unfold-right 1.25s cubic-bezier(0.22, 1, 0.36, 1) infinite alternate;
}

.route-line {
  position: absolute;
  width: 104px;
  height: 2px;
  top: 78px;
  left: -12px;
  background: var(--terracotta);
  transform: rotate(-28deg);
  transform-origin: left;
}

.route-point {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid var(--terracotta);
  border-radius: 50%;
  background: var(--paper-light);
}

.route-point-one {
  top: 95px;
  left: 12px;
}

.route-point-two {
  top: 55px;
  right: 8px;
}

.loading-compass {
  position: absolute;
  z-index: 4;
  display: grid;
  width: 48px;
  height: 48px;
  right: 17px;
  bottom: -18px;
  place-items: center;
  border: 2px solid var(--green-dark);
  border-radius: 50%;
  background: var(--paper-light);
}

.loading-compass i {
  display: block;
  width: 12px;
  height: 34px;
  background: linear-gradient(var(--terracotta) 0 50%, var(--green-dark) 50%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: compass-search 1.4s ease-in-out infinite;
}

/* Results */
.result-page {
  overflow: hidden;
}

.result-hero {
  position: relative;
  min-height: 300px;
  padding: max(4rem, env(safe-area-inset-top)) 1.5rem 3rem;
  color: var(--paper-light);
  background:
    radial-gradient(circle at 80% 20%, rgba(242, 232, 211, 0.12) 0 2px, transparent 3px),
    repeating-radial-gradient(ellipse at 90% 10%, transparent 0 22px, rgba(242, 232, 211, 0.06) 23px 24px),
    var(--green-dark);
}

.result-history {
  position: sticky;
  z-index: 8;
  top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: max(0.65rem, env(safe-area-inset-top)) 1rem 0.65rem;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 245, 232, 0.94);
  backdrop-filter: blur(12px);
}

.result-history button {
  min-height: 42px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  background: transparent;
  font-weight: 700;
}

.result-history button.is-active {
  color: var(--paper-light);
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.result-hero::after {
  position: absolute;
  width: 180px;
  height: 80px;
  right: -45px;
  bottom: 28px;
  border: 1px dashed rgba(242, 232, 211, 0.3);
  border-radius: 50%;
  content: "";
  transform: rotate(-18deg);
}

.result-hero .kicker {
  color: #e2a380;
}

.result-hero h1 {
  max-width: 6em;
  margin: 1.8rem 0 0.8rem;
  font-size: clamp(2.55rem, 11vw, 3.8rem);
  letter-spacing: -0.065em;
}

.result-hero > p:not(.kicker) {
  max-width: 16rem;
  margin: 0;
  color: rgba(251, 245, 232, 0.7);
}

.result-stamp {
  position: absolute;
  right: 1.5rem;
  bottom: 2.4rem;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 2px solid #d88963;
  border-radius: 50%;
  color: #d88963;
  font-family: var(--serif);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  transform: rotate(11deg);
}

.result-route {
  position: relative;
  padding: 0 1.2rem 4rem;
}

.result-section {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 0.85rem;
  min-width: 0;
  padding: 3.5rem 0 0;
}

.route-spine {
  position: relative;
  display: flex;
  justify-content: center;
}

.route-spine::after {
  position: absolute;
  width: 1px;
  top: 31px;
  bottom: -3.5rem;
  border-left: 1px dashed rgba(53, 94, 75, 0.4);
  content: "";
}

.route-spine span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--green);
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--green);
  font-size: 0.65rem;
  font-weight: 800;
}

.section-content {
  min-width: 0;
}

.section-content > h2 {
  margin: 0.2rem 0 1.6rem;
  font-size: clamp(1.55rem, 5.8vw, 2rem);
  letter-spacing: -0.04em;
}

.section-category {
  display: inline-flex;
  margin: 0.5rem 0 0;
  border-bottom: 2px solid rgba(191, 96, 65, 0.55);
  padding-bottom: 0.18rem;
  color: var(--terracotta-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.map-wrap {
  width: 100%;
  min-width: 0;
  margin-left: -0.3rem;
}

.direction-map {
  display: block;
  width: 100%;
  max-width: 390px;
  height: auto;
  overflow: visible;
}

.contour {
  fill: none;
  stroke: rgba(53, 94, 75, 0.15);
  stroke-dasharray: 3 6;
}

.contour-outer {
  stroke: rgba(53, 94, 75, 0.3);
}

.route-axis {
  stroke: rgba(53, 94, 75, 0.42);
  stroke-width: 1.2;
}

.interest-profile {
  fill: rgba(191, 96, 65, 0.1);
  stroke: var(--terracotta);
  stroke-width: 1.5;
  stroke-linejoin: round;
  pointer-events: none;
}

.interest-point {
  fill: var(--terracotta);
  stroke: var(--paper-light);
  stroke-width: 3;
  filter: drop-shadow(0 2px 2px rgba(67, 43, 30, 0.25));
}

.evidence-tick {
  fill: rgba(53, 94, 75, 0.16);
}

.evidence-tick.is-active {
  fill: var(--green-dark);
}

.route-label {
  fill: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
}

.map-center {
  fill: var(--green-dark);
  stroke: var(--paper-light);
  stroke-width: 4;
}

.compass-pointer {
  filter: drop-shadow(0 3px 3px rgba(67, 43, 30, 0.22));
}

.compass-pointer-tip {
  fill: var(--terracotta-dark);
}

.compass-pointer-weight {
  fill: rgba(48, 55, 47, 0.42);
}

.compass-pointer.is-secondary {
  opacity: 0.82;
}

.map-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.42rem;
  width: max-content;
  max-width: 100%;
  margin: 0.7rem auto 1.8rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.map-legend span {
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
}

.map-legend i {
  display: inline-block;
  flex: 0 0 auto;
}

.legend-interest {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--terracotta);
}

.legend-evidence {
  width: 22px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--green-dark) 0 3px, transparent 3px 6px);
}

.legend-pointer {
  width: 22px;
  height: 3px;
  border-radius: 99px;
  background: var(--terracotta-dark);
  box-shadow: 7px 0 0 -1px var(--terracotta-dark);
}

.map-guidance {
  display: grid;
  gap: 0.28rem;
  margin: -0.65rem 0 2rem;
  border-left: 3px solid var(--terracotta);
  padding: 0.75rem 0 0.75rem 0.9rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.65;
}

.map-guidance strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.96rem;
}

.portrait-block {
  position: relative;
  border-top: 1px solid var(--green);
  border-bottom: 1px solid var(--green);
  padding: 1.5rem 0;
}

.portrait-block::after {
  position: absolute;
  width: 38px;
  height: 38px;
  top: -20px;
  right: 0;
  border: 1px solid var(--terracotta);
  border-radius: 50%;
  content: "✦";
  color: var(--terracotta);
  background: var(--paper);
  font-size: 1rem;
  line-height: 36px;
  text-align: center;
}

.portrait-kicker {
  margin: 0 0 0.75rem;
}

.portrait-direction {
  margin: 0 0 0.25rem;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
}

.portrait-block h3 {
  max-width: 12em;
  margin: 0 0 0.8rem;
  font-size: clamp(1.45rem, 5.8vw, 2rem);
  letter-spacing: -0.035em;
}

.portrait-block > p:last-child {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.calling-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.calling-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0.9rem;
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
}

.calling-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.calling-rank {
  color: var(--terracotta);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.calling-list strong {
  font-family: var(--serif);
  font-size: 1.15rem;
}

.calling-list p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.tool-belt {
  display: grid;
  gap: 1.2rem;
}

.tool-item {
  position: relative;
  border-left: 4px solid var(--terracotta);
  padding: 0.25rem 0 0.25rem 1rem;
}

.tool-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.evidence-style-note {
  margin: 0.9rem 0 0;
  border-left: 3px solid var(--green-pale);
  padding: 0.75rem 0.9rem;
  color: var(--ink-soft);
  background: rgba(53, 94, 75, 0.045);
  font-size: 1rem;
  line-height: 1.65;
}

.evidence-panel .answer-list {
  margin-top: clamp(1.6rem, 4vh, 2.6rem);
}

.direction-card-list {
  display: grid;
  gap: 1rem;
}

.direction-card {
  border: 1px solid rgba(53, 94, 75, 0.26);
  padding: 1.15rem;
  background: rgba(251, 245, 232, 0.46);
  box-shadow: 5px 5px 0 rgba(53, 94, 75, 0.07);
}

.direction-card-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0.7rem;
}

.direction-card-heading > span {
  color: var(--terracotta);
  font-family: var(--serif);
  font-weight: 800;
}

.direction-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

.direction-signals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 1rem 0;
}

.direction-signals span {
  border-top: 2px solid var(--green-pale);
  padding-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.direction-signals small {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--ink-soft);
  font-size: 0.62rem;
}

.direction-card > p {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.direction-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.direction-card li {
  border: 1px solid rgba(191, 96, 65, 0.35);
  border-radius: 99px;
  padding: 0.35rem 0.65rem;
  color: var(--terracotta-dark);
  font-size: 0.72rem;
}

.career-result-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.trend-legend {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1.1rem;
  border-left: 3px solid var(--green-pale);
  padding: 0.15rem 0 0.15rem 0.8rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
  line-height: 1.5;
}

.reality-coordinate {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.6rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--green-dark) 28%, transparent);
  background: color-mix(in srgb, var(--paper) 84%, var(--green-pale) 16%);
}

.reality-coordinate p,
.reality-coordinate h3,
.reality-coordinate span { margin: 0; }

.reality-coordinate p {
  color: var(--terracotta-dark);
  font-weight: 700;
  letter-spacing: .08em;
}

.reality-coordinate h3 { margin: .25rem 0 .35rem; }

.reality-coordinate > div > span,
.reality-coordinate label > span {
  color: var(--ink-soft);
  line-height: 1.6;
}

.reality-coordinate label { display: grid; gap: .45rem; }

.reality-coordinate select {
  min-width: 0;
  width: 100%;
  min-height: 3rem;
  padding: 0 2.5rem 0 .9rem;
  border: 1px solid color-mix(in srgb, var(--green-dark) 35%, transparent);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
}

.career-distance {
  display: grid;
  gap: .18rem;
  margin-top: .75rem;
  padding: .65rem .75rem;
  border-left: 3px solid var(--green-pale);
  background: color-mix(in srgb, var(--paper) 70%, var(--green-pale) 30%);
  line-height: 1.5;
}

.career-distance b { color: var(--green-dark); }
.career-distance small { color: var(--terracotta-dark); font-size: .86em; }
.career-distance.is-far { border-left-color: var(--terracotta); }
.direction-reality-note { padding-left: .8rem; border-left: 3px solid var(--terracotta); }

@media (max-width: 640px) {
  .reality-coordinate { grid-template-columns: 1fr; gap: 1rem; padding: 1.1rem; }
  .reality-coordinate select { font-size: 16px; }
}

.trend-legend span {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.45rem;
}

.trend-legend b {
  color: var(--green-dark);
  white-space: nowrap;
}

.career-result-card {
  border: 1px solid rgba(53, 94, 75, 0.22);
  background: rgba(251, 245, 232, 0.66);
  transition: border-color 160ms ease, background 160ms ease;
}

.career-result-card[open] {
  border-color: rgba(191, 96, 65, 0.58);
  background: var(--paper-light);
}

.career-result-card summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
  padding: 1rem 2.6rem 1rem 1rem;
  cursor: pointer;
  list-style: none;
}

.career-result-card summary::-webkit-details-marker {
  display: none;
}

.career-result-card summary::after {
  position: absolute;
  top: 1rem;
  right: 1rem;
  grid-row: 1;
  color: var(--terracotta-dark);
  content: "+";
  font-size: 1rem;
  line-height: 1;
  transform: translateY(0.05rem);
}

.career-result-card[open] summary::after {
  content: "−";
}

.career-result-main {
  min-width: 0;
}

.career-result-main strong,
.career-result-main small,
.career-match-reason,
.career-trend-preview {
  display: block;
}

.career-result-main strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
}

.career-result-main small {
  margin-top: 0.25rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.55;
}

.career-match-reason {
  margin-top: 0.75rem;
  border-left: 3px solid var(--green-pale);
  padding-left: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.65;
}

.career-trend-preview {
  margin-top: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.6;
}

.career-trend-preview b {
  margin-right: 0.45rem;
  color: var(--green-dark);
}

.career-result-meta {
  display: block;
}

.career-result-meta b {
  color: var(--terracotta-dark);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.career-score-note {
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.55;
}

.result-save-panel {
  padding: 1.5rem 1.25rem 3rem;
  text-align: center;
}

.save-result-button {
  width: 100%;
}

.result-save-panel p {
  margin: 0.75rem 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.restart-button {
  width: 100%;
  margin-top: 1.5rem;
}

.result-export-stage {
  position: fixed;
  top: 0;
  left: -2000px;
  width: 1080px;
  pointer-events: none;
}

.result-export-sheet {
  width: 1080px;
  min-height: 1080px;
  padding: 84px 88px 96px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.52), transparent 34%),
    linear-gradient(155deg, var(--paper-light), var(--paper) 52%, #eadcc2);
  font-family: var(--sans);
  font-size: 30px;
  line-height: 1.55;
}

.result-export-sheet * {
  animation: none !important;
  transition: none !important;
}

.export-hero {
  padding-bottom: 64px;
}

.export-hero > p,
.export-category {
  margin: 0 0 12px;
  color: var(--terracotta-dark);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.export-hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 78px;
  line-height: 1.12;
}

.export-map .map-wrap {
  width: 720px;
  margin: 0 auto 30px;
}

.result-export-sheet .direction-map {
  max-width: 720px;
}

.result-export-sheet .route-label {
  font-size: 14px;
}

.result-export-sheet .interest-point,
.result-export-sheet .compass-pointer {
  filter: none;
}

.result-export-sheet .map-legend,
.result-export-sheet .map-guidance {
  font-size: 30px;
}

.export-section {
  padding: 64px 0;
  border-top: 2px solid var(--line);
}

.export-section h2 {
  margin: 0 0 32px;
  font-family: var(--serif);
  font-size: 58px;
  line-height: 1.2;
}

.export-portrait,
.export-strengths article,
.export-directions article {
  padding: 32px 36px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.25);
}

.export-portrait strong,
.export-strengths strong,
.export-values strong,
.export-directions h3 {
  display: block;
  font-family: var(--serif);
  font-size: 38px;
}

.export-ranked-list,
.export-values {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.export-ranked-list li,
.export-values li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-top: 2px solid var(--line);
}

.export-ranked-list b,
.export-values > li > b,
.export-directions header > b {
  color: var(--terracotta-dark);
}

.export-strengths,
.export-directions {
  display: grid;
  gap: 24px;
}

.export-strengths p,
.export-values p,
.export-directions p,
.export-directions li,
.export-strengths small {
  font-size: 30px;
}

.export-directions header {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
}

.export-directions h3 {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.export-directions ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 20px 0 0;
  padding-left: 30px;
}

.result-export-sheet footer {
  padding-top: 64px;
  border-top: 2px solid var(--line);
  color: var(--ink-soft);
  font-size: 30px;
  text-align: center;
}

.career-detail-grid {
  display: grid;
  gap: 0;
  border-top: 1px dashed rgba(53, 94, 75, 0.22);
  padding: 0.2rem 0.9rem 0.75rem;
}

.career-detail-grid section {
  padding: 0.75rem 0 0.65rem;
}

.career-detail-grid section + section {
  border-top: 1px solid rgba(53, 94, 75, 0.1);
}

.career-detail-grid h4 {
  margin: 0 0 0.3rem;
  color: var(--terracotta-dark);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
}

.career-detail-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.65;
}

.tool-item p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.83rem;
}

.tool-item .evidence-line {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.evidence-line strong {
  color: var(--green-dark);
  font-size: 0.72rem;
}

.empty-evidence {
  margin: 0;
  border: 1px dashed var(--green);
  padding: 1.1rem;
  color: var(--ink-soft);
  background: rgba(53, 94, 75, 0.055);
  font-size: 0.88rem;
}

.value-landmarks {
  position: relative;
  display: grid;
  gap: 0.9rem;
  margin: 0 0 1rem;
  padding: 0 0 0 0.15rem;
  list-style: none;
}

.value-landmarks::before {
  position: absolute;
  width: 2px;
  top: 1rem;
  bottom: 1rem;
  left: 17px;
  content: "";
  background: repeating-linear-gradient(to bottom, var(--green) 0 5px, transparent 5px 10px);
  opacity: 0.45;
}

.value-landmark {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
}

.landmark-pin {
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--paper-light);
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--green-dark);
  box-shadow: 0 0 0 1px var(--green-dark);
  font-size: 0.62rem;
  font-weight: 800;
}

.landmark-sign {
  position: relative;
  border: 1px solid rgba(191, 96, 65, 0.55);
  padding: 0.8rem 0.9rem 0.85rem 1rem;
  background: linear-gradient(100deg, rgba(191, 96, 65, 0.1), rgba(251, 245, 232, 0.72));
  box-shadow: 3px 3px 0 rgba(53, 94, 75, 0.08);
}

.landmark-sign::before {
  position: absolute;
  top: 50%;
  left: -7px;
  width: 12px;
  height: 12px;
  border-bottom: 1px solid rgba(191, 96, 65, 0.55);
  border-left: 1px solid rgba(191, 96, 65, 0.55);
  content: "";
  background: #f5ead7;
  transform: translateY(-50%) rotate(45deg);
}

.landmark-sign > span {
  color: var(--terracotta-dark);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.landmark-sign strong {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--serif);
  font-size: 1.12rem;
}

.landmark-sign p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.5;
}

.value-statement {
  position: relative;
  margin: 0;
  border: 0;
  padding: 1.4rem 0 1.4rem 1.25rem;
  color: var(--green-dark);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 5.1vw, 1.65rem);
  font-weight: 700;
  line-height: 1.7;
}

.value-statement::before {
  position: absolute;
  width: 4px;
  top: 1.6rem;
  bottom: 1.6rem;
  left: 0;
  background: var(--terracotta);
  content: "";
}

.closing-note {
  margin: 2.2rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.values-result-section .route-spine::after {
  display: none;
}

@keyframes page-arrival {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes option-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes needle-find {
  from { opacity: 0; transform: rotate(-145deg) scale(0.7); }
  to { opacity: 1; transform: rotate(18deg) scale(1); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes unfold-left {
  from { transform: rotateY(75deg); }
  to { transform: rotateY(-9deg); }
}

@keyframes unfold-right {
  from { transform: rotateY(-75deg); }
  to { transform: rotateY(9deg); }
}

@keyframes compass-search {
  0%, 100% { transform: rotate(-22deg); }
  50% { transform: rotate(28deg); }
}

@media (min-width: 521px) {
  body {
    padding-block: 24px;
  }

  #app,
  .app-page {
    min-height: calc(100vh - 48px);
  }

  #app {
    border-radius: 4px;
  }
}

@media (max-width: 374px) {
  .welcome,
  .assessment-shell,
  .values-shell {
    padding-inline: 1rem;
  }

  .welcome-compass {
    width: 96px;
    height: 96px;
    margin-bottom: 1.3rem;
    transform: scale(0.86) rotate(8deg);
    transform-origin: right bottom;
  }

  .welcome h1 {
    font-size: 2.35rem;
  }

  .welcome-lede {
    font-size: 0.94rem;
  }

  .value-option {
    min-height: 122px;
    padding: 0.85rem 0.7rem;
  }

  .result-route {
    padding-inline: 0.85rem;
  }

  .result-section {
    grid-template-columns: 31px minmax(0, 1fr);
    gap: 0.6rem;
  }

  .route-spine span {
    width: 27px;
    height: 27px;
  }

  .route-label {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
