:root {
  --bg: #0b0f17;
  --bg-elevated: #111724;
  --sidebar-bg: #080b11;
  --code-bg: #05070b;
  --text: #e9eef7;
  --text-muted: #9fabc0;
  --text-faint: #616e85;
  --border: #1b2230;
  --border-strong: #2a3344;

  --brand-500: #2f86e0;
  --brand-400: #58a6ea;
  --brand-300: #93c5f5;
  --brand-100: rgba(47, 134, 224, 0.14);

  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.08);

  --radius-sm: 6px;
  --radius-md: 10px;
  --sidebar-w: 262px;
  --topbar-h: 60px;

  --font-display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.72;
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-400); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.021em;
  color: #fff;
}

code, pre, .mono { font-family: var(--font-mono); font-variant-ligatures: none; }

code {
  background: rgba(47, 134, 224, 0.13);
  color: var(--brand-300);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.855em;
  font-weight: 450;
  overflow-wrap: break-word;
}

pre {
  position: relative;
  background: var(--code-bg);
  color: #cdd7e7;
  padding: 18px 18px 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.72;
  border: 1px solid var(--border);
  margin: 0 0 14px;
  tab-size: 2;
}
pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  white-space: pre;
  font-weight: 400;
}
pre .kw  { color: var(--brand-400); }
pre .str { color: #87cf86; }
pre .com { color: #5c6982; font-style: normal; }

.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #b9c4d4;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.11); color: #fff; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); padding: 0 22px;
  background: rgba(8, 11, 17, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand:hover { text-decoration: none; }
.brand .logo { height: 22px; width: auto; display: block; }
/* display:block UA-ning [hidden] qoidasini bosib ketadi — aniq yozamiz,
   aks holda logotip fayli topilmasa "buzilgan rasm" belgisi qoladi. */
.brand .logo[hidden] { display: none; }
.brand .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: #fff;
}
.topbar .tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.topbar .spacer { flex: 1; }
.topbar a.back {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.topbar a.back:hover { color: var(--text); text-decoration: none; }

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn[aria-pressed="true"] {
  background: var(--brand-500);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: 8px;
  font-size: 17px;
  cursor: pointer;
}

.shell { display: flex; max-width: 1460px; margin: 0 auto; }

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sidebar-w); flex: none;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px 14px 48px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}
.sidebar h4 {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 26px 12px 8px;
  font-weight: 650;
}
.sidebar h4:first-child { margin-top: 2px; }
.sidebar a {
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  border-left: 2px solid transparent;
  margin-bottom: 1px;
}
.sidebar a:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); text-decoration: none; }
.sidebar a.active {
  background: var(--brand-100);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--brand-400);
}

main { flex: 1; min-width: 0; padding: 0 40px 120px; }

/* ---------- hero ---------- */
.hero { padding: 48px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.hero h1 {
  font-size: 34px;
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 14px;
}
.hero .lead {
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.68;
}

.provider-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.provider-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  padding: 6px 14px 6px 11px;
  border-radius: 20px;
}

