.repo-page h1 {
  font-size: 64px;
}

.repo-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.repo-snapshot article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 6px;
  background: var(--surface);
}

.repo-snapshot article:nth-child(2n) {
  border-top-color: var(--blue);
}

.repo-snapshot strong,
.repo-snapshot span,
.repo-snapshot code {
  display: block;
  overflow-wrap: anywhere;
}

.repo-snapshot strong {
  margin-bottom: 5px;
}

.repo-snapshot span {
  color: var(--muted);
  font-size: 13px;
}

.repo-tree-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 12px;
  align-items: start;
}

.test-framework-layout {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.test-framework-layout table {
  min-width: 650px;
}

.repo-tree-panel pre {
  max-height: 980px;
}

.repo-tree-panel .tree-root,
.repo-tree-panel .tree-contract,
.repo-tree-panel .tree-test,
.repo-tree-panel .tree-tool {
  font-weight: 800;
}

.repo-tree-panel .tree-root { color: var(--teal); }
.repo-tree-panel .tree-contract { color: var(--blue); }
.repo-tree-panel .tree-test { color: var(--red); }
.repo-tree-panel .tree-tool { color: var(--amber); }

.repo-rule-list {
  display: grid;
  gap: 9px;
}

.repo-rule {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.repo-rule b,
.repo-rule strong,
.repo-rule span {
  display: block;
}

.repo-rule b {
  color: var(--teal);
  font-size: 12px;
  text-transform: uppercase;
}

.repo-rule strong {
  margin: 3px 0;
}

.repo-rule span {
  color: var(--muted);
  font-size: 13px;
}

.dependency-flow,
.ci-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.dependency-node,
.ci-node {
  position: relative;
  min-width: 0;
  min-height: 124px;
  display: grid;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.dependency-node:not(:last-child)::after,
.ci-node:not(:last-child)::after {
  content: ">";
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -9px;
  width: 17px;
  height: 24px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  background: var(--page);
  color: var(--muted);
  font-weight: 800;
}

.dependency-node b,
.dependency-node strong,
.dependency-node span,
.ci-node b,
.ci-node strong,
.ci-node span {
  display: block;
  overflow-wrap: anywhere;
}

.dependency-node b,
.ci-node b {
  color: var(--teal);
  font-size: 12px;
  text-transform: uppercase;
}

.dependency-node strong,
.ci-node strong {
  margin: 4px 0;
}

.dependency-node span,
.ci-node span {
  color: var(--muted);
  font-size: 13px;
}

.test-ladder {
  display: grid;
  gap: 7px;
  max-width: 980px;
  margin-inline: auto;
}

.test-rung {
  min-width: 0;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(180px, 0.55fr);
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 6px;
  background: var(--surface);
}

.test-rung:nth-child(2n) { border-left-color: var(--blue); }
.test-rung:nth-child(3n) { border-left-color: var(--amber); }
.test-rung:nth-child(5n) { border-left-color: var(--red); }

.test-rung b,
.test-rung strong,
.test-rung span {
  display: block;
}

.test-rung b {
  font-size: 14px;
}

.test-rung span {
  color: var(--muted);
  font-size: 13px;
}

.test-rung .rung-gate {
  color: var(--ink);
  font-weight: 700;
}

.test-rung[data-scope="qualification"] { margin-inline: 7%; }
.test-rung[data-scope="stress"] { margin-inline: 6%; }
.test-rung[data-scope="e2e"] { margin-inline: 5%; }
.test-rung[data-scope="perf"] { margin-inline: 4%; }
.test-rung[data-scope="sweep"] { margin-inline: 3%; }
.test-rung[data-scope="integration"] { margin-inline: 2%; }
.test-rung[data-scope="smoke"] { margin-inline: 1%; }

.test-table table,
.routing-table table {
  min-width: 1120px;
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.debug-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.debug-card b,
.debug-card strong,
.debug-card span,
.debug-card code {
  display: block;
  overflow-wrap: anywhere;
}

.debug-card b {
  color: var(--teal);
  font-size: 12px;
  text-transform: uppercase;
}

.debug-card strong {
  margin: 4px 0;
}

.debug-card span {
  color: var(--muted);
  font-size: 13px;
}

.debug-card code {
  margin-top: 8px;
  color: var(--blue);
  font-size: 12px;
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.definition-item {
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.definition-item strong,
.definition-item span {
  display: block;
}

.definition-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.command-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1040px) {
  .repo-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repo-tree-layout {
    grid-template-columns: 1fr;
  }

  .dependency-flow,
  .ci-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dependency-node::after,
  .ci-node::after {
    display: none;
  }

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

@media (max-width: 760px) {
  .repo-page h1 {
    font-size: 40px;
  }

  .repo-snapshot,
  .dependency-flow,
  .ci-flow,
  .debug-grid,
  .definition-grid {
    grid-template-columns: 1fr;
  }

  .dependency-node,
  .ci-node {
    min-height: 88px;
  }

  .test-rung {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-inline: 0 !important;
  }

  .repo-tree-panel pre {
    max-height: 760px;
  }
}

@media (max-width: 480px) {
  .repo-page h1 {
    font-size: 34px;
  }
}
