.code-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
}

.code-sidebar {
  position: sticky;
  top: 28px;
  align-self: start;
  min-height: 0;
  max-height: calc(100vh - 28px);
  padding: 30px 18px;
  overflow-y: auto;
  background: #f7f9fc;
  border-right: 1px solid #dce4ef;
}

.code-sidebar-heading {
  display: grid;
  gap: 5px;
  padding: 0 8px 25px;
}

.code-sidebar-heading span,
.code-sidebar-label,
.code-eyebrow {
  color: #55749e;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.code-sidebar-heading strong {
  color: var(--text-primary);
  font-family: "Montserrat", "Inter", sans-serif;
  font-size: 1.12rem;
}

.code-sidebar-label { padding: 0 8px 9px; }
.code-sidebar-label-secondary { grid-column: 1 / -1; margin-top: 14px; }

.code-metric-nav { display: grid; gap: 4px; }
.code-metric-nav a {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 9px;
  color: #4c5d73;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.code-metric-nav a span {
  color: #8ca0b8;
  font-size: 0.66rem;
  font-weight: 700;
}
.code-metric-nav a:hover,
.code-metric-nav a:focus-visible {
  color: var(--text-primary);
  background: #eef3f8;
  outline: none;
}
.code-metric-nav a.is-active {
  color: #087c54;
  background: #e8f5ef;
  border-color: #b9dece;
}
.code-metric-nav a.is-active span { color: #0d8f5f; }

.code-document {
  width: 100%;
  min-width: 0;
  padding: 38px clamp(24px, 5vw, 76px) 64px;
}
.metric-document { width: min(100%, 980px); }
.metric-document[hidden] { display: none; }
.metric-document h1 {
  margin: 6px 0 8px;
  color: var(--text-primary);
  font-size: clamp(1.7rem, 4vw, 2.45rem);
}
.metric-document > p:not(.code-eyebrow) {
  max-width: 720px;
  margin: 0 0 26px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}
.metric-document pre {
  overflow-x: auto;
  margin: 0;
  padding: 24px 26px;
  color: #d9e2f0;
  background: #101827;
  border: 1px solid #24324a;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(24, 47, 78, 0.13);
  font: 13px/1.8 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre;
  scrollbar-color: #51617a #101827;
}

@media (max-width: 700px) {
  .code-shell { grid-template-columns: 1fr; }
  .code-sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    padding: 18px 14px;
    border-right: 0;
    border-bottom: 1px solid #dce4ef;
  }
  .code-sidebar-heading { padding-bottom: 14px; }
  .code-metric-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .code-document { padding: 26px 14px 44px; }
}

/* Dark telemetry code reference. */
.code-sidebar { background: #0d0f14; border-color: #29303a; }
.code-sidebar-heading span,
.code-sidebar-label,
.code-eyebrow { color: #52dc80; }
.code-sidebar-heading strong,
.metric-document h1 { color: #f4f6f8; }
.code-metric-nav a { color: #a5aeba; }
.code-metric-nav a span { color: #687b6d; }
.code-metric-nav a:hover,
.code-metric-nav a:focus-visible { color: #edf1f4; background: #1c2129; }
.code-metric-nav a.is-active { color: #67ff9b; background: #20252d; border-color: #4a5662; }
.code-metric-nav a.is-active span { color: #35e875; }
.metric-document > p:not(.code-eyebrow) { color: #b0b9c4; }
.metric-document pre { color: #e4e9ee; background: #090a0d; border-color: #2f3641; box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42), inset 0 1px rgba(32, 223, 104, 0.035); scrollbar-color: #48525e #090a0d; }
