.doc-header-inner,
.doc-brand,
.doc-footer {
  display: flex;
  align-items: center;
}

.doc-header-inner,
.doc-footer {
  justify-content: space-between;
  gap: 1.25rem;
}

.doc-header-inner { min-height: 4.6rem; }
.doc-brand { gap: 1rem; }
.doc-brand > span {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font: .88rem var(--mono);
}

.docs-shell {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 52rem);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  justify-content: start;
}

.desktop-topics {
  position: sticky;
  top: 4.6rem;
  max-height: calc(100vh - 4.6rem);
  overflow-y: auto;
  border-inline-end: 1px solid var(--line);
  padding: 3rem 1.3rem 2rem 0;
}

.desktop-topics nav,
.mobile-topics nav {
  display: grid;
  gap: 1.55rem;
}

.topic-group { display: grid; justify-items: start; gap: .36rem; }
.topic-group p {
  margin: 0 0 .25rem;
  color: var(--muted);
  font: 600 .75rem/1.4 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.topic-group a {
  display: block;
  border-inline-start: 2px solid #d8d8d8;
  padding: .25rem .65rem;
  line-height: 1.4;
  font-weight: 500;
}

.topic-group a:hover, .topic-group a:focus-visible {
  border-color: var(--ink);
  background: #eee;
}

.doc-content { min-width: 0; padding: clamp(2.25rem, 5vw, 4.75rem) 0 2.5rem; }
.doc-intro { padding-bottom: 2.25rem; }
.doc-intro h1 { font-size: clamp(2.4rem, 5.5vw, 5rem); letter-spacing: -.075em; }
.doc-intro > p:not(.eyebrow) {
  max-width: 39rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 1.6vw, 1.24rem);
  line-height: 1.6;
}

