:root {
  color-scheme: dark;
  --bg: #07111d;
  --bg-2: #0c1c31;
  --panel: rgba(24, 39, 61, 0.78);
  --panel-2: rgba(31, 51, 78, 0.72);
  --line: rgba(157, 190, 230, 0.18);
  --line-strong: rgba(176, 211, 255, 0.32);
  --ink: #f4f8ff;
  --muted: #9badc9;
  --muted-2: #71849f;
  --cyan: #36dfff;
  --blue: #638aff;
  --green: #6ef7a2;
  --amber: #ffbd67;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #07111d 0%, #0d213a 56%, #133f58 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

code,
pre {
  font-family: var(--mono);
}

.docs-topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 70px;
  padding: 0 24px;
  background: rgba(7, 17, 29, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
}

.docs-mark {
  position: relative;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--cyan) 0%, var(--blue) 58%, #71f4c4 100%);
  box-shadow: 0 12px 28px rgba(54, 223, 255, 0.2);
  overflow: hidden;
}

.docs-mark::before,
.docs-mark::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  background: var(--bg);
}

.docs-mark::before {
  left: 9px;
  top: 7px;
  width: 4px;
  height: 18px;
}

.docs-mark::after {
  left: 9px;
  top: 7px;
  width: 16px;
  height: 4px;
  box-shadow: 0 7px 0 var(--bg);
}

.docs-brand strong,
.docs-brand small {
  display: block;
}

.docs-brand strong {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.docs-brand small {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.docs-topnav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  color: #b6c7df;
  font-size: 14px;
  font-weight: 850;
}

.docs-topnav a:hover,
.on-page a:hover,
.side-link:hover {
  color: var(--cyan);
}

.docs-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ghost-link,
.primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.ghost-link {
  color: #dce9ff;
  background: rgba(28, 46, 72, 0.5);
  border: 1px solid var(--line);
}

.primary-link {
  color: #07111d;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border: 1px solid rgba(170, 218, 255, 0.72);
}

.docs-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 760px) 250px;
  gap: 48px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 30px 28px 80px;
}

.docs-sidebar,
.on-page {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.docs-sidebar {
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.on-page {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.nav-label {
  margin: 0 0 12px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-label:not(:first-child) {
  margin-top: 28px;
}

.side-link,
.on-page a {
  display: block;
  color: #aebed5;
  font-size: 14px;
  font-weight: 780;
  line-height: 1.3;
}

.side-link {
  margin: 3px 0;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.side-link.is-active {
  color: var(--cyan);
  background: rgba(43, 215, 255, 0.08);
  border-color: rgba(43, 215, 255, 0.4);
}

.on-page a {
  margin: 0 0 14px;
}

.on-page a.is-active {
  color: var(--cyan);
}

.docs-main {
  min-width: 0;
}

.hero-doc {
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(42px, 7vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.lead {
  max-width: 820px;
  color: #b7c7dd;
  font-size: 19px;
  line-height: 1.55;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 34px;
}

.status-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  color: #d6e4f6;
  background: rgba(28, 46, 72, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
}

.status-row i {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(110, 247, 162, 0.72);
}

.doc-cards,
.surface-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.doc-card,
.surface-grid article,
.note,
.code-card {
  background: rgba(24, 39, 61, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc-card {
  display: grid;
  gap: 10px;
  min-height: 126px;
  padding: 18px;
}

.doc-card strong {
  font-size: 16px;
}

.doc-card span,
.surface-grid p,
.doc-section p,
.note span,
.checks,
details p {
  color: var(--muted);
  line-height: 1.6;
}

.doc-card code,
.doc-section code,
table code {
  color: #c9f8ff;
  font-size: 0.92em;
}

.doc-section {
  padding: 48px 0 0;
}

.doc-section > p:not(.eyebrow) {
  font-size: 16px;
}

.surface-grid article {
  padding: 18px;
}

.surface-grid span {
  display: block;
  margin-bottom: 9px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.surface-grid strong {
  display: block;
  margin-bottom: 8px;
}

table {
  width: 100%;
  margin-top: 18px;
  overflow: hidden;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 34, 54, 0.64);
}

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

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

th {
  color: #d7e6fb;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #b9c8de;
}

td a {
  color: var(--cyan);
}

.steps {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 68px;
  padding: 15px 16px 15px 62px;
  background: rgba(24, 39, 61, 0.64);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.steps li::before {
  position: absolute;
  top: 15px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #07111d;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 999px;
  counter-increment: step;
  content: counter(step);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 950;
}

.steps strong,
.steps span {
  display: block;
}

.steps span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.55;
}

.note {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 3px solid var(--cyan);
}

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

.flow span {
  min-height: 72px;
  padding: 14px;
  color: #e9f2ff;
  background: rgba(24, 39, 61, 0.64);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 850;
}

.code-card {
  margin-top: 18px;
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.code-head span {
  color: #d8e7fb;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-head button {
  min-height: 30px;
  padding: 0 11px;
  color: #dce9ff;
  background: rgba(39, 62, 95, 0.74);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  color: #d7e8ff;
  background: rgba(5, 14, 24, 0.52);
  font-size: 12px;
  line-height: 1.65;
}

.checks {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 19px;
}

details {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

details:first-of-type {
  border-top: 1px solid var(--line);
}

summary {
  color: #f4f8ff;
  cursor: pointer;
  font-weight: 900;
}

details p {
  margin: 10px 0 0;
}

.copy-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  padding: 10px 14px;
  color: #07111d;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  border-radius: 10px;
  font-size: 13px;
  font-weight: 950;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.copy-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 32px;
  }

  .on-page {
    display: none;
  }
}

@media (max-width: 900px) {
  .docs-topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px 18px;
  }

  .docs-topnav,
  .docs-actions {
    justify-content: flex-start;
    overflow: auto;
  }

  .docs-shell {
    grid-template-columns: 1fr;
    padding: 22px 18px 60px;
  }

  .docs-sidebar {
    position: static;
    display: flex;
    gap: 8px;
    max-height: none;
    padding: 0 0 16px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .docs-sidebar .nav-label {
    display: none;
  }

  .side-link {
    flex: 0 0 auto;
    min-height: 38px;
    margin: 0;
    white-space: nowrap;
  }

  .doc-cards,
  .surface-grid {
    grid-template-columns: 1fr;
  }

  .flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 16px;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .docs-topnav {
    gap: 14px;
  }

  .ghost-link,
  .primary-link {
    min-height: 36px;
    padding: 0 12px;
  }
}
