:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --line: #ececec;
  --line-strong: #dddddd;
  --text: rgb(37, 37, 37);
  --body: rgb(79, 79, 79);
  --muted: rgb(111, 111, 111);
  --sidebar-text: rgb(62, 62, 62);
  --hover-text: rgb(17, 17, 17);
  --accent: #111111;
  --accent-soft: #f4f4f4;
  --accent-blue: #1668e3;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Inter Fallback", -apple-system, system-ui, "Segoe UI", ui-sans-serif, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

code,
kbd,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

code {
  padding: 0.12rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--text);
  font-size: 0.92em;
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px 28px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 600;
}

.logo-image {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
}

.logo-copy {
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  white-space: nowrap;
}

.sidebar-close,
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

.sidebar-close {
  width: 36px;
  font-size: 18px;
  line-height: 1;
}

.search-box {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.search-icon {
  display: inline-flex;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 14px;
  line-height: 20px;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box kbd {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
}

.search-meta {
  margin: 8px 2px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.sidebar-nav {
  display: grid;
  gap: 18px;
}

.nav-group {
  display: grid;
  gap: 2px;
}

.nav-label,
.doc-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sidebar-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.is-active {
  color: var(--hover-text);
  background: var(--accent-soft);
}

.sidebar-nav a.is-hidden,
.nav-group.is-hidden {
  display: none;
}

.mobile-topbar {
  display: none;
}

.content {
  min-width: 0;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.content-tabs {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1151px;
  min-height: 48px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}

.content-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 48px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
}

.content-tabs a.tab-active {
  color: var(--text);
}

.content-tabs a.tab-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--text);
}

.doc-page {
  width: 100%;
  max-width: 1151px;
  padding: 0 32px 88px;
}

.doc-header,
.doc-section {
  width: min(100%, 36rem);
}

.doc-header {
  padding: 32px 0 24px;
}

.doc-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.doc-header h1 {
  margin: 0;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.doc-lead {
  max-width: 36rem;
  margin: 14px 0 0;
  color: var(--body);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.hero-visuals {
  display: block;
  margin-top: 24px;
}

.terminal-card {
  overflow: hidden;
  border: 1px solid #202020;
  border-radius: 16px;
  background: #101010;
  color: #f8f8f8;
  box-shadow: none;
}

.terminal-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.terminal-dot.red {
  background: #ff5f56;
}

.terminal-dot.yellow {
  background: #ffbd2e;
}

.terminal-dot.green {
  background: #27c93f;
}

.terminal-label {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  line-height: 16px;
}

.terminal-body {
  padding: 16px 18px 18px;
  font-size: 14px;
  line-height: 24px;
}

.terminal-body p {
  margin: 0 0 6px;
}

.terminal-prompt {
  color: #6ee7b7;
}

.terminal-accent {
  color: #93c5fd;
}

.terminal-muted {
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}

.terminal-ok {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  color: #d1fae5;
  background: rgba(34, 197, 94, 0.18);
}

.terminal-response {
  color: #fde68a;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cta-button-primary {
  color: #ffffff;
  background: var(--accent-blue);
}

.cta-button-primary:hover {
  background: #1258c2;
}

.cta-button-secondary {
  color: var(--muted);
  border: 1px solid var(--line);
  background: #ffffff;
}

.cta-button-secondary:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.telegram-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  line-height: 0;
}

.doc-section {
  padding-top: 32px;
}

.doc-section h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.doc-section h3 {
  margin: 24px 0 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.doc-section p,
.doc-section li,
.doc-section summary,
.spec-card span,
.spec-card strong,
th,
td {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.doc-section p,
.doc-section li,
.spec-card span,
td {
  color: var(--body);
}

.doc-section ul,
.doc-section ol {
  margin: 0;
  padding-left: 1.35rem;
}

.doc-section li + li {
  margin-top: 6px;
}

.callout {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
}

.callout strong {
  font-size: 14px;
  line-height: 20px;
}

.callout.soft {
  display: block;
  width: 100%;
}

.callout.soft p {
  margin: 6px 0 0;
}

.media-card,
.copy-block,
.system-visual,
.table-wrap {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.media-card img,
.system-visual-image {
  width: 100%;
  height: auto;
  background: #ffffff;
}

.copy-block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.copy-inline-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.copy-inline-button:hover {
  color: var(--text);
}

.copy-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: #ffffff;
}

.copy-block code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  line-height: 24px;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.guide-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfcfc;
}

.guide-card h3 {
  margin-top: 0;
}

.guide-card ul {
  margin: 0;
  padding-left: 1.25rem;
}

.spec-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfcfc;
  min-height: 118px;
}

.spec-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.spec-card strong {
  display: block;
  color: var(--text);
}

.spec-inline-code {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 20px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.section-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

thead th {
  background: #fafafa;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

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

.recommended-row {
  background: #fbfdff;
}

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

summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

details p {
  margin: 10px 0 0;
}

.search-highlight {
  background: #fff3bf;
  border-radius: 4px;
}

@media (max-width: 1180px) {
  .docs-layout {
    grid-template-columns: 244px minmax(0, 1fr);
  }

  .content-tabs,
  .doc-page {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(320px, 92vw);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close,
  .sidebar-toggle,
  .mobile-topbar {
    display: flex;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
  }

  .sidebar-toggle {
    min-height: 38px;
    padding: 0 14px;
  }

  .content {
    display: block;
  }

  .content-tabs,
  .doc-page {
    padding-left: 18px;
    padding-right: 18px;
  }

  .doc-header,
  .doc-section {
    width: 100%;
    max-width: 36rem;
  }

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

@media (max-width: 640px) {
  .spec-grid {
    grid-template-columns: 1fr;
  }

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

  .doc-header h1 {
    font-size: 28px;
  }

  .doc-page {
    padding-bottom: 56px;
  }

  .copy-block-top,
  .section-cta-row {
    align-items: flex-start;
  }

  .copy-block-top {
    flex-direction: column;
    padding: 12px 14px;
  }
}