.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  margin-right: 9px;
  vertical-align: 1px;
}
.provider-chip .dot { margin-right: 0; }
.dot-atmos { background: #4da3ff; box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.16); }
.dot-click { background: #24b0f0; box-shadow: 0 0 0 3px rgba(36, 176, 240, 0.16); }
.dot-payme { background: #33d17a; box-shadow: 0 0 0 3px rgba(51, 209, 122, 0.16); }

.quickstart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 44px; }
.qs-step {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 17px 17px 15px;
}
.qs-num {
  width: 23px; height: 23px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  font-family: var(--font-display);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 11px;
}
.qs-step h4 { margin: 0 0 5px; font-size: 13.5px; font-weight: 650; letter-spacing: -0.008em; }
.qs-step p { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.58; }

/* ---------- sections ---------- */
section { margin-bottom: 60px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
section h2 {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.024em;
  margin: 0 0 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}
section h3 {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 26px 0 10px;
}
section p { margin: 0 0 14px; color: var(--text-muted); }
section ul { margin: 0 0 14px; padding-left: 20px; }
section li { color: var(--text-muted); margin-bottom: 6px; }
section strong { color: var(--text); font-weight: 600; }
section em { color: var(--text); font-style: italic; }

.doc-row { display: flex; gap: 34px; align-items: flex-start; }
.doc-col-left { flex: 1 1 54%; min-width: 0; }
.doc-col-right { flex: 1 1 46%; min-width: 0; position: sticky; top: calc(var(--topbar-h) + 18px); }

.code-tabs {
  display: flex; gap: 2px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 6px 6px 0;
  overflow-x: auto;
}
.code-tab {
  background: transparent;
  color: var(--text-faint);
  border: none;
  padding: 8px 15px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: 7px 7px 0 0;
  cursor: pointer;
}
.code-tab:hover { color: var(--text-muted); }
.code-tab.active { background: rgba(255, 255, 255, 0.06); color: #fff; }
.code-block-group {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 4px;
}
.code-block-group pre { display: none; border: none; margin: 0; background: none; }
.code-block-group pre.active { display: block; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 14px 0 20px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-muted);
  line-height: 1.6;
}
th {
  color: var(--text-faint);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.085em;
  padding-bottom: 8px;
  white-space: nowrap;
}
td code { white-space: nowrap; }
td strong { color: var(--text); }
.req { color: var(--danger); font-size: 10.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.opt { color: var(--text-faint); font-size: 10.5px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }

/* ---------- endpoint / badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.075em;
}
.badge-post { background: var(--success-bg); color: var(--success); }
.badge-get { background: var(--brand-100); color: var(--brand-300); }
.endpoint { display: flex; align-items: center; gap: 10px; margin: 4px 0 22px; flex-wrap: wrap; }
.endpoint code {
  background: none;
  padding: 0;
  font-size: 14px;
  color: #fff;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
}

/* ---------- notes ---------- */
.note {
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.65;
  border: 1px solid;
  border-left-width: 3px;
}
.note.info { background: rgba(47, 134, 224, 0.07); border-color: rgba(47, 134, 224, 0.28); color: #bad9f8; }
.note.warn { background: var(--warning-bg); border-color: rgba(251, 191, 36, 0.28); color: #f6d38d; }
.note.danger { background: var(--danger-bg); border-color: rgba(248, 113, 113, 0.28); color: #f8c2c2; }
.note strong { color: inherit; font-weight: 650; }
.note code { background: rgba(255, 255, 255, 0.08); color: inherit; }

/* ---------- steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 20px 0 22px; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 16px 40px;
  margin: 0;
  color: var(--text-muted);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 2px;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: rgba(47, 134, 224, 0.16);
  border: 1px solid rgba(47, 134, 224, 0.4);
  color: var(--brand-300);
  font-family: var(--font-display);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps li:last-child { padding-bottom: 0; }

/* ---------- faq ---------- */
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.012em;
  color: #fff;
  margin: 0 0 6px !important;
  font-size: 14.5px;
}
.faq-a { margin: 0 !important; color: var(--text-muted); font-size: 13.5px; }

/* ---------- footer ---------- */
footer {
  max-width: 1460px;
  margin: 0 auto;
  padding: 26px 40px 70px calc(var(--sidebar-w) + 40px);
  color: var(--text-faint);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
}

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  /* Ustunga o'tganda align-items:flex-start ustunlarni max-content kengligiga
     cho'zib yuboradi — shuning uchun kenglikni aniq belgilaymiz. */
  .doc-row { flex-direction: column; gap: 8px; }
  .doc-col-left,
  .doc-col-right { width: 100%; max-width: 100%; align-self: stretch; }
  .doc-col-right { position: static; }
}
@media (max-width: 960px) {
  .menu-toggle { display: block; }
  .quickstart { grid-template-columns: 1fr 1fr; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0; z-index: 25;
    transform: translateX(-100%);
    /* visibility yopiq menyuni klaviatura va skrin-riderdan ham chiqaradi */
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s ease;
    width: 82vw; max-width: 300px;
  }
  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.45);
  }
  main { padding: 0 18px 90px; }
  footer { padding: 24px 18px 60px; }
  .topbar a.back { display: none; }
  .topbar .tag { display: none; }
  .copy-btn { opacity: 1; }
}
@media (max-width: 600px) {
  .quickstart { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 26px; }
  .hero .lead { font-size: 15px; }
  section h2 { font-size: 20px; }
  .topbar { padding: 0 14px; gap: 10px; }
}
