/* rctp.dev chrome: header, section tabs, search dialog and theme toggle. Shared by every page, including the injected
   core concepts page, so every selector is prefixed c- and colours come only from the page's tokens. */
:root {
  --c-h: 56px;
}
.c-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.c-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.c-bar .c-in {
  height: var(--c-h);
}
.c-bar a,
.c-tabs a {
  text-decoration: none;
}
.c-logo {
  font: 700 17px/1 var(--sans);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-right: auto;
  white-space: nowrap;
}
.c-pill {
  font: 500 11px/1 var(--mono);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  margin-left: 8px;
  vertical-align: 2px;
}
.c-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 240px;
  height: 36px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font: 14px var(--sans);
  cursor: pointer;
}
.c-search:hover {
  border-color: var(--muted);
}
.c-search svg,
.c-icon svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.c-search span {
  flex: 1;
  text-align: left;
}
.c-search kbd {
  font: 500 11.5px/1 var(--mono);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--muted);
  background: var(--sunk);
}
.c-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.c-icon:hover,
.c-gh:hover {
  color: var(--ink);
  background: var(--sunk);
}
.c-gh {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--muted);
  font: 500 14px var(--sans);
  white-space: nowrap;
}
.c-gh svg {
  width: 20px;
  height: 20px;
}
.c-tabs {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.c-tabs .c-in {
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.c-tabs a {
  padding: 11px 10px 10px;
  color: var(--muted);
  font: 500 14.5px var(--sans);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.c-tabs a:hover {
  color: var(--ink);
}
.c-tabs a.on {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
@media (max-width: 720px) {
  .c-pill,
  .c-gh span,
  .c-search span,
  .c-search kbd {
    display: none;
  }
  .c-search {
    width: 36px;
    padding: 0;
    justify-content: center;
    border: 0;
    background: none;
  }
  .c-in {
    gap: 4px;
  }
}

/* Search dialog */
.c-dlg {
  width: min(680px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 80px));
  margin: 64px auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.25);
  overflow: hidden;
}
.c-dlg[open] {
  display: flex;
  flex-direction: column;
}
.c-dlg::backdrop {
  background: rgb(0 0 0 / 0.35);
}
.c-dlg input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
  font: 16px var(--sans);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.c-dlg ul {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
}
.c-dlg li a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.c-dlg li a.sel,
.c-dlg li a:hover {
  background: var(--accent-soft);
}
.c-dlg .h {
  font-weight: 600;
  font-size: 14.5px;
}
.c-dlg .p {
  font-size: 12.5px;
  color: var(--muted);
  margin-left: 6px;
}
.c-dlg .x {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.c-dlg mark {
  background: none;
  color: var(--accent);
  font-weight: 600;
}
.c-dlg .empty {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

/* The core concepts page keeps its own layout; move its sticky contents below the header. */
.c-cc nav.toc {
  top: var(--c-h);
  max-height: calc(100vh - var(--c-h));
  padding-top: 24px;
}
.c-cc main {
  padding-top: 24px;
}
.c-cc h2,
.c-cc h3 {
  scroll-margin-top: calc(var(--c-h) + 16px);
}
