.guide-page {
  background: radial-gradient(ellipse 60rem 36rem at 75% 0, var(--surface), transparent), var(--bg);
  font-size: 1rem;
}

.guide-width {
  width: min(100% - clamp(2rem, 6vw, 6rem), 85rem);
  margin-inline: auto;
}

.guide-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg-soft) 90%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.guide-header-inner,
.guide-header-links {
  display: flex;
  align-items: center;
  gap: clamp(.625rem, 2.5vw, 1.625rem);
}

.guide-header-inner { min-height: 4.5rem; justify-content: space-between; }
.guide-brand { flex-shrink: 0; }
.guide-brand img { width: clamp(6.75rem, 11vw, 9rem); height: auto; }
.guide-header-links { color: var(--text-dim); font-size: .875rem; }
.guide-header-links a:hover { color: var(--text); }
.guide-header-links [aria-current] { color: var(--accent-hi); }

.guide-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem clamp(1.75rem, 4vw, 4rem);
  padding-top: clamp(1.5rem, 4vw, 3.5rem);
}

.guide-layout > * { grid-column: 2; min-width: 0; }
.guide-layout > .guide-rail { grid-column: 1; grid-row: 1 / 5; align-self: stretch; }
.guide-rail { border-right: 1px solid var(--border); padding-right: clamp(.75rem, 2vw, 1.5rem); }
.guide-outline {
  position: sticky;
  top: 6rem;
  display: grid;
  gap: 1.5rem;
  max-height: calc(100dvh - 7rem);
  overflow: auto;
  padding: .25rem;
}

.guide-outline p {
  margin: 0 0 .375rem .625rem;
  color: var(--text);
  font-weight: 650;
  font-size: .875rem;
}
.guide-outline ul, .guide-search-results ul { list-style: none; padding: 0; margin: 0; }
.guide-outline a {
  display: block;
  padding: .375rem .625rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: .875rem;
}
.guide-outline a:hover { color: var(--text); background: var(--surface-hover); }
.guide-outline a[aria-current="location"] { color: var(--accent-hi); background: var(--surface-selected); }

.guide-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.75rem);
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at 100% 100%, var(--accent-soft), transparent 62%),
    linear-gradient(130deg, var(--bg-soft), var(--surface));
}

.guide-hero h1 { font-size: clamp(2.25rem, 4.2vw, 4.25rem); line-height: 1; text-wrap: balance; }
.guide-hero p { margin: 1rem 0 0; max-width: 36ch; color: var(--text-dim); }
.guide-hero-actions { display: flex; flex-wrap: wrap; gap: .625rem; margin-top: 1.375rem; }
.guide-hero-actions .btn { padding-inline: .875rem; }
.guide-hero-media {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  box-shadow: 0 20px 45px -16px var(--palette-ink), 0 0 38px -18px var(--accent);
}

.guide-hero-media img, .guide-shot img { width: 100%; height: auto; }

.guide-search-label { display: block; margin-bottom: .5rem; color: var(--text); font-size: .875rem; font-weight: 650; }
.guide-search-box { position: relative; }
.guide-search-icon {
  position: absolute;
  inset: 50% auto auto 1.125rem;
  width: .8125rem;
  height: .8125rem;
  border: 2px solid var(--accent);
  border-radius: 50%;
  transform: translateY(-60%);
  pointer-events: none;
}
.guide-search-icon::after {
  content: "";
  position: absolute;
  inset: auto -.31rem -.15rem auto;
  width: .375rem;
  height: .125rem;
  background: var(--accent);
  transform: rotate(45deg);
}
.guide-search input {
  width: 100%;
  min-height: 3rem;
  padding: .625rem 1rem .625rem 2.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
}
.guide-search input::placeholder { color: var(--muted); }
.guide-search-results {
  margin-top: .5rem;
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.guide-search-status { margin: .125rem .625rem .25rem; color: var(--muted); font-size: .875rem; }
.guide-search-results a { display: block; padding: .5rem .625rem; border-radius: var(--radius-sm); }
.guide-search-results a:hover, .guide-search-results a:focus-visible { background: var(--surface-hover); }
.guide-search-results span { display: block; color: var(--text-dim); font-size: .875rem; }

.guide-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.guide-shortcuts a {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.guide-shortcuts a:hover { transform: translateY(-2px); border-color: var(--accent-border); background: var(--surface); }
.guide-shortcuts img { flex-shrink: 0; margin-top: .125rem; }
.guide-shortcuts strong, .guide-shortcuts small { display: block; }
.guide-shortcuts small { color: var(--text-dim); font-size: .875rem; }

.guide-chapter { padding-block: clamp(1.75rem, 4vw, 3.25rem); border-bottom: 1px solid var(--border); }
.guide-chapter h2 { width: fit-content; font-size: clamp(1.625rem, 3vw, 2.5rem); }
.guide-summary { margin: .625rem 0 1.25rem; color: var(--text-dim); font-size: 1.0625rem; }
.guide-steps { display: grid; gap: .9rem; max-width: 80ch; margin: 0; padding-left: 1.5rem; color: var(--text-dim); }
.guide-steps li { padding-left: .375rem; }
.guide-steps li::marker { color: var(--accent-hi); font-weight: 700; font-variant-numeric: tabular-nums; }
.guide-steps strong, .guide-note strong { color: var(--text); }
.guide-chapter :is(li, aside) a, .guide-footer a { color: var(--accent-hi); text-decoration: underline; text-underline-offset: .22em; }
.guide-chapter :is(li, aside) a:hover, .guide-footer a:hover { color: var(--text); }

.guide-note {
  margin-top: 1.375rem;
  padding: .875rem 1rem;
  border: 1px solid var(--accent-border);
  border-left: .1875rem solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text-dim);
}
.guide-shot { max-width: 54rem; margin: 1.5rem 0 0; }
.guide-shot a { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.guide-shot a:hover { border-color: var(--accent-border); }
.guide-shot figcaption { margin-top: .5rem; color: var(--muted); font-size: .875rem; }
.guide-task-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.375rem; align-items: start; }
.guide-shot-portrait { margin-top: 0; }

.guide-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0; }
.guide-facts div { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
.guide-facts dt { color: var(--text); font-weight: 650; }
.guide-facts dd { margin: .25rem 0 0; color: var(--text-dim); }

.guide-faq { display: grid; gap: .625rem; }
.guide-faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); }
.guide-faq details[open] { border-color: var(--accent-border); }
.guide-faq summary { padding: .875rem 1rem; cursor: pointer; font-weight: 600; }
.guide-faq summary::marker { color: var(--accent-hi); }
.guide-faq p { color: var(--text-dim); padding: 0 1rem 1rem; margin: 0; }
.guide-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.5rem 0 2rem; font-size: .875rem; }

@media (max-width: 61rem) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-layout > *, .guide-layout > .guide-rail { grid-area: auto; }
  .guide-rail { padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); }
  .guide-outline { position: static; max-height: none; overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
}

@media (max-width: 41rem) {
  .guide-header-inner { min-height: 4rem; }
  .guide-header-demo { display: none; }
  .guide-header-links .btn { padding-inline: .625rem; }
  .guide-hero, .guide-shortcuts, .guide-task-layout, .guide-facts { grid-template-columns: minmax(0, 1fr); }
  .guide-hero { padding: 1.25rem; }
  .guide-shot-portrait { max-width: 25rem; }
}

@media (max-width: 23rem) {
  .guide-header-inner { gap: .5rem; }
  .guide-header-links { gap: .5rem; }
  .guide-header-links [aria-current] { display: none; }
}
