:root {
  --font-sans: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --base: #f4f8fb;
  --surface: #ffffff;
  --ink: #132238;
  --muted: #4b6682;
  --primary: #2176d2;
  --primary-dark: #175da8;
  --soft: #e8f2fb;
  --line: #d7e5f0;
  --success: #167966;
  --container: 1120px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--base);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  word-break: normal;
  line-break: strict;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--primary-dark); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; }
.brand img { width: 136px; }
.brand span { color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; text-decoration: none; }
.nav-cta { padding: 8px 20px; color: #ffffff !important; background: var(--primary); border-radius: 8px; }

.page-hero {
  padding: 88px 0 80px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  gap: 64px;
}

.eyebrow { margin: 0 0 16px; color: var(--primary-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.nowrap { white-space: nowrap; }
h1, h2, h3 { margin-top: 0; line-height: 1.35; letter-spacing: 0; }
h1 { max-width: 16em; margin-bottom: 24px; font-size: clamp(36px, 5vw, 56px); }
h2 { margin-bottom: 24px; font-size: clamp(28px, 3vw, 40px); }
h3 { margin-bottom: 12px; font-size: 24px; }
.lead { max-width: 44em; margin: 0; color: var(--muted); font-size: 20px; }
.hero-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: 1px solid var(--primary);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button-primary { color: #ffffff; background: var(--primary); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: var(--primary-dark); background: #ffffff; }
.button[disabled] { opacity: .45; cursor: not-allowed; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.microcopy { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.section { padding: 88px 0; border-bottom: 1px solid var(--line); }
.section-white { background: var(--surface); }
.section-dark { color: #ffffff; background: var(--ink); }
.section-dark .lead, .section-dark .microcopy { color: #d7e5f0; }
.section-intro { max-width: 760px; margin-bottom: 40px; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.card { padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.card p { margin: 0 0 20px; color: var(--muted); }
.card a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }
.meta { margin: 0 0 12px; color: var(--primary-dark); font-size: 14px; font-weight: 700; }

.article-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(240px, 1fr); gap: 64px; align-items: start; }
.article-body { padding: 72px 0 96px; }
.article-body h2 { margin-top: 64px; font-size: 32px; }
.article-body h3 { margin-top: 40px; }
.article-body p, .article-body li { color: #263f59; }
.article-body li + li { margin-top: 8px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; background: #ffffff; }
.article-body th, .article-body td { padding: 14px 16px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body th { background: var(--soft); }
.article-aside { position: sticky; top: 88px; margin-top: 72px; padding: 24px; border-left: 4px solid var(--primary); background: #ffffff; }
.article-aside h2 { font-size: 24px; }
.article-aside ul { padding-left: 20px; }
.breadcrumb { padding: 18px 0; color: var(--muted); font-size: 14px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

.diagnosis-shell { max-width: 840px; margin-inline: auto; }
.progress-wrap { margin-bottom: 32px; }
.progress-label { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.progress { height: 8px; overflow: hidden; border-radius: 8px; background: var(--line); }
.progress span { display: block; width: 14.285%; height: 100%; background: var(--primary); transition: width 180ms ease; }
.diagnosis-form { padding: 32px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; }
.question[hidden] { display: none; }
.question h2 { font-size: 28px; }
.question p { color: var(--muted); }
.field { margin-top: 24px; }
.field label, .field legend { font-weight: 700; }
.field input[type="text"], .field textarea {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #8fa8bf;
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}
.field textarea { min-height: 96px; resize: vertical; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.choice { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--soft); }
.choice input { width: 20px; height: 20px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }
.form-error { min-height: 28px; margin: 16px 0 0; color: #a12b24; font-weight: 700; }
.result { padding: 32px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; }
.result[hidden] { display: none; }
.result-type { color: var(--success); font-size: 32px; font-weight: 700; }
.result-summary { padding: 24px; border-left: 4px solid var(--success); background: var(--soft); }
.result-list { padding-left: 24px; }
.result .button { width: 100%; }
.result-actions { display: grid; gap: 12px; margin-top: 28px; }

.footer { padding: 56px 0; color: #ffffff; background: var(--ink); }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; }
.footer a { color: #ffffff; }

@media (max-width: 900px) {
  .hero-grid, .article-layout { grid-template-columns: 1fr; }
  .hero-grid { gap: 40px; }
  .article-aside { position: static; margin: 0 0 72px; }
  .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 32px, var(--container)); }
  .nav-links a:not(.nav-cta) { display: none; }
  .page-hero { padding: 64px 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  h1 { font-size: 32px; }
  .lead { font-size: 18px; }
  .diagnosis-form, .result { padding: 24px 18px; }
  .choice-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .article-body table, .article-body thead, .article-body tbody, .article-body tr, .article-body th, .article-body td { display: block; }
  .article-body thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .article-body tr { margin-bottom: 16px; border: 1px solid var(--line); }
  .article-body td { border: 0; border-bottom: 1px solid var(--line); }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
