.site-header-inner,
.layout {
  position: relative;
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
  padding-inline: 1.4rem;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2.4rem;
  font-family: var(--font-sans);
  font-size: 0.87rem;
  line-height: 1.45;
}

.brand,
.brand:visited {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.prompt,
.crumb {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
}

.header-actions,
.doc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.header-link,
.raw-link,
.doc-actions a,
.document p > a,
.document li > a,
.document td > a,
.doc-footer a {
  color: var(--link);
  font-family: var(--font-sans);
  font-size: 0.8rem;
}

.live-status,
.status {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.65rem;
  white-space: nowrap;
}

.layout {
  min-height: calc(100vh - 5rem);
  padding-bottom: 3rem;
}

.sidebar {
  margin-top: 2.2rem;
  border-block: 1px solid var(--line);
  padding-block: 0.65rem;
  overflow-x: auto;
  font-family: var(--font-sans);
  font-size: 0.78rem;
}

.sidebar-label,
.sidebar-meta {
  display: none;
}

.toc {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0;
  gap: 1rem;
  list-style: none;
}

.toc li {
  margin: 0;
}

.toc a {
  color: var(--link);
  white-space: nowrap;
}

.toc a[aria-current="true"] {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.document {
  min-width: 0;
  margin-top: 2.4rem;
}

.doc-hero,
.doc-section {
  scroll-margin-top: 2rem;
}

.doc-hero {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.4rem;
}

.eyebrow {
  margin-bottom: 0.7rem;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.doc-hero h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: clamp(2.15rem, 6.5vw, 2.7rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.doc-hero h1 em {
  color: inherit;
  font-style: normal;
  text-decoration: underline;
  text-decoration-color: var(--link);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.lede {
  max-width: 36rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.9rem;
}

.chip {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.67rem;
}

.chip + .chip::before {
  margin-right: 0.65rem;
  color: var(--line-strong);
  content: "·";
}

.chip strong {
  color: var(--text);
  font-weight: 500;
}

.doc-actions {
  margin-top: 0.9rem;
}

.doc-section {
  margin-top: 2.5rem;
}

.doc-section h2 {
  margin: 0 0 0.6rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.doc-section h3 {
  margin: 1.8rem 0 0.4rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.document p,
.document ul,
.document ol {
  max-width: 36rem;
  color: var(--muted);
}

.document p {
  margin: 0.7rem 0 0;
}

.document strong {
  color: var(--text);
  font-weight: 700;
}

.document ul,
.document ol {
  margin: 0.5rem 0 1rem;
  padding-left: 1.35rem;
}

.document li {
  margin: 0.42rem 0;
}

.document :not(pre) > code {
  border-radius: 3px;
  background: var(--code-background);
  padding: 0.08rem 0.28rem;
  color: var(--text);
  font-size: 0.8em;
}

.command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--code-background);
}

.code-label {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
  padding: 0.48rem 0.72rem;
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.command pre {
  min-width: 0;
  margin: 0;
  overflow-x: auto;
  padding: 0.7rem 0.75rem;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.55;
  white-space: pre;
}

.copy-button {
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 0 0.75rem;
  color: var(--link);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.7rem;
}

.copy-button:hover,
.copy-button[data-copied="true"] {
  background: var(--surface-hover);
}

.status-grid,
.path-grid,
.reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1.2rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.status-card,
.path-card,
.reference-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.status-card strong,
.path-card strong,
.reference-card strong {
  font-family: var(--font-sans);
  font-size: 0.86rem;
}

.status-card span,
.path-card span,
.reference-card span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.48;
}

.path-card:hover strong,
.reference-card:hover strong {
  color: var(--link);
}

.micro-label {
  color: var(--subtle) !important;
  font-family: var(--mono);
  font-size: 0.62rem !important;
}

.pipeline {
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.pipeline > div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.62rem 0;
}

.pipeline code {
  color: var(--text);
  font-size: 0.7rem;
}

.pipeline span {
  color: var(--muted);
  font-size: 0.78rem;
}

.callout {
  max-width: 36rem;
  margin-top: 1rem;
  border-left: 2px solid var(--subtle);
  padding: 0.08rem 0 0.08rem 0.9rem;
}

.callout.agent {
  border-left-color: var(--link);
}

.callout.danger {
  border-left-color: var(--red);
}

.callout strong {
  font-family: var(--font-sans);
  font-size: 0.82rem;
}

.callout p {
  margin-top: 0.28rem;
  font-size: 0.84rem;
}

.table-wrap {
  margin-top: 0.9rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.62rem 0.62rem 0.62rem 0;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
}

td {
  color: var(--muted);
}

.traffic-active {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.67rem;
}

.protocol {
  margin-top: 0.9rem;
  border-top: 1px solid var(--line);
  padding: 0;
  list-style: none;
  counter-reset: protocol-step;
}

.protocol li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.7rem;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.62rem 0;
  counter-increment: protocol-step;
}

.protocol li::before {
  color: var(--subtle);
  content: counter(protocol-step) ".";
  font-family: var(--mono);
  font-size: 0.67rem;
}

.doc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.8rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (min-width: 960px) {
  .sidebar {
    position: absolute;
    top: 0;
    left: calc(100% + 3.25rem);
    width: 11rem;
    margin-top: 2.4rem;
    overflow: visible;
    border: 0;
    padding: 0;
  }

  .toc {
    display: block;
    width: auto;
  }

  .toc li {
    margin-bottom: 0.15rem;
  }
}

@media (max-width: 959px) {
  .site-header-inner,
  .layout {
    padding-inline: 1rem;
  }

  .site-header-inner {
    padding-top: 1.25rem;
  }
}

@media (max-width: 600px) {
  .site-header-inner {
    align-items: flex-start;
  }

  .crumb,
  .live-status,
  .status,
  .header-link.secondary {
    display: none;
  }

  .status-grid,
  .path-grid,
  .reference-grid,
  .pipeline > div {
    grid-template-columns: 1fr;
  }

  .pipeline > div {
    gap: 0.2rem;
  }

  .command {
    grid-template-columns: minmax(0, 1fr);
  }

  .copy-button {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 0.58rem 0.72rem;
    text-align: left;
  }

  .doc-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
