:root {
  color-scheme: light;
  --ink: #23483f;
  --muted: #5b7068;
  --line: #dbe3dc;
  --paper: #fafbf8;
  --accent: #16674f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.8 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
a:hover {
  color: #073d2c;
}
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #bc741e;
  outline-offset: 4px;
}
button,
input {
  font: inherit;
}
.skip {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 5;
  background: white;
  padding: 8px 18px;
}
.skip:focus {
  top: 10px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1320px;
  margin: auto;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -1px;
  text-decoration: none;
}
.brand span {
  color: #c38035;
}
.brand small {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 500;
  margin-left: 10px;
}
.topbar nav {
  display: flex;
  gap: 24px;
  font-size: 13px;
}
.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 60px;
  max-width: 1260px;
  padding: 36px 32px 80px;
  margin: auto;
}
aside {
  min-width: 0;
}
main {
  min-width: 0;
  max-width: 900px;
}
h1 {
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -1.4px;
  line-height: 1.2;
  margin: 12px 0 20px;
}
html[lang="ja"] h1 {
  letter-spacing: 0;
  line-height: 1.45;
}
h2 {
  font-size: 25px;
  line-height: 1.45;
  letter-spacing: -0.4px;
  margin: 44px 0 18px;
  scroll-margin-top: 24px;
}
p {
  margin: 14px 0;
}
.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 730px;
  line-height: 1.8;
}
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--muted);
}
.nav-disclosure summary {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  margin: 24px 0 10px;
  cursor: pointer;
}
.sidebar {
  display: grid;
  gap: 3px;
}
.sidebar a {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--muted);
  line-height: 1.6;
}
.sidebar a[aria-current] {
  background: #e7efe7;
  color: #16543e;
  font-weight: 650;
}
.search label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.search input {
  width: 100%;
  min-width: 0;
  border: 1px solid #b6c9bd;
  border-radius: 5px;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink);
}
#search-status {
  font-size: 12px;
  margin: 6px 0;
}
#search-results {
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}
#search-results li {
  padding: 10px 0;
  line-height: 1.5;
}
#search-results a {
  font-size: 14px;
  font-weight: 600;
}
#search-results span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  border-left: 3px solid #cddaca;
  padding: 12px 18px;
  margin: 28px 0;
  font-size: 13px;
}
.toc strong {
  width: 100%;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.table-scroll {
  overflow-x: auto;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  text-align: left;
}
td,
th {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}
th {
  background: #edf2eb;
  font-size: 12px;
}
td:first-child {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}
tr:last-child td {
  border-bottom: 0;
}
pre {
  overflow: auto;
  background: #edf2ed;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 22px;
  font:
    12px/1.8 ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  tab-size: 2;
  max-width: 100%;
}
.example {
  margin: 28px 0 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}
.example figcaption {
  padding: 15px 20px;
  background: #edf2eb;
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.example figcaption strong {
  font:
    600 13px ui-monospace,
    monospace;
}
.example figcaption span {
  color: var(--muted);
}
.example-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}
.example-pair pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-right: 1px solid var(--line);
  background: #f7f9f5;
  max-height: 470px;
  font-size: 11px;
  padding: 20px;
}
.diagram {
  display: flex;
  align-items: center;
  padding: 12px;
  min-width: 0;
}
.diagram img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
}
.example-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}
.credit {
  font-size: 10px;
  color: var(--muted);
  padding: 0 20px 12px;
  line-height: 1.7;
}
.pagination {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.pagination a {
  display: grid;
  text-decoration: none;
  font-size: 15px;
}
.pagination small {
  color: var(--muted);
  font-size: 11px;
}
.pagination a[rel="next"] {
  text-align: right;
}
footer {
  border-top: 1px solid var(--line);
  padding: 24px 32px;
  max-width: 1260px;
  margin: auto;
  font-size: 11px;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  .layout {
    grid-template-columns: 185px minmax(0, 1fr);
    gap: 28px;
    padding: 26px 22px;
  }
  .example-pair {
    grid-template-columns: 1fr;
  }
  .example-pair pre {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 320px;
  }
  .diagram img {
    max-height: 500px;
  }
  .topbar {
    padding: 18px 22px;
  }
}
@media (max-width: 600px) {
  .topbar {
    gap: 12px;
    padding: 16px 18px;
  }
  .topbar nav {
    gap: 12px;
    font-size: 11px;
  }
  .brand {
    font-size: 26px;
  }
  .brand small {
    font-size: 9px;
    margin-left: 5px;
    letter-spacing: 1px;
  }
  .layout {
    display: block;
    padding: 20px 18px 50px;
  }
  aside {
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 26px;
  }
  .sidebar {
    grid-template-columns: 1fr 1fr;
  }
  .sidebar a {
    font-size: 12px;
    padding: 5px 8px;
  }
  .nav-disclosure summary {
    margin: 12px 0 8px;
  }
  .lead {
    font-size: 16px;
  }
  h2 {
    font-size: 22px;
  }
  body {
    font-size: 15px;
  }
  .toc {
    gap: 8px 14px;
  }
  td,
  th {
    padding: 10px;
    font-size: 12px;
  }
  footer {
    padding: 20px 18px;
  }
  .example-links {
    gap: 8px 14px;
    padding: 12px;
  }
  .credit {
    padding: 0 12px 12px;
  }
  .example figcaption {
    padding: 12px;
  }
  .pagination a {
    font-size: 13px;
  }
}
