.system-doc-shell {
  min-height: 100vh;
  padding: 24px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(0, 212, 255, 0.055), transparent 310px),
    var(--bg);
}

.system-doc-layout {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  gap: 22px;
}

.system-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  min-height: calc(100vh - 48px);
  padding: 18px;
  border: 1px solid rgba(142, 155, 148, 0.18);
  border-radius: 8px;
  background: rgba(6, 10, 9, 0.88);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.system-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(142, 155, 148, 0.16);
}

.system-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 212, 255, 0.34);
  border-radius: 8px;
  background: rgba(0, 212, 255, 0.08);
}

.system-brand-mark svg {
  width: 22px;
  height: 22px;
  stroke: var(--cyan);
  stroke-width: 1.8;
  fill: none;
}

.system-brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.system-brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.system-nav {
  display: grid;
  gap: 6px;
  margin: 16px 0;
}

.system-nav a,
.quick-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid rgba(142, 155, 148, 0.12);
  border-radius: 6px;
  color: rgba(245, 248, 246, 0.84);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.025);
}

.system-nav a:hover,
.system-nav a.active,
.quick-links a:hover {
  color: var(--text);
  border-color: rgba(0, 212, 255, 0.32);
  background: rgba(0, 212, 255, 0.075);
}

.system-nav span,
.quick-links span {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

.quick-links {
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(142, 155, 148, 0.16);
}

.system-doc-main {
  min-width: 0;
}

.doc-hero {
  min-height: 280px;
  padding: 42px;
  border: 1px solid rgba(142, 155, 148, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(0, 212, 255, 0.11), rgba(49, 255, 155, 0.035) 48%, rgba(255, 255, 255, 0.025)),
    rgba(7, 10, 9, 0.84);
}

.doc-hero.compact {
  min-height: 220px;
}

.doc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.doc-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(49, 255, 155, 0.7);
}

.doc-hero h1 {
  max-width: 960px;
  margin: 18px 0 14px;
  font-size: clamp(34px, 4.8vw, 66px);
  line-height: 1;
  letter-spacing: 0.04em;
}

.doc-hero p {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.doc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(0, 212, 255, 0.34);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  background: rgba(0, 212, 255, 0.08);
}

.doc-button.secondary {
  border-color: rgba(142, 155, 148, 0.18);
  background: rgba(255, 255, 255, 0.028);
}

.doc-section {
  margin-top: 18px;
  padding: 26px;
  border: 1px solid rgba(142, 155, 148, 0.16);
  border-radius: 8px;
  background: rgba(7, 10, 9, 0.74);
}

.section-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 18px;
}

.section-index {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(49, 255, 155, 0.28);
  border-radius: 8px;
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  background: rgba(49, 255, 155, 0.06);
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: 0.035em;
}

.section-head p,
.doc-section p,
.doc-list li {
  color: var(--muted);
  line-height: 1.78;
}

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

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

.doc-card,
.endpoint-card,
.flow-step {
  padding: 16px;
  border: 1px solid rgba(142, 155, 148, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
}

.doc-card h3,
.endpoint-card h3,
.flow-step h3 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.doc-card p,
.endpoint-card p,
.flow-step p {
  margin: 0;
}

.doc-card a {
  color: var(--cyan);
}

.doc-meta {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 10px;
  padding: 0 8px;
  border: 1px solid rgba(0, 212, 255, 0.26);
  border-radius: 999px;
  color: var(--cyan);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}

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

.flow-step {
  position: relative;
}

.flow-step::after {
  content: ">";
  position: absolute;
  top: 18px;
  right: -9px;
  color: rgba(0, 212, 255, 0.52);
  font-family: "JetBrains Mono", monospace;
}

.flow-step:last-child::after {
  display: none;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(142, 155, 148, 0.14);
  border-radius: 8px;
}

.doc-table th,
.doc-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(142, 155, 148, 0.12);
  text-align: left;
  vertical-align: top;
}

.doc-table th {
  color: rgba(245, 248, 246, 0.92);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.035);
}

.doc-table td {
  color: var(--muted);
  line-height: 1.65;
}

.doc-table tr:last-child td {
  border-bottom: 0;
}

.code-block {
  margin: 14px 0 0;
  border: 1px solid rgba(142, 155, 148, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(2, 5, 4, 0.72);
}

.code-title {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(142, 155, 148, 0.14);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.code-block pre {
  margin: 0;
  padding: 14px;
  color: rgba(245, 248, 246, 0.92);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

code {
  color: rgba(245, 248, 246, 0.95);
  font-family: "JetBrains Mono", monospace;
}

.doc-shot {
  margin: 18px 0 0;
  border: 1px solid rgba(142, 155, 148, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.028);
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.shot-grid .doc-shot {
  margin: 0;
}

.doc-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.doc-shot figcaption {
  padding: 12px 14px;
  border-top: 1px solid rgba(142, 155, 148, 0.14);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.note-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(49, 255, 155, 0.22);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.75;
  background: rgba(49, 255, 155, 0.045);
}

.warning-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 208, 102, 0.24);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.75;
  background: rgba(255, 208, 102, 0.045);
}

.doc-list {
  margin: 0;
  padding-left: 20px;
}

.doc-list li + li {
  margin-top: 8px;
}

.page-footer {
  margin: 18px 0 4px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  text-align: right;
}

@media (max-width: 1120px) {
  .system-doc-layout {
    grid-template-columns: 1fr;
  }

  .system-sidebar {
    position: static;
    min-height: 0;
  }

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

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

@media (max-width: 700px) {
  .system-doc-shell {
    padding: 14px;
  }

  .doc-hero,
  .doc-section {
    padding: 18px;
  }

  .doc-hero h1 {
    font-size: 34px;
  }

  .system-nav,
  .flow,
  .card-grid,
  .card-grid.two,
  .shot-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    grid-template-columns: 1fr;
  }

  .flow-step::after {
    display: none;
  }
}
