:root {
  color-scheme: light;
  --ink: #173043;
  --muted: #526b78;
  --muted-strong: #3c5868;
  --surface: #ffffff;
  --surface-soft: #f5faf9;
  --surface-blue: #f1f8fb;
  --surface-mint: #eef8f5;
  --surface-apricot: #fff6ea;
  --line: #cbdde0;
  --line-strong: #a7c4ca;
  --brand: #147a7e;
  --brand-strong: #0d6267;
  --brand-soft: #dff2ef;
  --focus: #e89b4c;
  --recommended: #16755d;
  --recommended-soft: #e5f5ed;
  --needs: #99601d;
  --needs-soft: #fff1d9;
  --using: #326bb2;
  --using-soft: #e8f0fb;
  --deferred: #5f6d75;
  --deferred-soft: #edf1f2;
  --danger: #a34a48;
  --radius: 8px;
  --shadow: 0 10px 28px rgba(39, 78, 91, 0.07);
  font-family: "BIZ UDPGothic", "BIZ UDPゴシック", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.75;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--brand-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  top: 0;
}

.site-header {
  min-height: 78px;
  padding: 12px max(20px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #a4cfca;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.3;
}

.test-label {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border: 1px solid #a4cfca;
  border-radius: 4px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  vertical-align: 2px;
}

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

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--surface-blue);
  color: var(--brand-strong);
}

main {
  outline: none;
}

.start-view,
.screen,
.info-section {
  width: min(1180px, calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.start-view {
  min-height: calc(100vh - 78px);
  padding: 68px 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.72fr);
  gap: 56px;
  align-items: center;
}

.start-copy {
  padding: 8px 0 12px;
}

.screen {
  display: none;
  padding: 56px 0 88px;
}

.screen.active {
  display: block;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 700;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  font-size: 52px;
  line-height: 1.33;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 14px;
  font-size: 34px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

h3 {
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1.48;
}

h4 {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.5;
}

.lead {
  max-width: 720px;
  color: var(--muted-strong);
  font-size: 21px;
}

.plain-list {
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  position: relative;
  padding: 8px 0 8px 31px;
}

.plain-list li::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 3px;
  width: 13px;
  height: 7px;
  border-bottom: 2px solid var(--recommended);
  border-left: 2px solid var(--recommended);
  transform: rotate(-45deg);
}

.scope-note {
  max-width: 720px;
  margin: 0 0 30px;
  padding: 17px 19px;
  border: 1px solid #efd5a8;
  border-left: 5px solid var(--focus);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-apricot);
}

.scope-note strong {
  display: block;
  margin-bottom: 4px;
}

.scope-note p,
.scope-caption {
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: 15px;
}

.test-caption {
  max-width: 720px;
  margin: -12px 0 28px;
  color: var(--muted);
  font-size: 15px;
}

.start-actions,
.result-actions,
.card-actions,
.dialog-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 54px;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-button {
  border: 2px solid var(--brand);
  background: var(--brand);
  color: white;
}

.primary-button:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  transform: translateY(-1px);
}

.secondary-button {
  border: 2px solid #9ec4c8;
  background: var(--surface);
  color: var(--brand-strong);
}

.secondary-button:hover {
  border-color: var(--brand);
  background: var(--surface-mint);
}

.danger-button {
  border: 2px solid var(--danger);
  background: var(--danger);
  color: white;
}

.text-button {
  padding: 8px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.text-button:hover {
  color: var(--brand);
}

.scope-card,
.related-panel,
.action-panel,
.detail-section,
.info-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.scope-card {
  padding: 28px;
  background: var(--surface-blue);
  border-top: 5px solid var(--brand);
  box-shadow: var(--shadow);
}

.scope-card h2 {
  font-size: 23px;
}

.scope-card dl {
  margin: 0;
}

.scope-card div {
  padding: 16px 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.scope-card div:last-child {
  border-bottom: 0;
}

.scope-card dt {
  color: var(--muted);
  font-size: 14px;
}

.scope-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.question-panel {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.progress-row p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.progress-track {
  height: 8px;
  margin: 14px 0 44px;
  overflow: hidden;
  border-radius: 4px;
  background: #dbeaed;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 160ms ease;
}

.question-help {
  margin-bottom: 28px;
  color: var(--muted-strong);
}

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

.answer-button {
  min-height: 64px;
  padding: 14px 18px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.answer-button:hover,
.answer-button.selected {
  border-color: var(--brand);
  background: var(--surface-mint);
}

.answer-button.selected {
  box-shadow: inset 4px 0 0 var(--brand);
}

.continue-button {
  margin-top: 14px;
}

.continue-button:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--deferred-soft);
  color: var(--muted);
}

.pause-button {
  display: block;
  margin: 24px auto 0;
}

.results-intro {
  margin-bottom: 30px;
}

.results-intro p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted-strong);
}

.summary-strip {
  margin: 26px 0 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-blue);
}

