:root {
  color-scheme: light;
  --background: #f7f8fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d9dee8;
  --accent: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Yu Gothic",
    "YuGothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.75;
}

main {
  width: min(1060px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.page-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.side-nav {
  position: sticky;
  top: 32px;
  padding: 20px 0;
}

.side-nav-title {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.side-nav-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav a,
.side-nav .active {
  display: block;
  border-radius: 6px;
  padding: 9px 10px;
  text-decoration: none;
}

.side-nav a {
  color: var(--accent);
}

.side-nav a:hover {
  background: #eef4ff;
}

.side-nav .active {
  color: #111827;
  font-weight: 700;
  cursor: default;
}

.mobile-nav {
  display: none;
}

article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: clamp(24px, 5vw, 48px);
}

h1,
h2,
h3 {
  line-height: 1.35;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
}

h2 {
  margin: 32px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 1.25rem;
}

h3 {
  margin: 24px 0 8px;
  font-size: 1.05rem;
}

p,
ul,
ol {
  margin: 0 0 16px;
}

ul,
ol {
  padding-left: 1.3em;
}

table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
}

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

th {
  background: #f1f4f9;
  font-weight: 700;
}

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

.meta {
  margin-bottom: 32px;
  color: var(--muted);
}

.note {
  background: #eef4ff;
  border: 1px solid #c8d9ff;
  border-radius: 8px;
  padding: 14px 16px;
}

footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  main {
    width: min(100% - 18px, 640px);
    padding: 12px 0 40px;
  }

  .page-shell {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .side-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
    position: relative;
    z-index: 10;
  }

  .mobile-nav summary {
    position: relative;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 8px 12px;
    color: #111827;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }

  .mobile-nav summary::-webkit-details-marker {
    display: none;
  }

  .mobile-nav[open]::before {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(17, 24, 39, 0.46);
    content: "";
  }

  .mobile-nav[open] summary {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 12;
  }

  .mobile-nav-list {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 11;
    display: grid;
    align-content: start;
    width: min(82vw, 320px);
    gap: 8px;
    margin: 0;
    padding: 72px 18px 18px;
    border-right: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 16px 0 40px rgba(17, 24, 39, 0.18);
    list-style: none;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .mobile-nav[open] .mobile-nav-list {
    transform: translateX(0);
  }

  .mobile-nav a,
  .mobile-nav .active {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 9px 12px;
    text-decoration: none;
  }

  .mobile-nav .active {
    color: #111827;
    font-weight: 700;
    cursor: default;
  }

  article {
    padding: 20px;
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: 1.55rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