.mobile-topics { display: none; }
.doc-topic {
  padding: clamp(2rem, 4vw, 3.3rem) 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.doc-topic h2 { font-size: clamp(1.85rem, 3.6vw, 3rem); letter-spacing: -.064em; }
.doc-topic h3 { margin: 1.75rem 0 .65rem; font-size: 1.3rem; letter-spacing: -.038em; }
.doc-topic p, .doc-list { line-height: 1.7; color: #414141; }
.doc-topic p { margin-block: 1rem; }
.doc-topic p:last-child, .doc-topic > :last-child { margin-bottom: 0; }
.doc-topic a, .doc-footer a { color: var(--ink); text-decoration: underline; text-underline-offset: .2rem; }
.doc-topic :is(p, td, th, li) code {
  padding: .09rem .25rem;
  border-radius: .2rem;
  background: #eaeaea;
  color: #222;
}

.doc-code {
  margin: 1.1rem 0;
  border: 1px solid #282828;
  border-radius: .45rem;
  background: #161616;
  color: #f7f7f7;
  overflow: hidden;
}

.doc-code figcaption {
  padding: .55rem 1rem;
  border-bottom: 1px solid #393939;
  color: #c8c8c8;
  font: .79rem/1.5 var(--mono);
}

.doc-code pre {
  margin: 0;
  overflow-x: auto;
  padding: .95rem 1rem 1.1rem;
  line-height: 1.65;
}

.doc-code pre:focus-visible { outline: 2px solid #aaa; outline-offset: -3px; }
.doc-table { margin: 1.1rem 0; border: 1px solid var(--line); border-radius: .4rem; overflow: hidden; }
.doc-table table { width: 100%; border-collapse: collapse; font-size: .94rem; line-height: 1.7; }
.doc-table :is(td, th) {
  border-bottom: 1px solid var(--line);
  padding: .67rem .85rem;
  vertical-align: top;
  text-align: left;
}
.doc-table tbody tr:last-child > * { border-bottom: 0; }
.doc-table thead th { background: #eaeaea; font-weight: 650; }
.doc-table tbody th { width: 31%; background: #f1f1f1; font-weight: 600; }
.doc-table td { background: #fff; }
.doc-list { padding-inline-start: 1.15rem; list-style: disc; }
.doc-list li { margin: .5rem 0; }
.doc-topic details { margin-top: .5rem; border-bottom: 1px solid var(--line); }
.doc-topic details summary { padding: .8rem 0; font-weight: 650; }
.doc-topic details p { margin: 0 0 .85rem; }
.doc-footer { padding: 1.25rem 0 0; border-top: 1px solid var(--line); font-size: .92rem; }

@media (max-width: 52rem) {
  .docs-shell { display: block; }
  .desktop-topics { display: none; }
  .mobile-topics {
    display: block;
    margin-bottom: 1.5rem;
    padding: .7rem 1rem;
    border: 1px solid var(--line);
    border-radius: .4rem;
    background: var(--white);
  }
  .mobile-topics summary { font-weight: 650; }
  .mobile-topics nav { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-top: 1.1rem; }
}

@media (max-width: 30rem) {
  .doc-header-inner { flex-wrap: wrap; gap: .6rem 1rem; padding-block: .65rem; }
  .doc-table :is(th, td) { padding: .45rem .55rem; }
  .doc-brand { gap: .55rem; }
  .doc-brand > span { padding-left: .55rem; }
  .doc-header-inner nav { gap: .7rem; font-size: .84rem; }
}

.doc-entry-links, .recipe-index { display: flex; flex-wrap: wrap; gap: .55rem; }
.doc-entry-links { margin: 1.2rem 0 0; }
.doc-entry-links a, .recipe-index a {
  padding: .42rem .75rem;
  border: 1px solid #ccc;
  border-radius: .35rem;
  background: white;
  color: #222;
  font-size: .88rem;
  text-decoration: none;
}
.doc-entry-links a:first-child { border-color: #222; background: #222; color: white; }
.doc-entry-links a:hover, .recipe-index a:hover { border-color: #222; text-decoration: underline; }
.doc-code figcaption { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.doc-code figcaption button {
  border: 1px solid #626262;
  border-radius: .3rem;
  padding: .25rem .6rem;
  background: transparent;
  color: white;
}
.doc-code figcaption button:hover { background: #383838; }
.doc-recipe { margin-block: 2rem 2.5rem; }
.doc-recipe:last-child { margin-bottom: 0; }
.recipe-preview {
  padding: clamp(1rem, 3vw, 1.7rem);
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: #fff;
  color: #171717;
  font: 1rem/1.5 system-ui, sans-serif;
}
.doc-topic .recipe-source { border-bottom: 0; }
.doc-topic .recipe-source summary { width: fit-content; font-size: .9rem; }
.recipe-source .doc-code { margin-top: 0; }

/* Field guide navigation and the static, searchable topic directory. */
.docs-page .manual-nav { display: block; }
.desktop-topics { scrollbar-width: thin; }
.index-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 0 1.1rem; padding: .65rem .8rem;
  border: 1px solid #262626; border-radius: .35rem; background: #181818; color: white;
}
.shelf { border-bottom: 1px solid var(--line); }
.shelf summary { padding: .6rem .2rem .6rem .15rem; line-height: 1.4; font-weight: 650; }
.shelf > div { display: grid; padding: 0 0 .75rem .1rem; }
.shelf a { padding: .28rem .75rem; border-left: 1px solid #d4d4d4; color: #555; font-weight: 460; }
.shelf a:hover, .shelf a[aria-current] { color: #111; background: #ededed; }
.shelf a[aria-current] { font-weight: 700; border-left: 2px solid #222; }
.doc-brand .back-docs { color: var(--muted); font: .88rem var(--mono); border-left: 1px solid var(--line); padding-left: 1rem; }
.handbook-intro { padding-bottom: 2rem; }
.handbook-intro .doc-entry-links { margin-top: 1.4rem; }
.handbook-intro .doc-entry-links a:first-child { display: inline-flex; align-items: center; gap: .5rem; }
.directory { border-top: 2px solid var(--ink); padding: 1.55rem 0 3rem; }
.directory-title { display: flex; gap: 1rem; justify-content: space-between; align-items: baseline; }
.directory-title h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -.06em; }
.directory-total, .index-count { font: .77rem var(--mono); color: #555; }
.directory form { margin: 1.2rem 0 1.1rem; }
.directory label { display: block; margin-bottom: .45rem; font-size: .85rem; font-weight: 650; }
.search-field { display: flex; align-items: center; gap: .85rem; padding-inline: 1rem; background: white; border: 1px solid #9a9a9a; border-radius: .35rem; }
.search-field:focus-within { outline: 2px solid #141414; outline-offset: 2px; }
.search-field input { min-width: 0; width: 100%; border: 0; padding-block: .85rem; background: transparent; outline: 0; appearance: none; }
.directory output { display: block; margin-top: .45rem; font: .77rem/1.5 var(--mono); color: #545454; }
.directory-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; align-items: start; }
.index-group { border-top: 1px solid #bbb; }
.index-group summary { display: flex; align-items: center; gap: .6rem; padding: .9rem .3rem; line-height: 1.3; }
.index-group summary > span:first-child { font-size: 1.04rem; font-weight: 650; letter-spacing: -.02em; }
.index-count { margin-left: auto; font-size: .72rem; }
.index-group > .site-disclosure::after { margin-inline-start: 0; }
.index-group summary:hover, .index-group[open] > summary { background: #f0f0f0; }
.index-entries { display: grid; gap: .12rem; padding: .35rem 0 .9rem; }
.index-entries a { font-size: .92rem; color: #404040; padding: .32rem .55rem; border-left: 1px solid #cecece; }
.index-entries a:hover { border-color: #161616; text-decoration: underline; }
.detail-content .doc-intro { padding-bottom: 1.8rem; }
.detail-content .doc-intro .eyebrow { display: block; }
.detail-content .doc-intro .eyebrow a { text-decoration: underline; text-underline-offset: .23rem; }
.topic-body { padding-top: 2rem; border-top: 2px solid #171717; }
.topic-body .guide-step + .guide-step, .topic-body .sample-section + .sample-section { margin-top: 2.25rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.topic-body h2 { font-size: clamp(1.4rem, 2.3vw, 2.05rem); letter-spacing: -.055em; }
.topic-body .reference-preview { margin-top: 1.15rem; contain: layout paint; isolation: isolate; overflow: auto; }
.class-table { overflow: auto; }
.class-table table { table-layout: fixed; min-width: 0; }
.class-table th:first-child { width: 36%; }
.class-table tbody code { padding: 0; background: transparent; white-space: pre-wrap; overflow-wrap: anywhere; }
.adjacent-topics { display: flex; justify-content: space-between; gap: 1rem; margin-block: 1rem 2rem; }
.adjacent-topics a { flex: 1; border-top: 1px solid #999; padding-top: .7rem; }
.adjacent-topics a + a { text-align: right; }
.adjacent-topics small { display: block; color: var(--muted); font: .7rem/1.7 var(--mono); }
@media (max-width: 52rem) {
  .detail-content .mobile-topics { margin-bottom: 2rem; }
  .docs-page .mobile-topics nav { display: block; }
  .index-nav { margin-bottom: .25rem; }
}
@media (max-width: 35rem) {
  .directory-groups { grid-template-columns: 1fr; }
  .doc-intro h1 { overflow-wrap: anywhere; }
  .detail-content .doc-intro .eyebrow { letter-spacing: .07em; }
}
.directory output:empty { display: none; }
.docs-page .mobile-topics .mobile-index { display: grid; gap: .25rem 1rem; }
.mobile-index a { padding: .3rem 0; }

.search-field > img { flex: none; width: 1.1rem; height: 1.1rem; }
.doc-code figcaption button::before { content: ""; display: inline-block; width: .85rem; height: .85rem; margin-right: .35rem; vertical-align: -.12rem; background: url("./curated/copy.svg") center / contain no-repeat; filter: invert(1); }
