:root {
  --bg: #fffdfd;
  --surface: #ffffff;
  --surface-muted: #f8f5f4;
  --text: #24201f;
  --muted: #6d6462;
  --border: #e8ddda;
  --accent: #b91c1c;
  --accent-strong: #991b1b;
  --accent-soft: #fff1f1;
  --warning: #9a5b00;
  --success: #177245;
  --shadow: 0 18px 42px rgba(88, 27, 27, 0.08);
  --max: 1180px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 253, 253, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.site-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.decision-surface {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 46px;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(520px, 1.18fr);
  gap: 28px;
  align-items: start;
}

.decision-copy {
  padding: 12px 0;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 620px;
}

.trust-strip {
  margin-top: 28px;
  display: grid;
  gap: 10px;
  max-width: 520px;
}

.trust-strip span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.trust-strip strong {
  color: var(--text);
  font-weight: 600;
}

.tool-panel,
.result-panel,
.module-card,
.guide-card,
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.tool-panel {
  padding: 22px;
  box-shadow: var(--shadow);
}

.tool-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.tool-head h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.status-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
}

.status-pill.is-high {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.status-pill.is-medium {
  color: var(--warning);
  background: #fff8e8;
  border-color: #ecd6a9;
}

.status-pill.is-low {
  color: var(--success);
  background: #edf9f2;
  border-color: #caead7;
}

.control-group {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.control-group legend {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.segmented,
.option-grid,
.check-grid {
  display: grid;
  gap: 8px;
}

.segmented {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented button,
.option-grid button {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.segmented button:hover,
.option-grid button:hover,
.segmented button:focus-visible,
.option-grid button:focus-visible {
  border-color: #d8b9b4;
  outline: none;
}

.segmented button.is-active,
.option-grid button.is-active {
  color: var(--accent);
  border-color: #e3a3a3;
  background: var(--accent-soft);
  font-weight: 600;
}

.check-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-grid label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
}

.check-grid input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.result-panel {
  margin-top: 20px;
  padding: 18px;
  background: #fffafa;
}

.result-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.result-title h3 {
  margin-bottom: 4px;
}

.result-summary {
  margin-bottom: 16px;
  color: var(--muted);
}

.result-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mini-list {
  margin: 0;
  padding-left: 18px;
}

.mini-list li + li {
  margin-top: 5px;
}

.result-block {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.result-block h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.result-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-link,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 600;
}

.button-link {
  padding: 9px 14px;
  color: #fff;
  background: var(--accent);
}

.button-link.secondary {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #e7b6b6;
}

.button-link:hover,
.button-link:focus-visible {
  background: var(--accent-strong);
  outline: none;
}

.button-link:disabled {
  cursor: progress;
  opacity: 0.62;
}

.button-link.secondary:hover,
.button-link.secondary:focus-visible {
  color: #fff;
  background: var(--accent);
}

.text-link {
  color: var(--accent);
}

.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.medical-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.copy-status {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--success);
  font-size: 13px;
}

.section-band {
  padding: 70px 0;
  border-top: 1px solid var(--border);
}

.section-band.muted {
  background: var(--surface-muted);
}

.section-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 34px;
  align-items: center;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 26px;
}

.section-heading p,
.two-column p {
  color: var(--muted);
}

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

.triad-item {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.triad-item span {
  font-size: 26px;
  font-weight: 600;
}

.triad-item small {
  color: var(--muted);
  font-size: 13px;
}

.module-grid,
.guide-grid {
  display: grid;
  gap: 12px;
}

.module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-card,
.guide-card {
  padding: 18px;
}

.module-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.score-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.score-line strong {
  color: var(--accent);
  font-size: 22px;
  font-weight: 600;
}

.module-card p,
.guide-card p {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.guide-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-card .text-link {
  margin-top: auto;
  justify-content: flex-start;
}

.source-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.source-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.source-table th,
.source-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.source-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: #fffafa;
}

.source-table tr:last-child td {
  border-bottom: 0;
}

.source-table a {
  color: var(--accent);
  font-weight: 600;
}

.table-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.detail-hero {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 34px;
}

.detail-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.detail-layout {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto 70px;
  display: grid;
  gap: 14px;
}

.detail-panel {
  padding: 22px;
}

.detail-panel p,
.detail-panel li {
  color: var(--muted);
}

.source-list {
  margin: 0;
  padding-left: 18px;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner p:first-child {
  color: var(--text);
  font-weight: 600;
}

.footer-inner nav {
  display: flex;
  gap: 14px;
}

.footer-inner a {
  color: var(--accent);
}

@media (max-width: 980px) {
  .decision-surface,
  .two-column {
    grid-template-columns: 1fr;
  }

  .module-grid,
  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
    gap: 8px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .site-nav a {
    padding: 7px 9px;
  }

  .decision-surface {
    padding-top: 34px;
  }

  h1 {
    font-size: 36px;
  }

  .tool-panel {
    padding: 16px;
  }

  .tool-head,
  .result-title {
    flex-direction: column;
  }

  .option-grid,
  .check-grid,
  .result-columns,
  .module-grid,
  .guide-grid,
  .triad-visual {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-band {
    padding: 50px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
