:root {
  --bg: #fffaf7;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --ink: #251f24;
  --muted: #6f6269;
  --brand: #be123c;
  --brand-dark: #881337;
  --brand-soft: #fff1f2;
  --accent: #7c3aed;
  --accent-soft: #f5f3ff;
  --line: #f3d9dc;
  --shadow: 0 22px 60px rgba(136, 19, 55, 0.12);
  --radius: 24px;
  --radius-sm: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(251, 113, 133, 0.22), transparent 38rem),
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.18), transparent 36rem),
    var(--bg);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a.button {
  cursor: pointer;
  text-decoration: none;
}

.top-nav {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(190, 18, 60, 0.24);
}

.top-nav__links {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.top-nav__links a {
  text-decoration: none;
}

.hero {
  padding-bottom: 36px;
}

.page-header {
  padding-bottom: 16px;
}

.hero__inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 32px;
  align-items: center;
  padding: 48px 0 24px;
}

.hero__copy h1 {
  margin: 0;
  font-size: clamp(1.25rem, 6.2cqw, 3.9rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero__copy {
  container-type: inline-size;
}

.hero__copy h1 span {
  display: block;
  white-space: nowrap;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.8;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__actions,
.form-actions,
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.button--primary {
  background: linear-gradient(135deg, var(--brand), #fb7185);
  color: white;
  box-shadow: 0 14px 30px rgba(190, 18, 60, 0.22);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
  color: var(--brand-dark);
}

.hero-card,
.form-panel,
.side-note,
.result-section,
.feature-grid article,
.soft-card,
.profile-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  border-radius: 34px;
  padding: 32px;
  transform: rotate(1.2deg);
}

.hero-card__label {
  display: inline-flex;
  margin: 0 0 16px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-card h2 {
  margin: 0 0 12px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.hero-card p,
.hero-card li,
.feature-grid p,
.side-note p,
.side-note li,
.muted,
.mini-note {
  color: var(--muted);
  line-height: 1.75;
}

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

.section--narrow {
  width: min(960px, calc(100% - 32px));
}

.section h2 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.06em;
}

.policy-page h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.06em;
}

.policy-panel {
  display: grid;
  gap: 28px;
  margin-top: 32px;
  border-radius: 34px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 32px;
}

.policy-panel section {
  display: grid;
  gap: 8px;
}

.policy-panel h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  letter-spacing: -0.04em;
}

.policy-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.policy-updated {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}

.feature-grid,
.people-cards,
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-grid article,
.profile-card,
.soft-card {
  border-radius: var(--radius);
  padding: 24px;
}

.feature-icon {
  display: inline-grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 18px;
  background: var(--brand-soft);
  font-size: 1.6rem;
}

.diagnosis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.form-panel,
.side-note,
.result-section {
  border-radius: 34px;
  padding: 28px;
}

.side-note {
  position: sticky;
  top: 16px;
}

.diagnosis-form {
  display: grid;
  gap: 22px;
}

fieldset {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

legend {
  padding: 0 8px;
  color: var(--brand-dark);
  font-weight: 800;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.field-grid__wide {
  grid-column: span 3;
}

label {
  display: grid;
  gap: 8px;
  color: #4b2934;
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 1px solid #ecd0d5;
  border-radius: 16px;
  background: #fff;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: #fb7185;
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.18);
}

.error-box {
  border: 1px solid #fecdd3;
  border-radius: 18px;
  background: #fff1f2;
  color: #881337;
  padding: 16px;
}

.error-box ul {
  margin-bottom: 0;
}

.loading {
  color: var(--brand-dark);
  font-weight: 800;
}

.result-section {
  margin-bottom: 64px;
}

.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: center;
  padding: 12px 0 28px;
}

.result-hero h2 {
  color: var(--brand-dark);
}

.score-badge {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff1f2, #f5f3ff);
  border: 1px solid var(--line);
  text-align: center;
}

.score-badge span {
  color: var(--brand);
  font-size: 4.4rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.score-badge small {
  color: var(--brand-dark);
  font-weight: 900;
}

.score-badge p {
  width: 80%;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.score-bars {
  display: grid;
  gap: 14px;
  margin: 4px 0 34px;
}

.score-row__label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: var(--brand-dark);
  font-weight: 800;
}

.score-row__bar {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #fee2e2;
}

.score-row__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #a78bfa);
}

.result-block {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.result-block h2 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.profile-card__header h3,
.soft-card h3 {
  margin: 0 0 12px;
  color: var(--brand-dark);
}

.profile-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.profile-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed #eed3d8;
  padding-bottom: 8px;
}

.profile-grid dt {
  color: var(--muted);
}

.profile-grid dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 14px 14px 42px;
  color: var(--muted);
  line-height: 1.65;
}

.check-list li::before {
  content: '✓';
  position: absolute;
  top: 14px;
  left: 16px;
  color: var(--brand);
  font-weight: 900;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.pill-list span {
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 7px 10px;
  font-size: 0.88rem;
  font-weight: 800;
}

.soft-card ul {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.share-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: center;
}

.share-text {
  border-left: 4px solid var(--brand);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0 16px 16px 0;
  padding: 16px;
  color: var(--muted);
  line-height: 1.8;
}

.share-card-canvas {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.notes-block {
  color: var(--muted);
  line-height: 1.8;
}

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .top-nav {
    align-items: flex-start;
  }

  .top-nav__links {
    display: none;
  }

  .hero__inner,
  .diagnosis-layout,
  .result-hero,
  .share-block {
    grid-template-columns: 1fr;
  }

  .hero-card {
    transform: none;
  }

  .side-note {
    position: static;
  }

  .feature-grid,
  .people-cards,
  .card-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .field-grid__wide {
    grid-column: auto;
  }

  .score-badge {
    width: 220px;
    justify-self: center;
  }
}

@media (max-width: 560px) {
  .section,
  .section--narrow,
  .top-nav,
  .hero__inner,
  .footer {
    width: min(100% - 20px, 1120px);
  }

  .form-panel,
  .side-note,
  .result-section,
  .hero-card {
    border-radius: 24px;
    padding: 20px;
  }

  fieldset {
    padding: 16px;
  }

  .button {
    width: 100%;
  }
}
