.cbt-theme .cbt-header .cbt-sourcing-entry {
  display: flex;
  align-items: center;
}

.cbt-theme .cbt-header .cbt-sourcing-index {
  padding-inline-end: 4px;
}

.cbt-theme .cbt-header .cbt-sourcing-fly {
  position: static;
}

.cbt-theme .cbt-header .cbt-sourcing-fly > summary {
  display: grid;
  place-items: center;
  inline-size: 30px;
  min-block-size: 44px;
  padding: 0;
}

.cbt-theme .cbt-header .cbt-sourcing-panel {
  inset-block-start: 100%;
  inset-inline: 50% auto;
  inline-size: min(100%, 936px);
  min-inline-size: 0;
  max-block-size: min(70vh, 620px);
  overflow: auto;
  padding: 18px 22px;
  border-radius: 0 0 7px 7px;
  transform: translateX(-50%);
}

.cbt-sourcing-panel .cbt-sourcing-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-block-size: 44px;
  padding-inline: 11px;
  color: var(--cbt-ink);
  background: #eaf1f5;
  font-weight: 700;
}

.cbt-sourcing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 15px 24px;
  margin-block: 14px 16px;
}

.cbt-theme .cbt-header .cbt-sourcing-category > summary {
  justify-content: space-between;
  gap: 8px;
  min-block-size: 35px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--cbt-line);
  background: none;
  color: var(--cbt-ink);
  font-size: 14px;
  line-height: 1.3;
  white-space: normal;
}

.cbt-sourcing-category > summary::after {
  flex: none;
}

.cbt-theme .cbt-header .cbt-sourcing-category:not([open]) > summary::after {
  transform: rotate(45deg) translateY(-2px);
}

.cbt-theme .cbt-header .cbt-sourcing-category > summary:hover {
  background: #eaf1f5;
}

.cbt-sourcing-category ul {
  margin: 3px 0 0;
  padding: 0;
  list-style: none;
}

.cbt-sourcing-category a,
.cbt-sourcing-reference a {
  font-size: 14px;
  line-height: 1.35;
}

.cbt-sourcing-reference {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  padding-top: 8px;
  border-top: 1px solid var(--cbt-line);
}

@media (max-width: 950px) {
  .cbt-theme .cbt-header .cbt-sourcing-entry {
    display: block;
    position: relative;
  }

  .cbt-theme .cbt-header .cbt-sourcing-index {
    position: absolute;
    inset: 0 44px auto 0;
    min-block-size: 44px;
  }

  .cbt-theme .cbt-header .cbt-sourcing-fly > summary {
    inline-size: 44px;
    margin-inline-start: auto;
    border-inline-start: 1px solid var(--cbt-line);
  }

  .cbt-theme .cbt-header .cbt-sourcing-panel {
    position: static;
    inline-size: auto;
    max-block-size: none;
    margin-inline-start: 10px;
    padding: 6px 6px 9px;
    overflow: visible;
    transform: none;
  }

  .cbt-sourcing-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-block: 8px 10px;
  }

  .cbt-theme .cbt-header .cbt-sourcing-category > summary,
  .cbt-sourcing-category a,
  .cbt-sourcing-reference a {
    min-block-size: 44px;
  }

  .cbt-theme .cbt-header .cbt-sourcing-panel li > a,
  .cbt-sourcing-reference a {
    display: flex;
    align-items: center;
  }

  .cbt-sourcing-reference {
    display: grid;
    gap: 0;
  }
}

/* The guide label and chevron share one disclosure. */
.cbt-theme .cbt-header .cbt-guides-entry > .cbt-sourcing-fly > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  inline-size: auto;
  padding-inline: 11px;
}

/* The guide directory has its own light hero background. */
.cbt-guide #p25-s01.cbt-hero::after { content: none; }

.cbt-guide #p25-s01 .cbt-actions a.cbt-action {
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding: 8px 14px;
  border-radius: 4px;
  text-decoration: none;
}

.cbt-guide #p25-s01 .cbt-actions a.cbt-secondary { border: 1px solid #507074; }
.cbt-guide #p25-s01 .cbt-actions a.cbt-action::after { content: none; }

@media (max-width: 950px) {
  .cbt-theme .cbt-header .cbt-guides-entry > .cbt-sourcing-fly > summary {
    inline-size: 100%;
    justify-content: space-between;
    margin-inline: 0;
    border-inline-start: 0;
  }

  .cbt-theme .cbt-header .cbt-menu:has(> .cbt-guides-entry > details[open]) {
    max-height: calc(100dvh - 104px);
    overscroll-behavior: contain;
  }
}
