/* Guide page surfaces and chapter navigation. */
.handbook-shell {
  --guide-reading-width: 1120px;
  --page-edge: clamp(24px, 6vw, 96px); /* footer side margin */
  --guide-contents-height: 62px;
  --guide-safe-bottom: env(safe-area-inset-bottom, 0px);
  --guide-bottom-clearance: calc(var(--guide-contents-height) + var(--guide-safe-bottom));
  --guide-reading-inset: max(var(--page-edge), calc((100% - var(--guide-reading-width)) / 2));
}

.handbook-shell .guide-reader {
  display: block;
  padding: 0;
  border: 0;
}

.guide-reader > .articles { container: none; }
.guide-reader .chapter {
  container: handbook-article / inline-size;
  padding: clamp(38px, 6vw, 88px) var(--guide-reading-inset);
  background: var(--paper);
}
.guide-reader :is(#workflow, #faq) { background: #fff; }
.guide-reader #using-memory { padding: 0 0 clamp(38px, 6vw, 88px); }
.guide-reader #using-memory > .memory-change-band {
  container: handbook-article / inline-size;
  padding: clamp(32px, 5vw, 74px) var(--guide-reading-inset);
}
.guide-reader #using-memory > .topic {
  container: handbook-article / inline-size;
  width: min(var(--guide-reading-width), calc(100% - 2 * var(--page-edge)));
  margin-inline: auto;
}
.guide-reader .chapter.contact {
  border-radius: 0;
  background: #20231f;
}

/* The contents bar slides away once the footer is in view, so the page needs no bottom clearance. */
html:has(.handbook-shell):not(.handbook-embedded) {
  scroll-padding-block-end: calc(62px + env(safe-area-inset-bottom, 0px) + 10px);
}
.handbook-embedded .guide-contents-bar { display: none; }

.guide-contents-bar {
  --guide-nav-accent: var(--product-accent, #50b965);
  position: fixed;
  z-index: 8;
  inset-inline: 0;
  inset-block-end: 0;
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  padding-block-end: var(--guide-safe-bottom);
  border-block-start: 1px solid #252725;
  background: #000;
  color: #bfc3bf;
  font-size: var(--site-menu-font-size);
}
.guide-contents-bar__inner {
  position: relative;
  container-type: inline-size;
  max-width: var(--guide-reading-width);
  min-height: calc(var(--guide-contents-height) - 1px);
  margin-inline: auto;
}
.guide-contents-bar__list {
  display: flex;
  align-items: stretch;
  gap: clamp(10px, 1.8vw, 24px);
  min-width: 0;
  min-height: 49px;
  margin: 0;
  padding: 0 max(16px, 2cqi);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  list-style: none;
}
.guide-contents-bar__list::-webkit-scrollbar { display: none; }
.guide-contents-bar__list > li { flex: 1 0 max-content; }
.guide-contents-bar__chapter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-height: 49px;
  padding-inline: 3px;
  color: inherit;
  font-size: inherit;
  font-weight: 500;
  white-space: nowrap;
}
.guide-contents-bar__chapter span {
  font-size: .82em;
  font-variant-numeric: tabular-nums;
}
.guide-contents-bar__chapter:hover { color: #eee; }
.guide-contents-bar__chapter[aria-current="location"] {
  position: relative;
  z-index: 2;
  color: var(--guide-nav-accent);
  font-weight: 730;
}
.guide-contents-bar__chapter:focus-visible {
  position: relative;
  z-index: 2;
  outline: 2px solid var(--guide-nav-accent);
  outline-offset: -3px;
}

/* Reuse the tool strip's gradient fade with the header's masked backdrop blur. */
.guide-contents-bar__inner::before,
.guide-contents-bar__inner::after {
  content: "";
  display: none;
  position: absolute;
  z-index: 1;
  inset-block-start: 0;
  inline-size: clamp(22px, 7.5cqi, 35px);
  block-size: 49px;
  pointer-events: none;
  background: linear-gradient(var(--guide-fade-direction), #000, rgb(0 0 0 / .22));
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(var(--guide-fade-direction), #000, transparent);
  mask-image: linear-gradient(var(--guide-fade-direction), #000, transparent);
}
.guide-contents-bar__inner::before { inset-inline-start: 0; --guide-fade-direction: to right; }
.guide-contents-bar__inner::after { inset-inline-end: 0; --guide-fade-direction: to left; }
.guide-contents-bar__inner[data-scroll-start]::before,
.guide-contents-bar__inner[data-scroll-end]::after { display: block; }

.guide-contents-bar__progress {
  position: relative;
  block-size: 3px;
  margin-inline: max(16px, 2cqi);
  background: #383c38;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 calc(100% / 6 - 2px), transparent calc(100% / 6 - 2px) calc(100% / 6));
  mask-image: repeating-linear-gradient(90deg, #000 0 calc(100% / 6 - 2px), transparent calc(100% / 6 - 2px) calc(100% / 6));
}
.guide-contents-bar__progress::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--guide-nav-accent);
  transform: scaleX(var(--guide-reading-progress, 0));
  transform-origin: left center;
  transition: transform 90ms linear;
}
@media (prefers-reduced-motion: reduce) {
  .guide-contents-bar__progress::before { transition: none; }
}
@media (forced-colors: active) {
  .guide-contents-bar { border-color: CanvasText; }
  .guide-contents-bar__chapter[aria-current="location"] { text-decoration: underline; }
  .guide-contents-bar__inner[data-scroll-start]::before,
  .guide-contents-bar__inner[data-scroll-end]::after { display: none; }
  .guide-contents-bar__progress { background: GrayText; forced-color-adjust: none; }
  .guide-contents-bar__progress::before { background: Highlight; }
}

.cover-copy .title-wordmark {
  width: auto;
  height: .76em;
  vertical-align: -.015em;
}
.guide-contents-bar { transition: transform 240ms ease-out, visibility 0s linear 0s; }
.guide-contents-bar[inert] {
  visibility: hidden;
  transform: translateY(100%);
  transition: transform 240ms ease-in, visibility 0s linear 240ms;
}
@media (prefers-reduced-motion: reduce) {
  .guide-contents-bar { transition: none; }
}
/* 2026-12-02: every page column uses the footer column (same width and side margins as the footer and the home page). */
@media (max-width: 660px) { .handbook-shell { --page-edge: 24px; } }
@media (max-width: 370px) { .handbook-shell { --page-edge: 18px; } }
