:root {
  color-scheme: light;
  --legal-background: #f3f7fa;
  --legal-surface: #ffffff;
  --legal-text: #182a36;
  --legal-text-muted: #526773;
  --legal-border: #d7e1e7;
  --legal-link: #005ea8;
  --legal-link-hover: #003e73;
  --legal-accent: #1f9bd1;
  --legal-focus: #8c5a00;
  --legal-max-width: 52rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 20rem;
  margin: 0;
  background: var(--legal-background);
  color: var(--legal-text);
  font-family:
    "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 1rem;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--legal-link);
  text-decoration-line: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--legal-link-hover);
  text-decoration-thickness: 0.14em;
}

a:focus-visible {
  border-radius: 0.125rem;
  outline: 0.1875rem solid var(--legal-focus);
  outline-offset: 0.1875rem;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  transform: translateY(-200%);
  background: var(--legal-surface);
  font-weight: 700;
}

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

.site-header {
  border-bottom: 0.0625rem solid var(--legal-border);
  background: var(--legal-surface);
}

.site-header__inner {
  display: flex;
  width: min(calc(100% - 3rem), var(--legal-max-width));
  margin: 0 auto;
  padding: 1rem 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.brand {
  margin: 0;
  color: var(--legal-text);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.document-nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 0.5rem;
  list-style: none;
}

.document-nav a {
  display: inline-block;
  border-radius: 0.375rem;
  padding: 0.375rem 0.625rem;
  color: var(--legal-text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.document-nav a:hover {
  background: var(--legal-background);
  color: var(--legal-text);
}

.document-nav a[aria-current="page"] {
  background: #e4f3fa;
  color: #075779;
}

.legal-document {
  width: min(calc(100% - 3rem), var(--legal-max-width));
  margin: 2rem auto;
  border: 0.0625rem solid var(--legal-border);
  border-radius: 0.75rem;
  padding: clamp(2rem, 5vw, 4rem);
  background: var(--legal-surface);
  box-shadow: 0 0.75rem 2.5rem rgb(24 42 54 / 7%);
}

.document-header {
  padding-bottom: 2rem;
}

.document-header::before {
  display: block;
  width: 3rem;
  height: 0.25rem;
  margin-bottom: 1.5rem;
  border-radius: 999px;
  background: var(--legal-accent);
  content: "";
}

.document-kicker {
  margin: 0 0 0.5rem;
  color: var(--legal-text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

h1,
h2 {
  font-feature-settings: "palt" 1;
  letter-spacing: 0.01em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.5rem);
  line-height: 1.35;
  text-wrap: balance;
}

.document-lead {
  margin: 1.5rem 0 0;
  color: var(--legal-text-muted);
}

.legal-section {
  border-top: 0.0625rem solid var(--legal-border);
  padding: 2rem 0;
}

.legal-section:last-of-type {
  padding-bottom: 0;
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  line-height: 1.55;
}

p,
ul,
dl {
  margin: 1rem 0 0;
}

.legal-section > :first-child {
  margin-top: 0;
}

.legal-list {
  padding-left: 1.5rem;
}

.legal-list li + li {
  margin-top: 0.5rem;
}

.external-links {
  display: grid;
  margin-top: 1rem;
  padding: 0;
  gap: 0.5rem;
  list-style: none;
}

.external-links a::after {
  content: "（外部サイト）";
  font-size: 0.8125em;
  white-space: nowrap;
}

.operator-list {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) 1fr;
  margin-top: 1rem;
  gap: 0.5rem 1rem;
}

.operator-list dt {
  color: var(--legal-text-muted);
  font-weight: 700;
}

.operator-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.site-footer {
  width: min(calc(100% - 3rem), var(--legal-max-width));
  margin: 0 auto;
  padding: 0 0 2.5rem;
  color: var(--legal-text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

.site-footer nav ul {
  display: flex;
  margin: 0 0 0.75rem;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  list-style: none;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 39.9375rem) {
  body {
    background: var(--legal-surface);
  }

  .site-header__inner {
    width: min(calc(100% - 2rem), var(--legal-max-width));
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .document-nav ul {
    justify-content: flex-start;
  }

  .document-nav a {
    padding-right: 0.5rem;
    padding-left: 0;
  }

  .document-nav a[aria-current="page"] {
    background: transparent;
    color: #075779;
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  .legal-document {
    width: min(calc(100% - 2rem), var(--legal-max-width));
    margin: 0 auto;
    border: 0;
    border-radius: 0;
    padding: 2.5rem 0;
    box-shadow: none;
  }

  .operator-list {
    grid-template-columns: 1fr;
    gap: 0.125rem;
  }

  .operator-list dd + dt {
    margin-top: 0.75rem;
  }

  .site-footer {
    width: min(calc(100% - 2rem), var(--legal-max-width));
  }
}

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

@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  .skip-link,
  .site-header,
  .site-footer {
    display: none;
  }

  .legal-document {
    width: 100%;
    margin: 0;
    border: 0;
    padding: 0;
    box-shadow: none;
  }

  .document-header {
    padding-bottom: 1rem;
  }

  h1 {
    font-size: 24pt;
  }

  h2 {
    margin-bottom: 0.5rem;
    font-size: 14pt;
  }

  p,
  ul,
  dl {
    margin-top: 0.5rem;
  }

  a {
    color: inherit;
  }

  .legal-section {
    padding: 1rem 0;
  }

  .legal-section > h2 {
    break-after: avoid-page;
  }

  .document-lead,
  .legal-section p,
  .legal-section li,
  .operator-list {
    break-inside: avoid-page;
    orphans: 3;
    widows: 3;
  }
}
