:root {
  color-scheme: light;
  --text: #1d1d1f;
  --secondary: #515154;
  --tertiary: #6e6e73;
  --line: #d2d2d7;
  --soft-line: #e8e8ed;
  --link: #06c;
  --notice: #f5f5f7;
  --page-width: 1040px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  color: var(--text);
  background: #fff;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #fff;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-underline-offset: 0.16em;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  color: #fff;
  background: var(--text);
  transform: translateY(-160%);
}

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

.site-header { border-bottom: 1px solid var(--line); }

.header-inner {
  width: min(calc(100% - 48px), var(--page-width));
  min-height: 60px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-name {
  margin-right: auto;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a,
.language-link {
  color: var(--secondary);
  font-size: 14px;
  text-decoration: none;
}

.header-nav a:hover,
.language-link:hover { text-decoration: underline; }

.language-link {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.home-main {
  width: min(calc(100% - 48px), 800px);
  margin: 0 auto;
  padding: 48px 0 80px;
}

.page-heading h1,
.document-heading h1,
.not-found h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-heading p {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--secondary);
}

.site-meta {
  margin: 32px 0 0;
  padding: 20px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-meta dt,
.document-heading dt {
  color: var(--tertiary);
  font-size: 13px;
}

.site-meta dd,
.document-heading dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.document-index { margin-top: 40px; }
.document-index h2 { margin: 0 0 12px; font-size: 20px; }
.document-index > div { border-top: 1px solid var(--line); }

.document-row {
  padding: 20px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.document-row strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
}

.document-row small {
  display: block;
  margin-top: 4px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.55;
}

.document-row > span:last-child {
  color: var(--link);
  font-size: 14px;
}

.document-row:hover strong,
.document-row:hover > span:last-child { text-decoration: underline; }

.document-main {
  width: min(calc(100% - 48px), 720px);
  margin: 0 auto;
  padding: 48px 0 88px;
  display: block;
}

.legal-document { min-width: 0; }

.document-heading {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.document-summary {
  max-width: 660px;
  margin: 14px 0 0;
  color: var(--secondary);
}

.document-heading dl {
  margin: 24px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
}

.document-heading dl div { display: grid; }

.notice-box {
  margin: 28px 0 0;
  padding: 16px;
  color: var(--secondary);
  background: var(--notice);
  font-size: 14px;
}

.notice-box strong { color: var(--text); }

.legal-section {
  min-width: 0;
  padding: 36px 0 0;
  scroll-margin-top: 24px;
}

.legal-section h2 {
  margin: 0 0 16px;
  padding-top: 36px;
  border-top: 1px solid var(--soft-line);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.legal-section:first-of-type h2 { border-top: 0; }
.legal-section h3 { margin: 26px 0 8px; font-size: 17px; }
.legal-section p { margin: 0 0 16px; color: var(--secondary); }
.legal-section ul,
.legal-section ol { margin: 6px 0 18px; padding-left: 1.3em; color: var(--secondary); }
.legal-section li { margin: 7px 0; padding-left: 0.2em; }
.legal-section strong { color: var(--text); }

.table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 22px 0 26px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.6;
}

caption {
  padding: 10px 12px;
  color: var(--tertiary);
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

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

th:last-child,
td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--text); font-weight: 600; }
td { color: var(--secondary); }
td:first-child { width: 19%; color: var(--text); font-weight: 600; }

.site-footer {
  width: min(calc(100% - 48px), var(--page-width));
  margin: 0 auto;
  padding: 24px 0 40px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--tertiary);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.not-found {
  width: min(calc(100% - 48px), 720px);
  min-height: calc(100vh - 158px);
  margin: 0 auto;
  padding: 56px 0;
}

.not-found p { color: var(--secondary); }

@media (max-width: 800px) {
  .header-nav { display: none; }
}

@media (max-width: 560px) {
  .header-inner,
  .home-main,
  .document-main,
  .site-footer { width: min(calc(100% - 32px), var(--page-width)); }
  .header-inner { min-height: 54px; }
  .language-link { padding-left: 16px; }
  .home-main,
  .document-main { padding-top: 32px; padding-bottom: 64px; }
  .page-heading h1,
  .document-heading h1,
  .not-found h1 { font-size: 26px; }
  .site-meta { grid-template-columns: 1fr; gap: 14px; }
  .document-row { grid-template-columns: 1fr; gap: 8px; }
  .document-heading dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .legal-section { padding-top: 30px; }
  .legal-section h2 { padding-top: 30px; font-size: 20px; }
  .legal-section p,
  .legal-section ul,
  .legal-section ol { font-size: 15px; }
  .site-footer { flex-direction: column; gap: 6px; }
}

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

@media print {
  .site-header,
  .site-footer,
  .skip-link { display: none !important; }
  .document-main { display: block; width: 100%; padding: 0; }
  .legal-section { break-inside: avoid; }
  a { color: var(--text); text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
