body { background: var(--surface); }

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 184px;
  grid-template-areas: "content directory";
  align-items: start;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 28px 72px;
}

.guide {
  grid-area: content;
  min-width: 0;
  color: #263630;
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.guide h1, .guide h2, .guide h3, .guide h4 {
  color: #172d28;
  line-height: 1.45;
  text-wrap: balance;
  scroll-margin-top: 80px;
}

.guide h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 32px);
  letter-spacing: -0.025em;
}

.guide h2 {
  margin: 44px 0 20px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 26px;
}

.guide h3 {
  margin: 32px 0 16px;
  color: var(--teal-dark);
  font-size: 21px;
}

.guide h4 {
  margin: 28px 0 12px;
  font-size: 17px;
  font-weight: 700;
}

.guide p { margin: 0 0 14px; }
.guide strong, .guide .word-bold { font-weight: 700; }
.guide a { color: #1e5ca8; text-decoration: underline; text-underline-offset: 3px; }

.guide blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border: 1px solid #e0e9e5;
  border-radius: 8px;
  background: #f7faf8;
}

.guide blockquote p, .guide blockquote ul, .guide blockquote ol {
  margin-top: 0;
  margin-bottom: 10px;
}

.guide blockquote > :last-child, .guide blockquote li > p:last-child { margin-bottom: 0; }
.guide blockquote li + li { margin-top: 8px; }
.guide blockquote ul, .guide blockquote ol { padding-left: 22px; }
.guide .note-info { border-color: #dce8f2; background: #f4f8fc; }
.guide .note-warning { border-color: #eee1bd; background: #fffaf0; }
.guide .note-success { border-color: #dcebe6; background: #f2f8f5; }
.guide .note-danger { border-color: #f0deda; background: #fcf5f3; }

.guide .word-red { color: #b42318; }
.guide .word-blue { color: #215bb4; }
.guide .word-teal { color: #166b65; }
.guide .word-amber { color: #805b00; }
.guide .word-green { color: #486125; }
.guide .word-navy { color: #17365d; }
.guide .word-large { font-size: 18px; }
.guide .word-underline { text-decoration: underline; text-underline-offset: 3px; }

.guide .word-highlight, .guide .word-blue-highlight, .guide .word-shade {
  padding: 1px 3px;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.guide .word-highlight { background: #ffec9c; }
.guide .word-blue-highlight { color: #fff; background: #255ac1; }
.guide .word-shade { background: #edf1ee; }

.guide .table-scroll { margin: 20px 0; overflow-x: auto; }
.guide table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.65; }
.guide th, .guide td {
  min-width: 104px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.guide th { background: #eaf2ef; color: #29584e; font-weight: 650; }

.price-tables {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.price-tables .table-scroll { margin: 0; }
.price-tables table { font-size: 14px; }
.price-tables th, .price-tables td { min-width: 0; padding: 10px 12px; }
.price-tables th { background: #17365d; color: #fff; }
.price-tables > :nth-child(2) th, .price-tables > :nth-child(3) th { background: #1274a5; }
.price-tables th:last-child { white-space: nowrap; }
.price-tables td:last-child { font-size: 18px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.guide img { display: block; max-width: 100%; height: auto; margin: 20px auto; }
.guide-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.guide-header p { margin-bottom: 6px; }
.guide .cover-image { width: 72px; margin: 0; }
.guide img[src="images/image2.png"], .guide img[src="images/image3.png"], .guide img[src="images/image4.png"] { width: 300px; }
.guide img[src="images/image8.png"] { width: 566px; aspect-ratio: 566 / 229; object-fit: cover; object-position: top; }
.guide pre { overflow-x: auto; padding: 16px; background: #f6fbfa; }

.guide-toc {
  grid-area: directory;
  position: sticky;
  top: 28px;
  min-width: 0;
  font-size: 14px;
}
.guide-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #29584e;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.guide-toc summary::-webkit-details-marker { display: none; }
.guide-toc summary svg { width: 16px; height: 16px; flex: 0 0 auto; }
.guide-toc details[open] summary svg { transform: rotate(180deg); }
.guide-toc nav {
  max-height: calc(100dvh - 120px);
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: #bfd3cb transparent;
}
.guide-toc a { display: block; padding: 8px 12px; border-radius: 5px; color: #50645b; line-height: 1.5; }
.guide-toc .toc-level-2 { margin-top: 10px; color: #29584e; font-weight: 700; }
.guide-toc .toc-level-3 { padding-left: 20px; }
.guide-toc a:hover { background: #f0f6f3; color: #166b65; }
.guide-toc a[aria-current] { background: #e5f1eb; color: #125f51; font-weight: 700; }
.guide-toc summary:focus-visible, .guide-toc a:focus-visible, .guide .table-scroll:focus-visible { outline: 2px solid #29786c; outline-offset: 2px; }
.guide :focus-visible { outline-color: #29786c; }
.guide-layout ::selection { color: #172d28; background: #cde8dc; }

@media (max-width: 959px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "directory" "content";
    gap: 20px;
    padding-top: 0;
  }
  .guide-toc { top: 0; z-index: 5; margin: 0 -28px; background: #fff; }
  .guide-toc summary { min-height: 44px; padding: 10px 28px; }
  .guide-toc nav {
    position: absolute;
    left: 0;
    right: 0;
    max-height: 65dvh;
    padding: 8px 16px 16px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 10px 24px rgba(28, 61, 48, 0.12);
  }
}

@media (max-width: 719px) {
  .guide-layout { padding-right: 20px; padding-left: 20px; }
  .guide-toc { margin-right: -20px; margin-left: -20px; }
  .guide-toc summary { padding-right: 20px; padding-left: 20px; }
  .price-tables { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .guide h1 { font-size: 30px; }
  .guide h2 { font-size: 24px; }
  .guide h3 { font-size: 20px; }
  .guide-header { grid-template-columns: minmax(0, 1fr) 56px; gap: 12px; }
  .guide .cover-image { width: 56px; }
  .guide th, .guide td { padding: 10px 12px; }
  .guide blockquote { padding: 14px 16px; }
}
