:root { --public-header-height: 62px }
@media (max-width:760px) { :root { --public-header-height: 56px } }
* { box-sizing: border-box }
body { margin: 0; color: #282439; background: #faf9f6; font: 17px/1.55 'Roboto Variable', Arial, sans-serif }
main { max-width: 1080px; margin: auto; padding: 0 28px }
a { color: #473a85; text-underline-offset: 4px }
a:focus-visible, summary:focus-visible { outline: 3px solid #6559bb; outline-offset: 3px }
main { padding-bottom: 72px }
h1 { margin: 52px 0 12px; font-size: clamp(34px,5vw,58px); line-height: 1.06; letter-spacing: -.035em }
.lead { max-width: 690px; font-size: 20px; color: #585364; margin: 0 0 22px }
main, .topics { max-width: 1360px }
.guide-bar { position: sticky; top: var(--public-header-height); z-index: 5; background: #faf9f6; border-bottom: 1px solid #dedbd5 }
.topics { margin: auto; padding: 8px 28px; display: flex; gap: 3px }
.topics a { display: grid; place-items: center; min-height: 42px; padding: 6px 20px; border-radius: 9px; color: #474259; text-decoration: none; font-weight: 550; line-height: 1.25 }
.topics a:hover, .contents a:hover { background: #e8e4ef }
.topics a[aria-current] { background: #473a85; color: #fff }
.chapter { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: clamp(24px,4vw,58px); align-items: start }
.chapter[hidden] { display: none }
.chapter-menu { position: sticky; top: calc(var(--public-header-height) + 72px); max-height: calc(100dvh - var(--public-header-height) - 84px); overflow: auto; margin-top: 36px; padding: 10px; border-radius: 12px; border: 1px solid #ddd9e5; background: #f3f1f6 }
.chapter-menu summary { padding: 6px 10px; cursor: pointer; color: #4b4559; font-size: 15px; font-weight: 650 }
.contents { display: grid; gap: 2px; padding-top: 6px }
.contents a { padding: 7px 10px; border-radius: 7px; text-decoration: none; color: #48425c; font-size: 15px; line-height: 1.35 }
.contents a[aria-current] { background: #e3deee; color: #3f326b; font-weight: 650 }
.chapter-text { min-width: 0 }
.chapter-text h1 { margin-top: 42px }
.chapter-text section[id] { scroll-margin-top: calc(var(--public-header-height) + 72px) }
.next-topic { margin: 12px 0 0; padding-top: 18px; border-top: 1px solid #d8d4cd }
@media(max-width:860px) {
  .topics { padding: 6px 12px }
  .topics a { padding: 5px 12px; font-size: 15px }
  .chapter { display: block }
  .chapter-menu { z-index: 4; top: calc(var(--public-header-height) + 55px); margin: 0 -2px; padding: 3px 6px; background: #f3f1f6; border-radius: 0 0 10px 10px; max-height: min(62dvh,520px) }
  .chapter-menu summary { padding: 10px }
  .contents { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 0 0 6px }
  .contents a { display: flex; align-items: center; min-height: 42px }
  .chapter-text h1 { margin-top: 28px }
  .chapter-text section[id] { scroll-margin-top: calc(var(--public-header-height) + 120px) }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth }
}
.examples { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(210px,100%),1fr)); gap: 20px; margin-top: 20px; align-items: start }
.examples img { max-width: 270px }
.examples p { margin: 8px 0 12px }
h3 { margin: 0; font-size: 19px }
.compact img { width: min(100%,220px) }
.actions { margin: 12px 0 0; padding-left: 1.25em }
.actions li + li { margin-top: 9px }
section { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(0,1.15fr); gap: 40px; border-top: 1px solid #d8d4cd; padding: 28px 0; align-items: start }
.step { font-size: 14px; color: #9e3517; font-weight: 650 }
h2 { font-size: 26px; line-height: 1.18; margin: 6px 0 10px; letter-spacing: -.02em }
section p { margin: 0 }
figure { margin: 0; padding: 16px; border: 1px solid #dedbe5; border-radius: 10px; background: #f0eff5 }
figure img { display: block; width: 100%; height: auto; border-radius: 5px }
figcaption { font-size: 14px; margin-top: 9px; color: #555062 }
.wide { display: block }
.wide p { max-width: 750px; margin-bottom: 16px }
.note { margin-top: 16px; padding-left: 14px; border-left: 3px solid #8476a8 }
@media(max-width:700px) { main { padding-inline: 18px } h1 { margin-top: 32px } section { grid-template-columns: 1fr; gap: 16px } figure { padding: 9px } }
.guide-home-link { text-decoration: none; font-size: 16px; color: #534c62 }
.guide-home { max-width: 1232px; margin: auto; padding: 0 36px 64px }
.guide-intro { padding: clamp(34px,6vw,78px) 0 34px }
.guide-intro h1 { margin: 0; max-width: 800px; font-size: clamp(36px,5vw,62px); line-height: 1.06 }
.guide-intro > p { margin: 12px 0 26px; color: #5d5769; font-size: clamp(17px,2vw,21px) }
#topic-search { max-width: 590px }
#topic-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
.guide-search-field { display: flex; align-items: center; gap: 11px; padding: 0 16px; min-height: 50px; border: 1px solid #cec8da; border-radius: 12px; background: #fff }
.guide-search-field:focus-within { outline: 2px solid #6559bb; outline-offset: 2px }
.guide-search-field svg, .directory-choice svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.guide-search-field svg { color: #716787 }
.guide-search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #282439; font: inherit }
/* A single catalog: section selector and the topics it contains. */
.directory { display: grid; grid-template-columns: minmax(200px, .62fr) minmax(0,2fr); grid-template-rows: repeat(var(--chapter-count, 8), minmax(46px, auto)); gap: 3px 32px; padding: 24px; border: 1px solid #dcd7e1; border-radius: 16px; background: #fff }
.directory-group { display: contents }
.directory-choice { display: flex; gap: 12px; align-items: center; grid-column: 1; width: 100%; padding: 10px 14px; border: 0; border-radius: 10px; cursor: pointer; background: transparent; color: #514b5d; text-align: left; font: 550 17px/1.25 'Roboto Variable',Arial,sans-serif }
.directory-choice svg { width: 22px; height: 22px; flex: none }
.directory-choice:hover { background: #f3f0f7 }
.directory-choice[aria-expanded="true"] { background: #473a85; color: white }
.directory-choice:focus-visible { outline: 2px solid #6559bb; outline-offset: 2px }
.choice-arrow { margin-left: auto; font-size: 22px; font-weight: 400 }
.directory-panel { grid-column: 2; grid-row: 1 / -1; min-width: 0; padding: 6px 2px 8px 30px; border-left: 1px solid #e6e1e9 }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 20px }
.panel-heading h2 { margin: 0; font-size: clamp(23px,2.25vw,31px) }
.panel-heading > a { white-space: nowrap; font-size: 15px; text-underline-offset: 3px }
.index-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px }
.index-columns h3 { font-size: 14px; line-height: 1.4; font-weight: 550; color: #655c73; margin: 0 0 5px }
.index-columns a { display: flex; justify-content: space-between; gap: 10px; align-items: center; min-height: 45px; padding: 8px 2px; font-size: 16px; line-height: 1.35; color: #322c40; border-bottom: 1px solid #e8e4ec; text-decoration: none }
.index-columns a:hover { color: #473a85; text-decoration: underline }
.index-columns a span { color: #786b8c; font-size: 20px }
.guide-search-results { max-width: 880px }
#guide-search-status { color: #574e64 }
#guide-matches { padding: 0; margin: 0; list-style: none }
#guide-matches a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: center; padding: 12px 2px; border-top: 1px solid #e2dce7; color: #392e58; text-decoration: none }
#guide-matches a:hover { background: #f2eff7 }
#guide-matches small { color: #625a6c }
.topics .all-topics { margin-right: auto; font-size: 15px; font-weight: 400 }
[hidden] { display: none !important }
@media(max-width:760px) {
  .guide-home { padding: 0 18px 36px }
  .guide-intro { padding: 30px 0 22px }
  .directory { display: block; padding: 6px 12px }
  .directory-group { display: block; border-bottom: 1px solid #e3deea; padding: 5px 0 }
  .directory-group:last-child { border: 0 }
  .directory-choice { min-height: 46px; padding-inline: 10px }
  .directory-choice[aria-expanded="true"] .choice-arrow { transform: rotate(90deg) }
  .directory-panel { padding: 12px 10px 8px; border: 0 }
  .panel-heading { justify-content: flex-end; padding-bottom: 12px }
  .panel-heading h2 { display: none }
  .index-columns { gap: 14px }

}
@media(max-width:600px) {
  .topics { gap: 1px; padding-inline: 6px; justify-content: space-between }
  .topics a, .topics .all-topics { padding-inline: 7px; font-size: 14px }
}

@media(max-width:480px) { .index-columns { grid-template-columns: 1fr } }

/* Keep every chapter reachable as the guide grows. */
.topics:has(.chapter-switch) a:not(.all-topics) { display: none }
.chapter-switch { display: block; max-width: 62%; min-height: 42px; padding: 5px 12px; border: 1px solid #d8d3e1; border-radius: 8px; background: #fff; color: #443879; font: inherit }
