:root {
  --color-text: #000000;
  --color-muted: #333333;
  --color-line: #d9e5e8;
  --color-bg: #ffffff;
  --color-soft: #f4f9fa;
  --color-soft-strong: #e9f4f5;
  --color-primary: #17809a;
  --color-primary-dark: #0e5f74;
  --color-accent: #e88635;
  --shadow: 0 14px 34px rgba(30, 76, 88, 0.12);
  --radius: 8px;
  --container: 1380px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: "BIZ UDPGothic", "BIZ UDGothic", "UD Digi Kyokasho NP-R", "UD Digi Kyokasho N-R", "Yu Gothic", "YuGothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.9;
}

a {
  color: var(--color-primary-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--color-soft-strong);
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.92em;
}

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

sup a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(-140%);
  padding: 8px 12px;
  color: #ffffff;
  background: var(--color-primary-dark);
  border-radius: 4px;
}

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

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

.site-header {
  border-top: 6px solid var(--color-primary);
  border-bottom: 1px solid var(--color-line);
  background: #ffffff;
}

.site-header__inner {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
  padding: 18px 0 14px;
}

.site-kicker {
  margin: 0 0 8px;
  color: var(--color-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.site-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-title {
  color: var(--color-text);
  font-size: clamp(1.35rem, 1.05rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

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

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 14px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-primary-dark);
  background: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover {
  border-color: var(--color-primary);
  background: var(--color-soft);
}

.page-hero {
  margin-bottom: 32px;
  padding: clamp(34px, 6vw, 72px) 0;
  border-bottom: 1px solid var(--color-line);
  background:
    linear-gradient(90deg, rgba(23, 128, 154, 0.12), rgba(255, 255, 255, 0) 56%),
    var(--color-soft);
}

.section-label {
  margin: 0 0 8px;
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2rem, 1.45rem + 2vw, 3rem);
  line-height: 1.35;
}

.lead {
  max-width: 850px;
  margin: 18px 0 0;
  color: var(--color-text);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.16rem);
  line-height: 2;
}

.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-main {
  flex: 1;
  display: block;
}

.home-hero {
  margin-bottom: 34px;
}

.home-lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--color-text);
  font-size: 1.08rem;
  line-height: 2;
  line-break: strict;
  overflow-wrap: normal;
  word-break: keep-all;
}

.home-toc-section {
  padding: 0 0 clamp(58px, 8vw, 96px);
}

.home-toc-section h2 {
  position: relative;
  margin: 0 0 26px;
  color: var(--color-primary-dark);
  font-size: clamp(1.55rem, 1.25rem + 0.8vw, 2.05rem);
  line-height: 1.35;
}

.home-toc-section h2::after {
  content: "";
  display: block;
  width: 88px;
  height: 4px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 999px;
}

.home-toc {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-soft);
}

