:root { --bg: #ffffff; --fg: #1d2128; --muted: #5c6470; --line: #c4cad3; --th: #e9edf2; --code: #eef1f5;
        --accent: #e2433b; --blue: #2f7fc4; --h3: #2a5f91; --note: #fff6e8; --note-line: #e8a33a;
        --flow: #eef5fc; --check: #ffe58a; --nav: #f4f6f9; color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #16191e; --fg: #e3e7ec; --muted: #9aa3ad; --line: #3a414b; --th: #232830; --code: #262c35;
          --accent: #ef5a52; --blue: #5aa6e8; --h3: #7fb8ea; --note: #2b2519; --note-line: #c98a2a;
          --flow: #1d2a38; --check: #6b5a12; --nav: #1d2127; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.7; font-size: 16px;
       font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
                    Meiryo, "Noto Sans", "Noto Sans CJK JP", "Noto Sans JP", sans-serif; }
main, .bar-in { max-width: 860px; margin: 0 auto; padding: 0 16px; }
main { padding-top: 8px; padding-bottom: 32px; overflow-wrap: break-word; }
a { color: var(--blue); }
h1 { font-size: 1.6rem; line-height: 1.3; margin: 16px 0 12px; padding: 6px 0 6px 12px; border-left: 6px solid var(--accent); }
h2 { font-size: 1.25rem; margin: 32px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--blue); }
h3 { font-size: 1.05rem; margin: 20px 0 6px; color: var(--h3); }
h1, h2, h3 { scroll-margin-top: 12px; }
img { max-width: 100%; height: auto; display: block; margin: 8px auto 16px; border: 1px solid var(--line); }
blockquote { margin: 12px 0; padding: 8px 12px; background: var(--note); border-left: 4px solid var(--note-line); }
blockquote p { margin: 0 0 4px; }
code { font-family: ui-monospace, Consolas, "Cascadia Mono", Menlo, "Noto Sans Mono", "DejaVu Sans Mono", monospace;
       font-size: .88em; background: var(--code); padding: 0 4px; border-radius: 3px; overflow-wrap: anywhere; }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; text-align: left; }
th { background: var(--th); white-space: nowrap; }
.nw { white-space: nowrap; }
.hist td:nth-child(-n+2) { white-space: nowrap; }
.params table { font-size: .8rem; min-width: 760px; }
.params td, .params th { padding: 3px 6px; }
.params th { white-space: normal; }
.params code { background: none; padding: 0; }
.check { background: var(--check); padding: 0 3px; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 16px; }
.flow span { border: 1px solid var(--blue); border-radius: 4px; background: var(--flow); padding: 5px 8px; text-align: center;
             font-weight: bold; font-size: .85rem; line-height: 1.3; }
.flow span small { font-weight: normal; font-size: .75rem; color: var(--muted); }
.flow b { color: var(--blue); font-size: 1.1rem; }
/* ナビ */
.bar { background: var(--nav); border-bottom: 1px solid var(--line); font-size: .92rem; }
.bar.bottom { border-top: 1px solid var(--line); border-bottom: 0; margin-top: 24px; }
.bar-in { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 480px) { .bar .home { flex-basis: 100%; } }
.bar .home { font-weight: 800; letter-spacing: .06em; text-decoration: none; color: var(--fg); margin-right: auto; }
.bar .home em, .logo em { color: var(--accent); font-style: normal; }
.bar a { white-space: nowrap; }
.bar .off { color: var(--muted); white-space: nowrap; }
.pn { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* 目次ページ */
.hero { padding: 24px 0 8px; }
.logo { font-size: 2.2rem; font-weight: 900; letter-spacing: .1em; line-height: 1.2; }
.hero .sub { font-size: .8rem; letter-spacing: .3em; color: var(--muted); }
.hero .v { font-size: .85rem; color: var(--muted); margin-top: 8px; }
ol.toc { list-style: none; padding: 0; }
ol.toc > li { margin: 14px 0; }
ol.toc:not(.flat) > li > a { font-weight: bold; font-size: 1.05rem; }
ol.toc ul { margin: 4px 0 0; padding-left: 18px; font-size: .92rem; columns: 2 260px; column-gap: 24px; }
ol.toc ul li { break-inside: avoid; }
ol.flat { columns: 2 280px; column-gap: 24px; }
ol.flat li { margin: 0; break-inside: avoid; }
ol.flat li.h1 { font-weight: bold; margin-top: 8px; break-after: avoid; }
ol.flat li.h2 { padding-left: 16px; font-size: .9rem; }
.foot { color: var(--muted); font-size: .85rem; }
/* 全章のページ */
.cover { padding: 32px 0 16px; text-align: center; }
.cover .t { font-size: 1.3rem; margin-top: 16px; }
.cover .v, .cover .m, .cover .sub { color: var(--muted); font-size: .85rem; }
.cover .sub { letter-spacing: .3em; }
.chapter { margin-top: 24px; }

@media print {
  @page { size: A4; margin: 16mm 15mm; }
  :root { --bg: #fff; --fg: #1d2128; --muted: #5c6470; --line: #9aa3ad; --th: #e9edf2; --code: #eef1f5;
          --accent: #e2433b; --blue: #2f7fc4; --h3: #2a5f91; --note: #fff6e8; --note-line: #e8a33a; --flow: #eef5fc; }
  body { font-size: 10pt; line-height: 1.6; }
  main { max-width: none; padding: 0; }
  .bar, .noprint { display: none !important; }
  a { color: inherit; text-decoration: none; }
  h1 { font-size: 18pt; margin: 0 0 10pt; }
  h2 { font-size: 13pt; margin: 16pt 0 6pt; break-after: avoid; }
  h3 { font-size: 11pt; margin: 10pt 0 4pt; break-after: avoid; }
  p, li { orphans: 2; widows: 2; }
  .keep, img, .flow, tr { break-inside: avoid; }
  .tw { overflow: visible; }
  table { font-size: 8.8pt; }
  code { font-size: 8.5pt; }
  .params table { font-size: 7.4pt; table-layout: fixed; min-width: 0; }
  .params code { font-size: 6.8pt; }
  .params th:nth-child(1) { width: 24%; } .params th:nth-child(2) { width: 26%; } .params th:nth-child(3) { width: 5%; }
  .params th:nth-child(4) { width: 26%; } .params th:nth-child(5) { width: 9%; } .params th:nth-child(6) { width: 10%; }
  .print .chapter { break-before: page; margin-top: 0; }
  .print .cover { min-height: 240mm; display: flex; flex-direction: column; justify-content: center; }
  .print .cover .logo { font-size: 40pt; }
  .print nav.toc { break-before: page; }
  ol.toc ul { columns: 1; }
  ol.flat { columns: 2; font-size: 9pt; }
  ol.flat li.h1 { margin-top: 5pt; }
  ol.flat li.h2 { font-size: 8.5pt; }
}
