:root {
  color-scheme: light dark;
  --page: #ffffff;
  --surface: #f5f7fa;
  --text: #202630;
  --muted: #535d6c;
  --line: #dce1e8;
  --accent: #9a370b;
  --accent-bg: #fff0e7;
  --mark: #ff9a6c;
  --focus: #d95018;
  --code: #202731;
  font: 100% / 1.8 "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .19em; }
a:hover { text-decoration-thickness: .13em; }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip {
  position: fixed;
  z-index: 5;
  top: .75rem;
  left: .75rem;
  transform: translateY(-160%);
  background: var(--page);
  padding: .5rem 1rem;
}
.skip:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
  padding: .75rem clamp(1rem, 3vw, 2.5rem);
  background: var(--page);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .85rem; color: var(--text); text-decoration: none; line-height: 1.35; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .875rem; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 3.35rem;
  height: 2.75rem;
  border-radius: .5rem;
  background: #202630;
  color: var(--mark);
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -.06em;
}
.header-links { display: flex; gap: 1rem; align-items: center; font-size: .875rem; }
.version { border: 1px solid var(--line); border-radius: 1rem; padding: .1rem .65rem; color: var(--muted); }
.layout { display: grid; grid-template-columns: minmax(13.5rem, 16rem) minmax(0, 1fr); max-width: 94rem; margin: auto; }
aside { min-width: 0; border-right: 1px solid var(--line); }
nav { position: sticky; top: 6.25rem; display: grid; gap: .25rem; padding: 0 .9rem 1.5rem; margin-top: 1.25rem; }
nav a {
  display: block;
  border-radius: .3rem;
  border-inline-start: 3px solid transparent;
  padding: .52rem .65rem;
  color: var(--muted);
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.55;
}
nav a:hover { background: var(--surface); color: var(--text); }
nav a[aria-current] { border-color: var(--focus); background: var(--accent-bg); color: var(--accent); font-weight: 700; }
main { min-width: 0; max-width: 69rem; padding: clamp(1.4rem, 4vw, 3.5rem); }
article { max-width: 58rem; }
h1 { font-size: clamp(1.85rem, 3.4vw, 3.15rem); letter-spacing: -.032em; line-height: 1.3; margin: 0 0 1rem; }
h2 { font-size: clamp(1.24rem, 2.3vw, 1.55rem); margin: 2.45rem 0 .85rem; border-top: 1px solid var(--line); padding-top: .9rem; }
h3 { margin: 1.5rem 0 .5rem; font-size: 1.09rem; }
p { margin: .75rem 0; }
li { margin-block: .35rem; }
.lead { color: var(--muted); font-size: 1.14rem; max-width: 48rem; }
.overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.3rem;
}
.overview-logo { display: block; width: 100%; max-width: 23rem; height: auto; justify-self: center; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; list-style: none; padding: 0; }
.flow li { border: 1px solid var(--line); border-top: 3px solid var(--focus); border-radius: .42rem; padding: .65rem .8rem; background: var(--surface); }
.flow strong, .flow span { display: block; }
.flow span { color: var(--muted); font-size: .875rem; }
table { width: 100%; table-layout: fixed; border: 1px solid var(--line); border-radius: .4rem; border-spacing: 0; margin: 1rem 0; font-size: .92rem; }
thead { background: var(--surface); }
th, td { padding: .63rem .8rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
th:first-child { width: 30%; }
tbody tr:last-child td { border-bottom: 0; }
code { font-family: Consolas, "Liberation Mono", monospace; font-size: .9em; background: var(--surface); border-radius: .23rem; padding: .12em .29em; overflow-wrap: anywhere; }
pre { margin: 1rem 0; padding: 1rem 1.1rem; background: var(--code); color: #f4f6fa; border-radius: .42rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
pre code { padding: 0; background: transparent; }
footer { display: flex; flex-wrap: wrap; gap: .5rem 1rem; border-top: 1px solid var(--line); margin-top: 2.6rem; padding: 1.1rem 0; font-size: .88rem; color: var(--muted); }

@media (max-width: 730px) {
  .site-header { position: static; flex-wrap: wrap; }
  .layout { display: block; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); }
  nav { display: flex; flex-wrap: wrap; padding: .7rem .8rem; gap: .25rem; margin: 0; }
  nav a { font-size: .875rem; padding: .3rem .55rem; }
  .overview-hero { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: .55rem .6rem; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #1b2028;
    --surface: #252d38;
    --text: #edf0f4;
    --muted: #bbc4d0;
    --line: #3e4a5b;
    --accent: #ffad86;
    --accent-bg: #392b29;
    --focus: #ff9a6c;
    --code: #151a21;
  }
}
@media print {
  :root { color-scheme: light; background: white; color: #171717; }
  .site-header, aside, footer, .skip { display: none; }
  .layout, main { display: block; max-width: none; padding: 0; }
  article { max-width: none; }
  h2, h3 { break-after: avoid; }
  pre, table { break-inside: avoid; }
}