.home-toc-list {
  column-count: 2;
  column-gap: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-toc-list > li {
  min-width: 0;
  margin: 0 0 24px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.home-toc-list a {
  color: var(--color-text);
  text-decoration: none;
}

.home-toc-list a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.home-toc-list > li > a {
  display: inline-block;
  padding-left: 14px;
  border-left: 4px solid var(--color-primary);
  font-weight: 700;
  line-height: 1.6;
}

.home-toc-list ol {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0 0 0 18px;
  list-style: none;
}

.home-toc-list ol a {
  display: inline-block;
  color: var(--color-muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: minmax(330px, 380px) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding-bottom: 56px;
}

.toc-panel {
  position: sticky;
  top: 18px;
}

.toc-details {
  max-height: calc(100vh - 36px);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.toc-details summary {
  cursor: pointer;
  padding: 14px 18px;
  color: #ffffff;
  background: var(--color-primary);
  font-weight: 700;
  line-height: 1.5;
}

.toc-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 12px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  list-style: none;
}

.toc-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--color-text);
  line-height: 1.6;
  text-decoration: none;
}

.toc-list .toc-sub a {
  padding-left: 22px;
  color: var(--color-text);
  font-size: 0.86rem;
}

.toc-list a:hover {
  color: var(--color-primary-dark);
  background: var(--color-soft);
}

.toc-list a.is-active {
  color: var(--color-primary-dark);
  background: var(--color-soft-strong);
  box-shadow: inset 4px 0 0 var(--color-accent);
  font-weight: 700;
}

.article-body {
  min-width: 0;
  overflow-wrap: anywhere;
}

.content-section {
  scroll-margin-top: 24px;
  padding: 0 0 38px;
  margin-bottom: 38px;
  border-bottom: 1px solid var(--color-line);
}

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

.content-section h2 {
  position: relative;
  margin: 0 0 18px;
  padding-bottom: 12px;
  color: var(--color-primary-dark);
  font-size: clamp(1.45rem, 1.25rem + 0.7vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
}

.content-section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.content-section h3 {
  margin: 30px 0 12px;
  color: var(--color-primary-dark);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.55;
}

.content-section h4 {
  margin: 28px 0 10px;
  color: var(--color-text);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.65;
}

.column-section {
  padding: 0 26px;
  border: 1px solid #b9d5bd;
  border-left: 6px solid #3f7f58;
  border-radius: var(--radius);
  background: #edf6ec;
  overflow: hidden;
}

.column-section .collapsible-section__summary {
  margin: 0 -26px;
  padding: 19px 24px 18px;
  background: var(--color-primary);
}

.column-section .collapsible-section__summary h3 {
  margin-top: 0;
  color: #ffffff;
}

.column-section .collapsible-section__summary::after {
  border-color: rgba(255, 255, 255, 0.82);
  color: #ffffff;
  background: transparent;
}

.column-section .collapsible-section__summary:hover {
  background: var(--color-primary-dark);
}

.column-section .collapsible-section__body {
  padding-bottom: 30px;
}

.column-author {
  margin: 0 0 22px;
  color: #405c49;
  font-size: 0.82rem;
  line-height: 1.65;
  text-align: right;
}

.collapsible-section__details {
  display: block;
}

.collapsible-section__summary {
  display: grid;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.collapsible-section__summary::-webkit-details-marker {
  display: none;
}

.collapsible-section__summary::after {
  content: "＋ 開く";
  justify-self: start;
  margin-top: 2px;
  padding: 4px 12px;
  border: 1px solid var(--color-primary);
  border-radius: 999px;
  color: var(--color-primary-dark);
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.collapsible-section__details[open] > .collapsible-section__summary::after {
  content: "− 閉じる";
}

.collapsible-section__summary:focus-visible {
  outline: 3px solid rgba(23, 128, 154, 0.28);
  outline-offset: 6px;
}

.collapsible-section__summary h3 {
  margin-bottom: 0;
}

.collapsible-section__body {
  margin-top: 22px;
}

.qa-collapsible {
  padding: 22px 24px 28px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: #ffffff;
}

.answer-heading {
  margin: 1.8em 0 0.35em;
  color: var(--color-primary-dark);
  font-size: 1.26rem;
  font-weight: 900;
  line-height: 1.5;
}

.attention-box {
  margin: 24px 0 30px;
  padding: 22px 24px;
  border: 1px solid #cfe4ea;
  border-left: 6px solid var(--color-primary);
  border-radius: var(--radius);
  background: #f3fafc;
}

.attention-item + .attention-item {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #d8edf1;
}

.attention-item h5 {
  margin: 0 0 8px;
  color: var(--color-primary-dark);
  font-size: 1.02rem;
  line-height: 1.6;
}

.attention-item p {
  margin-bottom: 0;
}

.content-section p,
.content-section ul,
.content-section ol,
.content-section blockquote,
.content-section figure,
.content-section .table-wrap,
.note-box {
  margin-top: 0;
  margin-bottom: 1.35em;
}

.caption-text {
  margin-top: 2em;
  color: var(--color-text);
  font-weight: 700;
  text-align: center;
}

.source-text {
  color: var(--color-muted);
  font-size: 0.92rem;
  text-align: center;
}

.content-section ul,
.content-section ol {
  padding-left: 1.45em;
}

.content-section li + li {
  margin-top: 0.35em;
}

.reference-list {
  padding-left: 1.6em;
  font-size: 0.8em;
  line-height: 1.8;
}

.reference-list li {
  margin-bottom: 0.8em;
}

.recovery-definition-table th:first-child,
.recovery-definition-table td:first-child {
  width: 32%;
  min-width: 220px;
}

.author-table {
  min-width: 760px;
}

.author-table th:nth-child(1),
.author-table td:nth-child(1) {
  width: 18%;
  font-weight: 700;
}

.author-table th:nth-child(3),
.author-table td:nth-child(3) {
  width: 20%;
  white-space: nowrap;
}

.author-note,
.source-info {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--color-soft);
}

.note-box {
  padding: 18px 20px;
  border-left: 5px solid var(--color-accent);
  border-radius: var(--radius);
  background: #fff8f0;
}

.note-box p {
  margin: 0;
}

blockquote {
  padding: 18px 22px;
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius);
  color: #3f555e;
  background: var(--color-soft);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #ffffff;
  background: var(--color-primary-dark);
  font-weight: 700;
}

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

figure {
  margin-inline: 0;
}

.doc-figure {
  margin: 16px 0 24px;
  text-align: center;
}

.doc-figure img {
  max-width: min(100%, 780px);
  border-radius: var(--radius);
  background: #ffffff;
}

figcaption {
  margin-top: 8px;
  color: var(--color-muted);
  font-size: 0.9rem;
  text-align: center;
}

.image-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed #9eb8c0;
  border-radius: var(--radius);
  color: var(--color-muted);
  background: var(--color-soft);
  font-weight: 700;
}

.contact-section {
  padding: 28px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-soft);
}