.summary-item {
  padding: 19px 20px;
  border-right: 1px solid var(--line);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item strong,
.summary-item span {
  display: block;
}

.summary-item strong {
  color: var(--ink);
  font-size: 27px;
}

.summary-item span {
  color: var(--muted);
  font-size: 14px;
}

.results-layout,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 36px;
}

.memo-panel {
  margin: 20px 0 56px;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 26px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-mint);
}

.memo-panel p {
  color: var(--muted-strong);
}

.memo-panel textarea {
  width: 100%;
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  resize: vertical;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.7;
}

.result-group {
  margin-bottom: 46px;
}

.result-group > p {
  color: var(--muted-strong);
}

.program-list {
  display: grid;
  gap: 18px;
}

.program-card {
  padding: 25px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.program-note,
.detail-status {
  border-left: 4px solid var(--needs);
  background: var(--surface-apricot);
  color: var(--muted-strong);
}

.program-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  font-size: 15px;
}

.detail-status {
  margin-bottom: 20px;
  padding: 18px 20px;
}

.detail-status p {
  margin: 4px 0 0;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
}

.status-badge.recommended {
  color: var(--recommended);
  background: var(--recommended-soft);
}

.status-badge.needs_information {
  color: var(--needs);
  background: var(--needs-soft);
}

.status-badge.using {
  color: var(--using);
  background: var(--using-soft);
}

.status-badge.deferred {
  color: var(--deferred);
  background: var(--deferred-soft);
}

.program-category,
.program-purpose {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.reason-box {
  margin: 19px 0;
  padding: 14px 16px;
  border-left: 3px solid #a7cfd0;
  background: var(--surface-blue);
}

.reason-box strong {
  font-size: 14px;
}

.reason-box p {
  margin-bottom: 0;
}

.related-panel {
  align-self: start;
  position: sticky;
  top: 20px;
  padding: 25px;
  border-top: 5px solid var(--brand);
  background: var(--surface-blue);
}

.relation-item {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.relation-item:first-child {
  border-top: 0;
}

.relation-item strong,
.relation-item span {
  display: block;
}

.relation-item span {
  margin-top: 6px;
  color: var(--muted-strong);
  font-size: 15px;
}

.detail-header {
  margin-bottom: 26px;
}

#detail-description {
  max-width: 780px;
  color: var(--muted-strong);
}

.detail-section,
.action-panel {
  margin-bottom: 20px;
  padding: 25px;
  background: var(--surface);
}

.detail-section ul,
.action-panel ol {
  padding-left: 24px;
}

.action-panel {
  align-self: start;
  border-top: 5px solid var(--brand);
  background: var(--surface-mint);
}

.info-section {
  padding: 60px 0;
}

.info-section:nth-of-type(even) {
  width: 100%;
  padding-right: max(20px, calc((100% - 1180px) / 2));
  padding-left: max(20px, calc((100% - 1180px) / 2));
  background: var(--surface-blue);
}

.site-footer {
  padding: 34px max(20px, calc((100vw - 1180px) / 2));
  border-top: 1px solid #164f57;
  background: #1d5360;
  color: white;
}

.site-footer p {
  max-width: 860px;
  margin-bottom: 8px;
}

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

.info-grid article {
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(39, 78, 91, 0.04);
}

.info-grid article h3 {
  color: var(--brand-strong);
}

.hidden {
  display: none !important;
}

dialog {
  width: min(520px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(23, 48, 67, 0.44);
}

dialog form {
  padding: 27px;
}

@media (max-width: 860px) {
  body {
    font-size: 17px;
  }

  .site-header {
    align-items: flex-start;
    padding: 10px 16px;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 2px;
  }

  .site-nav a {
    padding-right: 5px;
    padding-left: 5px;
  }

  .brand small {
    display: none;
  }

  .start-view,
  .results-layout,
  .detail-layout,
  .memo-panel,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .start-view,
  .screen,
  .info-section {
    width: min(100% - 32px, 680px);
  }

  .info-section:nth-of-type(even) {
    width: 100%;
    padding-right: 16px;
    padding-left: 16px;
  }

  .start-view {
    padding-top: 40px;
    gap: 34px;
  }

  h1 {
    font-size: 35px;
  }

  h2 {
    font-size: 30px;
  }

  h3 {
    font-size: 24px;
  }

  .lead {
    font-size: 18px;
  }

  .question-panel {
    padding: 24px 20px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .summary-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-item:last-child {
    border-bottom: 0;
  }

  .related-panel {
    position: static;
  }

  .memo-panel textarea {
    min-height: 320px;
  }

  .program-card,
  .detail-section,
  .action-panel {
    padding: 20px;
  }
}

@media print {
  .site-header,
  .start-view,
  #checker,
  #detail,
  .result-actions,
  .memo-panel,
  .card-actions,
  .info-section,
  .text-button {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  #results {
    display: block !important;
    width: 100%;
    padding: 0;
  }

  .summary-strip,
  .results-layout {
    display: block;
  }

  .program-card,
  .related-panel {
    break-inside: avoid;
    box-shadow: none;
  }
}

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