:root {
  --color-bg: #f1f0ec;
  --color-surface: #ffffff;
  --color-text: #161616;
  --color-muted: #66645f;
  --color-border: #d9d5cc;
  --color-soft: #ebe8e1;
  --color-dark: #111111;
  --shadow-card: 0 26px 80px rgba(17, 17, 17, 0.09);

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;

  --max-width: 760px;

  font-family:
    -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Yu Gothic", YuGothic,
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--color-text);

  background:
    radial-gradient(
      circle at top left,
      rgba(0, 0, 0, 0.055),
      transparent 34rem
    ),
    var(--color-bg);

  line-height: 1.75;
}

button,
a {
  font: inherit;
}

.sb-page {
  min-height: 100svh;
  padding: 28px 16px 40px;
}

.diagnosis {
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.diagnosis__header {
  padding: 18px 2px 30px;
  text-align: center;
}

.eyebrow,
.question__tag,
.result__label {
  margin: 0 0 12px;

  color: var(--color-muted);

  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 14px;

  font-size: clamp(1.35rem, 4.2vw, 2rem);

  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.05em;
}

.lead {
  max-width: 32rem;
  margin: 0 auto;

  color: var(--color-muted);

  font-size: 0.98rem;
}

.noscript-message {
  margin: 0 0 18px;
  padding: 14px 16px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);

  color: var(--color-muted);
  background: var(--color-surface);
}

.diagnosis__card {
  overflow: hidden;

  padding: 22px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);

  background: rgba(255, 255, 255, 0.98);

  box-shadow: var(--shadow-card);
}

.progress {
  margin-bottom: 28px;
}

.progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;

  gap: 16px;

  margin-bottom: 10px;

  color: var(--color-muted);

  font-size: 0.78rem;
  font-weight: 700;
}

#progress-phase {
  color: rgba(102, 100, 95, 0.72);

  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.progress__track {
  height: 8px;

  overflow: hidden;

  border-radius: 999px;

  background: var(--color-soft);
}

.progress__bar {
  display: block;

  width: 0;
  height: 100%;

  border-radius: inherit;

  background: var(--color-dark);

  transition: width 240ms ease;
}

.screen {
  display: none;
}

.screen--active {
  display: block;
}