.site-footer {
  padding: 26px 0;
  color: #ffffff;
  background: var(--color-primary-dark);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.share-label,
.copy-status {
  font-size: 0.76rem;
  line-height: 1.4;
}

.share-label {
  margin-right: 3px;
  color: rgba(255, 255, 255, 0.8);
}

.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 4px;
  color: #ffffff;
  background: transparent;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}

.share-link:hover,
.share-link:focus-visible {
  border-color: #ffffff;
  color: var(--color-primary-dark);
  background: #ffffff;
}

.copy-status {
  min-width: 6.5em;
  color: #ffffff;
}

.share-links--inline {
  justify-content: flex-start;
  margin: 0 0 18px;
}

.share-links--inline .share-label {
  color: var(--color-muted);
}

.share-links--inline .share-link {
  border-color: var(--color-line);
  color: var(--color-primary-dark);
  background: #ffffff;
}

.share-links--inline .share-link:hover,
.share-links--inline .share-link:focus-visible {
  border-color: var(--color-primary);
  color: #ffffff;
  background: var(--color-primary);
}

.share-links--inline .copy-status {
  color: var(--color-primary-dark);
}

.toc-share-links {
  margin-bottom: 12px;
}

.floating-links {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.floating-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 44px;
  padding: 8px 14px;
  border: 2px solid var(--color-primary-dark);
  border-radius: 999px;
  color: var(--color-primary-dark);
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.28);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.floating-link:hover {
  color: #ffffff;
  background: var(--color-primary-dark);
}

@media (max-width: 820px) {
  body {
    font-size: 15px;
    line-height: 1.85;
  }

  .site-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

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

  .page-hero {
    margin-bottom: 20px;
  }

  .home-lead {
    font-size: 1rem;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .home-toc-list {
    column-count: 1;
  }

  .layout {
    display: block;
    padding-bottom: 42px;
  }

  .toc-panel {
    position: static;
    margin-bottom: 28px;
  }

  .toc-details:not([open]) {
    box-shadow: none;
  }

  .toc-details,
  .toc-list {
    max-height: none;
  }

  .toc-list .toc-sub a {
    font-size: 0.92rem;
  }

  .content-section {
    scroll-margin-top: 12px;
    margin-bottom: 30px;
    padding-bottom: 30px;
  }

  .contact-section {
    padding: 20px;
  }

  .column-section {
    padding: 0 18px;
  }

  .column-section .collapsible-section__summary {
    margin: 0 -18px;
    padding: 17px 18px 16px;
  }

  .column-section .collapsible-section__body {
    padding-bottom: 24px;
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .share-links {
    justify-content: flex-start;
  }

  .qa-collapsible {
    padding: 20px 18px 24px;
  }
}

@media (max-width: 520px) {
  .container,
  .site-header__inner {
    width: min(100% - 24px, var(--container));
  }

  .site-nav a {
    min-height: 34px;
    padding-inline: 11px;
    font-size: 0.86rem;
  }

  .page-hero {
    padding: 30px 0 34px;
  }

  .home-lead {
    line-height: 1.85;
  }

  .home-toc {
    padding: 18px;
  }

  .home-toc-list ol {
    padding-left: 14px;
  }

  .content-section h3 {
    font-size: 1.08rem;
  }

  .note-box,
  blockquote {
    padding: 15px 16px;
  }

  .floating-links {
    right: 12px;
    bottom: 12px;
  }

  .floating-link {
    min-width: 66px;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
}

@media print {
  html {
    scroll-behavior: auto;
  }

  .site-nav,
  .toc-panel,
  .floating-links,
  .share-links,
  .skip-link {
    display: none;
  }

  .layout {
    display: block;
  }

  .site-header,
  .page-hero,
  .site-footer {
    background: #ffffff;
    color: #000000;
  }

  a {
    color: #000000;
  }
}
