
.book {
  display: flex;
  align-items: flex-start;
  gap: clamp(20px, 3.5vw, 52px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.book main {
  flex: 1;
  min-width: 0;
  max-width: 720px;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

.book .toc {
  flex: none;
  width: 214px;
  position: sticky;
  top: 24px;
  padding-top: clamp(40px, 7vw, 76px);
  font-size: 13.5px;
  line-height: 1.65;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.book .toc-h {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--dim);
  margin-bottom: 10px;
  padding-left: 10px;
}

.book .toc ol { list-style: none; margin: 0; padding: 0; font-size: inherit; }

.book .toc a {
  display: block;
  color: var(--dim2);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 7px;
}
.book .toc a:hover { color: var(--ink); background: var(--card); }

.book .toc .page > a { color: var(--ink); font-weight: 700; background: none; }
.book .toc .page > a:hover { background: var(--card); }

.book .toc .chs {
  margin: 2px 0 8px 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.book .toc .chs a { font-size: 13px; padding: 4px 8px; }
.book .toc .chs a.on { color: var(--ink); background: var(--card); font-weight: 600; }

.book .toc.gnav { display: block; justify-content: initial; border-bottom: 0; padding-bottom: 0; }

.book main h2 { scroll-margin-top: 20px; }

@media (max-width: 900px) {
  .book { display: block; padding: 0; max-width: none; }
  .book main { max-width: 720px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
  .book .toc {
    position: static; width: auto; max-height: none; overflow: visible;
    padding: 12px 20px; border-bottom: 1px solid var(--border);
  }
  .book .toc-h, .book .toc .chs { display: none; }
  .book .toc ol { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
  .book .toc a { padding: 5px 12px; border-radius: 999px; white-space: nowrap; }
}

@media (max-width: 640px) {
  .book .toc a { padding: 9px 10px; }    
  .book .toc .chs a { padding-top: 8px; padding-bottom: 8px; }
  .kbdsw button { min-height: 36px; padding-top: 8px; padding-bottom: 8px; }
}

.book { max-width:1080px; gap:clamp(40px,5vw,72px); padding-top:56px; }
.book main { max-width:660px; padding-top:0; }
.book main h1 { font-size:32px; line-height:1.4; letter-spacing:-.025em; }
.book main .lead { margin:16px 0 0; max-width:42em; line-height:1.8; }
.book main h2 { margin:48px 0 14px; font-size:21px; line-height:1.5; scroll-margin-top:96px; }
.book .toc { top:88px; padding-top:0; max-height:calc(100dvh - 112px); }
.book .toc a { white-space:normal; overflow-wrap:anywhere; }
.book .toc .chs { margin:8px 0 18px 10px; }
.book .toc .chs a { line-height:1.65; padding:7px 10px; }
.book main .steps { margin:8px 0 0; padding:0; }
.book main .steps li { padding:18px 0 18px 42px; margin:0; border-bottom:1px solid var(--border); }
.book main .steps li:last-child { border-bottom:0; }
.book main .steps li::before { top:20px; }
.book main .steps li > strong:first-child { display:block; margin-bottom:4px; }
.book main .faq { border-top:1px solid var(--border); }
.book main .faq details { border:0; border-bottom:1px solid var(--border); border-radius:0; background:transparent; margin:0; }
.book main .faq summary { padding:17px 0; min-height:48px; align-items:center; }
.book main .faq .ans { padding:0 24px 18px 0; line-height:1.8; }
.book main .note { border:0; border-left:2px solid var(--border); border-radius:0; background:transparent; padding:4px 0 4px 18px; }
.guide-contents { display:none; }
.book :is(a,summary,button):focus-visible { outline:2px solid var(--ink); outline-offset:4px; }
@media (max-width:900px) {
  .book { padding-top:0; }
  .book main { max-width:700px; padding-top:36px; }
  .book .toc.gnav { max-width:700px; margin:0 auto; padding:12px 20px; border-bottom:1px solid var(--border); }
  .book .toc > ol { justify-content:flex-start; gap:4px; flex-wrap:nowrap; }
  .book .toc a { min-height:44px; display:flex; align-items:center; padding:8px 12px; white-space:nowrap; }
  .book .toc .page > a { background:var(--card); }
  .guide-contents { display:block; margin:24px 0 32px; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
  .book main .guide-contents summary { display:flex; align-items:center; justify-content:space-between; min-height:48px; cursor:pointer; list-style:none; font-size:14px; font-weight:600; }
  .guide-contents summary::-webkit-details-marker { display:none; }
  .guide-contents summary::after { content:'+'; color:var(--dim); font-size:18px; font-weight:400; }
  .guide-contents[open] summary::after { content:'−'; }
  .book main .guide-contents .chs { list-style:none; margin:0; padding:0 0 12px; }
  .book main .guide-contents li { margin:0; }
  .guide-contents a { display:flex; align-items:center; min-height:44px; padding:8px 0; color:var(--dim2); text-decoration:none; font-size:14px; line-height:1.6; }
  .guide-contents a.on { color:var(--ink); font-weight:600; }
  .book main .guide-contents + h2 { margin-top:0; }
}
@media (max-width:640px) {
  .book main { padding-top:28px; }
  .book .toc.gnav { padding:8px 16px; }
  .book .toc > ol { justify-content:space-between; gap:0; }
  .book .toc a { padding:8px; font-size:13px; }
  .book main h1 { font-size:24px; line-height:1.4; text-wrap:balance; }
  .book main .lead { margin-top:12px; font-size:15px; line-height:1.75; }
  .book main h2 { margin:36px 0 12px; font-size:18px; }
  .book main p, .book main ol, .book main ul { font-size:15px; line-height:1.8; }
  .book main .steps li { padding-left:38px; }
  .book main .kbdsw button { min-height:44px; padding:8px 12px; }
  .book main .faq .ans { font-size:14.5px; }
}