.question__title,
.result__title {
  max-width: 660px;
  margin-bottom: 28px;

  font-size: clamp(1.2rem, 4vw, 1.9rem);
  line-height: 1.46;
  letter-spacing: -0.04em;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer-button {
  width: 100%;
  min-height: 64px;

  padding: 18px;

  border: 1px solid var(--color-border);
  border-radius: 18px;

  color: var(--color-text);
  background: var(--color-surface);

  font-weight: 700;
  line-height: 1.55;
  text-align: left;

  cursor: pointer;

  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
}

.answer-button:hover,
.answer-button:focus-visible {
  border-color: var(--color-dark);

  background: #fcfcfb;

  box-shadow: 0 10px 26px rgba(17, 17, 17, 0.07);

  outline: none;

  transform: translateY(-1px);
}

.analysis-screen {
  display: none;
  place-items: center;

  min-height: 320px;

  padding: 56px 16px 64px;

  color: var(--color-muted);

  text-align: center;
}

.analysis-screen.screen--active {
  display: grid;
}

.analysis-screen__label {
  margin-bottom: 10px;

  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.analysis-screen h2 {
  margin-bottom: 8px;

  color: var(--color-text);

  font-size: 1.55rem;
  letter-spacing: -0.04em;
}

.analysis-screen p:last-child {
  margin-bottom: 0;
}

.screen--fade-in {
  animation: quietFadeIn var(--tempo-duration, 320ms) ease both;
}

.diagnosis__card[data-tempo="early"] {
  --tempo-duration: 220ms;
}

.diagnosis__card[data-tempo="middle"] {
  --tempo-duration: 340ms;
}

.diagnosis__card[data-tempo="middle"] .question__title {
  margin-block: 10px 34px;
}

.diagnosis__card[data-tempo="final"] {
  --tempo-duration: 460ms;
}

.diagnosis__card[data-tempo="final"] .question__title {
  margin-block: 16px 38px;
}

.diagnosis__card[data-tempo="report"] {
  --tempo-duration: 380ms;
}

.result-proposal {
  padding-top: 4px;
}

.result-hero {
  margin-bottom: 22px;
  padding: 20px 18px;

  border: 1px solid rgba(217, 213, 204, 0.92);
  border-radius: var(--radius-lg);

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    #fbfaf7 100%
  );
}

.result__label {
  margin-bottom: 8px;
}

.result__sub-label {
  margin-bottom: 10px;

  color: var(--color-muted);

  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.result__title {
  margin-bottom: 18px;

  font-size: clamp(1.5rem, 7.5vw, 2.25rem);
  line-height: 1.34;
  letter-spacing: -0.045em;
}

.result__summary {
  display: grid;
  gap: 10px;

  padding-top: 14px;

  border-top: 1px solid rgba(217, 213, 204, 0.72);

  color: var(--color-muted);
  background: #fbfaf7;

  font-size: 0.92rem;
  line-height: 1.66;
}

.result__summary p {
  margin-bottom: 0;
}

.proposal-list {
  display: grid;
  gap: 14px;

  margin-bottom: 16px;
}

.proposal-section {
  padding: 16px;

  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);

  background: var(--color-surface);
}

.proposal-section--plain {
  padding: 14px;

  border: 1px solid rgba(217, 213, 204, 0.72);
  border-radius: var(--radius-lg);

  background: #ffffff;
}

.proposal-section--plain + .proposal-section--plain {
  padding-top: 16px;
}

.proposal-section--plain h3 {
  margin-bottom: 12px;
}

.proposal-section--plain .proposal-section__number {
  margin-bottom: 7px;
}

.proposal-section--flow {
  background: #fbfaf7;
}

.proposal-section--support {
  background: linear-gradient(180deg, #ffffff 0%, #f7f6f2 100%);
}

.proposal-section__number {
  display: inline-block;

  margin-bottom: 8px;

  color: var(--color-muted);

  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.proposal-section h3 {
  margin-bottom: 10px;

  font-size: 1rem;
  letter-spacing: -0.02em;
}

.proposal-section p,
.proposal-section li {
  color: var(--color-muted);

  font-size: 0.88rem;
  line-height: 1.64;
}

.proposal-section p {
  margin-bottom: 0;
}

.proposal-section p:last-child {
  margin-bottom: 0;
}

.proposal-section ul {
  display: grid;
  gap: 0;

  margin: 0;

  padding-left: 0;

  list-style: none;
}

.proposal-section li {
  position: relative;

  padding: 8px 0 8px 18px;

  border-top: 1px solid rgba(217, 213, 204, 0.58);
}

.proposal-section li::before {
  content: "";
  position: absolute;
  top: 1.14em;
  left: 2px;

  width: 6px;
  height: 6px;

  border-radius: 999px;

  background: #b7b0a3;
}

.proposal-section li:first-child {
  border-top: 0;
}

.psych-flow {
  display: grid;
  gap: 7px;

  margin: 0;
  padding: 0;

  list-style: none;
  counter-reset: psych-flow;
}

.psych-flow li {
  position: relative;

  counter-increment: psych-flow;

  padding: 10px 12px 10px 34px;

  border: 1px solid rgba(217, 213, 204, 0.68);
  border-radius: 12px;

  color: var(--color-text);
  background: rgba(255, 255, 255, 0.8);

  font-size: 0.88rem;
  line-height: 1.52;
}

.psych-flow li::before {
  content: counter(psych-flow, decimal-leading-zero);
  position: absolute;
  top: 10px;
  left: 11px;

  width: auto;
  height: auto;

  border-radius: 0;

  color: var(--color-muted);
  background: transparent;

  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.psych-flow li:not(:last-child)::after {
  content: "↓";
  position: absolute;
  left: 50%;
  bottom: -15px;

  color: rgba(102, 100, 95, 0.62);

  font-size: 0.74rem;
  line-height: 1;

  transform: translateX(-50%);
}

.next-focus {
  display: grid;
  gap: 10px;

  margin-top: 2px;
  padding: 16px;

  border: 1px solid rgba(217, 213, 204, 0.9);
  border-radius: var(--radius-lg);

  background: linear-gradient(180deg, #ffffff 0%, #f7f6f2 100%);
}

.next-focus p {
  margin-bottom: 0;
}

.next-focus__label {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.8);

  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.next-focus__list {
  display: grid;
  gap: 7px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.next-focus__list li {
  padding: 9px 11px;

  border: 1px solid rgba(217, 213, 204, 0.68);
  border-radius: 12px;

  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.72);

  font-size: 0.88rem;
  line-height: 1.52;
}

.next-focus__note {
  color: var(--color-muted);

  font-size: 0.8rem;
  line-height: 1.62;
}

.report-bridge {
  display: grid;
  gap: 10px;

  margin-top: 20px;
  padding: 18px 16px 16px;

  border-top: 1px solid rgba(217, 213, 204, 0.88);

  color: var(--color-muted);
}

.report-bridge p {
  margin-bottom: 0;
}

.report-bridge__label {
  color: var(--color-text);

  font-size: 0.98rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.report-bridge__lead {
  color: var(--color-text);

  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.68;
}

.report-bridge__note {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.62;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;

  margin-top: 14px;
}

.print-button,
.secondary-button {
  width: fit-content;
  min-height: auto;

  justify-self: start;

  padding: 2px 4px;

  border: 0;

  color: var(--color-muted);
  background: transparent;

  font: inherit;
  font-size: 0.8rem;
  text-decoration: none;

  cursor: pointer;
}

.print-button {
  margin-top: 0;
}

.print-button:hover,
.print-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
  color: var(--color-text);
  outline: none;
}

@media (min-width: 720px) {
  .sb-page {
    padding: 56px 24px;
  }

  .diagnosis__header {
    padding-bottom: 36px;
  }

  .lead {
    max-width: 620px;
    font-size: 1.05rem;
  }

  .diagnosis__card {
    padding: 38px;
  }

  .result-hero {
    padding: 26px;
  }

  .result__summary {
    font-size: 1rem;
  }

  .proposal-section {
    padding: 24px;
  }

  .proposal-section--plain {
    padding: 20px;
  }

  .next-focus {
    padding: 20px;
  }

  .report-bridge {
    padding: 22px 20px 18px;
  }
}

@keyframes quietFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media print {
  .diagnosis__header,
  .progress,
  .next-focus,
  .report-bridge,
  .result-actions {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  .sb-page {
    min-height: auto;
    padding: 0;
  }

  .diagnosis__card {
    border: 0;
    box-shadow: none;
  }
}
