/* Rentora hujjatlar: Docs Web, Docs MCP, Docs Bot va /docs bosh sahifasi.
   index.css va site.css bilan birga ulanadi (ranglar, shrift, sarlavha shu yerdan).

   Uslub (v2): qorong'i "tun" fon, bitta binafsha urg'u (joriy bo'lim, tanlangan tab),
   amber faqat asosiy harakat tugmasida. Metod rangi (GET/POST/...) endpoint satrida
   yagona rangli element. Misollar sahifa tepasida: so'rov va javob yonma-yon.
   Eski sinf nomlari saqlangan (docs-bot.php, docs.php, _ref.php ishlatadi). */

:root {
  --bg: #17112E; --ink: #F6F3FC; --muted: #A99FCF; --muted-strong: #CFC6EC;
  --line: #30265A; --line-strong: #43387A; --accent: #FFB547;
  /* hujjatlarga xos */
  --d-surface: rgba(255, 255, 255, 0.04);
  --d-surface-2: rgba(255, 255, 255, 0.065);
  --d-hair: rgba(255, 255, 255, 0.09);
  --d-code: #0E0A22;
  --d-accent: #9B83FF;
  --d-accent-soft: rgba(155, 131, 255, 0.16);
  --d-get: #4FE0B0; --d-post: #FFB547; --d-put: #7FA2FF; --d-del: #FF7D8E;
  --d-radius: 14px;
}

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html { scroll-padding-top: 92px; }

body { background: #17112E; font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body::before {
  background-image:
    radial-gradient(50% 32% at 82% 0%, rgba(138, 107, 255, 0.16), transparent 70%),
    radial-gradient(34% 24% at 8% 12%, rgba(255, 181, 71, 0.06), transparent 70%);
  background-size: auto; -webkit-mask-image: none; mask-image: none;
}
h1, h2, h3, h4 { font-family: "Bricolage Grotesque", "Onest", system-ui, sans-serif; letter-spacing: -0.02em; }

/* o'qish chizig'i (sahifa pastga siljiganda to'lib boradi) */
.d-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; pointer-events: none; }
.d-progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--d-accent), var(--accent)); }

/* ---------- tugmalar ---------- */
.d-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.62rem 1.15rem; border-radius: 11px; border: 1px solid var(--d-hair);
  font: inherit; font-size: 0.93rem; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer;
  color: var(--ink); background: var(--d-surface);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.d-btn:hover { border-color: var(--line-strong); background: var(--d-surface-2); }
.d-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.d-btn-pri { background: var(--accent); border-color: var(--accent); color: #2A1B00; }
.d-btn-pri:hover { background: #FFC266; border-color: #FFC266; }
.d-btn:focus-visible { outline: 2px solid var(--d-accent); outline-offset: 2px; }

/* ---------- sahifa tuzilmasi ---------- */
.d-shell {
  position: relative; z-index: 1; flex: 1;
  width: 100%; max-width: 1240px; margin-inline: auto;
  padding: calc(68px + 28px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 96px max(24px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 60px); align-items: start;
}

/* ---------- chap menyu ---------- */
.d-side {
  position: sticky; top: 92px;
  max-height: calc(100vh - 110px); max-height: calc(100svh - 110px);
  overflow-y: auto; padding-right: 6px; scrollbar-width: thin;
}
.d-search {
  width: 100%; margin: 0 0 12px; padding: 0.6rem 0.9rem;
  font: inherit; font-size: 0.9rem; color: var(--ink);
  background: var(--d-surface); border: 1px solid var(--d-hair); border-radius: 11px;
}
.d-search::placeholder { color: var(--muted); }
.d-search:focus { outline: none; border-color: var(--d-accent); box-shadow: 0 0 0 3px var(--d-accent-soft); }
.d-nav, .d-nav ul { list-style: none; margin: 0; padding: 0; }
.d-nav-h {
  margin: 18px 0 4px; padding: 0 0.7rem; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); opacity: 0.8;
}
.d-nav-h:first-child { margin-top: 2px; }
.d-nav a {
  position: relative; display: block; padding: 0.36rem 0.7rem; border-radius: 9px;
  color: var(--muted); text-decoration: none;
  font-size: 0.93rem; font-weight: 500; line-height: 1.35;
  transition: color 0.15s ease, background 0.15s ease;
}
.d-nav a:hover { color: var(--ink); background: var(--d-surface); }
.d-nav a[aria-current="true"] { color: var(--ink); font-weight: 600; background: var(--d-accent-soft); }
.d-nav > li > a[aria-current="true"]::before {
  content: ""; position: absolute; left: -1px; top: 20%; bottom: 20%; width: 3px; border-radius: 3px; background: var(--d-accent);
}
.d-nav a.d-nav-ext { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d-nav a.d-nav-ext::after { content: "↗"; font-size: 0.8em; opacity: 0.6; }
.d-nav .d-new {
  margin-left: 6px; padding: 0.05rem 0.4rem; border-radius: 6px; font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: #2A1B00; background: var(--accent);
}
/* ichki bandlar: faqat joriy bo'lim ochiq (qidirilganda hammasi ko'rinadi) */
.d-nav .sub { display: none; margin: 2px 0 6px 0.95rem; padding-left: 0.35rem; border-left: 1px solid var(--d-hair); }
.d-nav > li:has([aria-current="true"]) > .sub,
.d-side:has(.d-search:not(:placeholder-shown)) .d-nav .sub { display: block; }
.d-nav .sub a { font-family: var(--mono); font-size: 0.78rem; font-weight: 400; padding: 0.28rem 0.6rem; }
.d-nav .sub a[aria-current="true"] { font-weight: 500; }
.d-empty { margin: 12px 0 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- asosiy matn ---------- */
.d-main { min-width: 0; max-width: 820px; font-size: 1rem; line-height: 1.68; }
.d-main h1 {
  margin: 0 0 14px; font-size: clamp(2rem, 4.6vw, 2.8rem); line-height: 1.08;
  letter-spacing: -0.035em; font-weight: 700; text-wrap: balance;
}
.d-lead { margin: 0 0 8px; max-width: 58ch; font-size: 1.1rem; font-weight: 500; line-height: 1.5; color: var(--muted-strong); }
.d-main h2 {
  position: relative; margin: 72px 0 16px; padding-top: 30px; border-top: 1px solid var(--d-hair);
  font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.15; font-weight: 700;
}
.d-main h2::before { content: ""; position: absolute; top: -1px; left: 0; width: 44px; height: 2px; background: var(--d-accent); }
.d-main h3 { margin: 48px 0 12px; font-size: 1.22rem; line-height: 1.25; font-weight: 700; }
.d-main h4 { margin: 28px 0 8px; font-size: 1rem; font-weight: 700; }
.d-main h2, .d-main h3, .d-main h4 { scroll-margin-top: 92px; }
.d-main p { margin: 0 0 14px; max-width: 68ch; color: var(--muted-strong); }
.d-main a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.d-main a:hover { text-decoration-color: var(--d-accent); }
.d-main code {
  font-family: var(--mono); font-size: 0.85em; padding: 0.12em 0.42em;
  border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--ink);
}
.d-main li { color: var(--muted-strong); }
.d-hint { margin: 0 0 4px !important; font-size: 0.88rem; color: var(--muted) !important; }
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 20px 0 10px; }
.d-actions-note { max-width: 40ch; font-size: 0.88rem; color: var(--muted); }

/* sarlavhaga havola belgisi: ustiga kelsa chiqadi, bosilsa havola nusxalanadi */
.d-anchor {
  margin-left: 0.45rem; padding: 0 0.3rem; border: 0; border-radius: 6px; background: none; cursor: pointer;
  font: inherit; font-size: 0.8em; font-weight: 500; color: var(--muted); opacity: 0; transition: opacity 0.15s ease;
}
.d-main :is(h2, h3):hover .d-anchor, .d-anchor:focus-visible { opacity: 1; }
.d-anchor:hover { color: var(--ink); background: var(--d-surface); }
@media (hover: none) { .d-anchor { display: none; } }

/* Docs Web / Docs Bot almashtirgich */
.d-main .d-switch {
  display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 24px;
  border: 1px solid var(--d-hair); border-radius: 11px; background: var(--d-surface);
}
.d-main .d-switch a { padding: 0.35rem 1rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem; color: var(--muted-strong); text-decoration: none; }
.d-main .d-switch a:hover { color: var(--ink); }
.d-main .d-switch a[aria-current="page"] { background: var(--d-accent-soft); color: var(--ink); }

/* ---------- hero (Docs Web tepasi) ---------- */
.d-hero { position: relative; margin: 0 0 8px; }
.d-eyebrow-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 0.28rem 0.8rem 0.28rem 0.6rem;
  border: 1px solid var(--d-hair); border-radius: 999px; background: var(--d-surface);
  font-size: 0.82rem; font-weight: 600; color: var(--muted-strong);
}
.d-eyebrow-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--d-get); box-shadow: 0 0 0 3px rgba(79, 224, 176, 0.18); }
.d-hero h1 em {
  font-style: normal;
  background: linear-gradient(95deg, #C9BBFF 0%, var(--d-accent) 45%, var(--accent) 110%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.d-facts-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; padding: 0; list-style: none;
}
.d-facts-strip li {
  display: grid; gap: 3px; min-width: 0; padding: 12px 14px; border: 1px solid var(--d-hair); border-radius: 12px; background: var(--d-surface);
}
.d-facts-strip span { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.d-facts-strip b { font-family: var(--mono); font-size: 0.82rem; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.d-main .d-callout {
  display: flex; align-items: center; gap: 14px; max-width: none; margin: 18px 0 0; padding: 14px 16px;
  border: 1px solid rgba(155, 131, 255, 0.35); border-radius: var(--d-radius);
  background: linear-gradient(100deg, rgba(155, 131, 255, 0.14), rgba(155, 131, 255, 0.04));
}
.d-callout .d-ico { flex: none; width: 40px; height: 40px; background: rgba(155, 131, 255, 0.16); border-color: rgba(155, 131, 255, 0.3); }
.d-callout .d-ico svg { stroke: #C9BBFF; }
.d-callout div { min-width: 0; }
.d-callout b { display: block; color: var(--ink); font-size: 0.98rem; }
.d-callout span { display: block; font-size: 0.9rem; color: var(--muted-strong); line-height: 1.45; }
.d-callout .d-btn { margin-left: auto; flex: none; }

/* ---------- misollar: so'rov va javob yonma-yon ---------- */
.d-ex { margin: 30px 0 6px; border: 1px solid var(--d-hair); border-radius: 18px; background: var(--d-surface); overflow: hidden; }
.d-ex-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--d-hair); background: rgba(255, 255, 255, 0.02); overflow-x: auto; scrollbar-width: none; }
.d-ex-tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 0.5rem 0.95rem; border: 1px solid transparent; border-radius: 10px;
  font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--muted); background: none; cursor: pointer; transition: color 0.15s ease, background 0.15s ease;
}
.d-ex-tab:hover { color: var(--ink); }
.d-ex-tab[aria-selected="true"] { color: var(--ink); background: var(--d-accent-soft); border-color: rgba(155, 131, 255, 0.35); }
.d-ex-tab b { font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--d-get); }
.d-ex-tab b[data-m="POST"] { color: var(--d-post); }
.d-ex-panel { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.d-ex-panel[hidden] { display: none; }
.d-ex-req, .d-ex-res { min-width: 0; padding: 16px; }
.d-ex-req { border-right: 1px solid var(--d-hair); }
.d-ex-req .d-code { margin: 0; }
.d-ex-cap { margin: 0 0 12px !important; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.78rem !important; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted) !important; }
.d-ex-cap em { font-style: normal; letter-spacing: 0; text-transform: none; font-family: var(--mono); font-size: 0.8rem; color: var(--d-get); }
.d-ex-note { margin: 12px 0 0 !important; font-size: 0.88rem !important; color: var(--muted) !important; line-height: 1.5; }

/* NFT kartochkalari (javob ko'rinishi) */
.d-nftgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.d-nftgrid li { display: grid; gap: 2px; padding: 8px 8px 10px; border: 1px solid var(--d-hair); border-radius: 12px; background: var(--d-code); min-width: 0; }
.d-nftgrid .pic { position: relative; display: block; aspect-ratio: 1; margin-bottom: 8px; border-radius: 9px; overflow: hidden; background: linear-gradient(145deg, #2A2058, #1B1540); }
.d-nftgrid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-nftgrid b { padding: 0 4px; font-size: 0.88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-nftgrid span.pr { padding: 0 4px; font-family: var(--mono); font-size: 0.74rem; color: var(--muted-strong); }
.d-nftgrid .st { margin: 6px 4px 0; width: fit-content; padding: 0.08rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; color: var(--d-get); background: rgba(79, 224, 176, 0.12); }
.d-nftgrid .st.off { color: var(--muted); background: rgba(255, 255, 255, 0.07); }

/* ijara bosqichlari */
.d-tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.d-tl li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 12px; padding: 0 0 16px; color: var(--muted); }
.d-tl li:last-child { padding-bottom: 0; }
.d-tl li::before { content: ""; width: 12px; height: 12px; margin: 5px 0 0 5px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--d-code); z-index: 1; }
.d-tl li:not(:last-child)::after { content: ""; position: absolute; left: 10.5px; top: 20px; bottom: 0; width: 1px; background: var(--d-hair); }
.d-tl li.done::before { border-color: var(--d-get); background: var(--d-get); }
.d-tl li.now::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 181, 71, 0.18); }
.d-tl code { align-self: start; width: fit-content; }
.d-tl b { color: var(--ink); font-size: 0.93rem; }
.d-tl span { display: block; font-size: 0.82rem; line-height: 1.45; }
.d-tl .t { display: grid; gap: 1px; }

/* tekshiruv ro'yxati (webhook) */
.d-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.d-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border: 1px solid var(--d-hair); border-radius: 11px; background: var(--d-code); font-size: 0.9rem; line-height: 1.45; color: var(--muted-strong); }
.d-checks li::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 0.72rem; font-weight: 800; color: #07281D; background: var(--d-get); }
.d-checks b { color: var(--ink); }

/* ---------- endpoint satri ---------- */
.d-ep {
  position: relative; display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 8px 8px 8px 8px;
  border: 1px solid var(--d-hair); border-radius: 12px; background: var(--d-surface);
  font-family: var(--mono); font-size: 0.92rem; overflow: hidden;
}
.d-ep::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--d-get); }
.d-ep:has(.m[data-m="POST"])::before { background: var(--d-post); }
.d-ep:has(.m[data-m="PUT"])::before, .d-ep:has(.m[data-m="PATCH"])::before { background: var(--d-put); }
.d-ep:has(.m[data-m="DELETE"])::before { background: var(--d-del); }
.d-ep .m {
  flex: none; min-width: 3.9rem; margin-left: 6px; padding: 0.24rem 0.6rem; border-radius: 7px; text-align: center;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--d-get); background: color-mix(in srgb, var(--d-get) 14%, transparent);
}
.d-ep .m[data-m="POST"] { color: var(--d-post); background: color-mix(in srgb, var(--d-post) 14%, transparent); }
.d-ep .m[data-m="PUT"], .d-ep .m[data-m="PATCH"] { color: var(--d-put); background: color-mix(in srgb, var(--d-put) 14%, transparent); }
.d-ep .m[data-m="DELETE"] { color: var(--d-del); background: color-mix(in srgb, var(--d-del) 14%, transparent); }
.d-ep .p { flex: 1; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.d-ep-copy {
  flex: none; padding: 0.26rem 0.65rem; border-radius: 7px; border: 1px solid var(--d-hair); background: transparent;
  font-family: "Onest", system-ui, sans-serif; font-size: 0.78rem; font-weight: 600; color: var(--muted); cursor: pointer;
  opacity: 0.0; transition: opacity 0.15s ease, color 0.15s ease;
}
.d-ep:hover .d-ep-copy, .d-ep-copy:focus-visible { opacity: 1; }
.d-ep-copy:hover { color: var(--ink); border-color: var(--line-strong); }
@media (hover: none) { .d-ep-copy { opacity: 1; } }

/* ---------- izoh ---------- */
.d-note {
  margin: 20px 0; padding: 14px 16px 14px 18px; max-width: 68ch; font-size: 0.95rem;
  border: 1px solid var(--d-hair); border-left: 3px solid var(--accent); border-radius: 12px;
  background: linear-gradient(100deg, rgba(255, 181, 71, 0.07), var(--d-surface) 60%); color: var(--muted-strong);
}
.d-note b { color: var(--ink); }

/* ---------- bosqichlar (ketma-ketlik) ---------- */
.d-steps { list-style: none; counter-reset: step; margin: 24px 0 18px; padding: 0; display: grid; gap: 26px; }
.d-steps li { counter-increment: step; position: relative; padding-left: 48px; color: var(--muted-strong); min-width: 0; }
.d-steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--d-accent-soft); border: 1px solid rgba(155, 131, 255, 0.35); color: var(--ink); font-weight: 700; font-size: 0.92rem;
}
.d-steps li:not(:last-child)::after { content: ""; position: absolute; left: 15.5px; top: 36px; bottom: -22px; width: 1px; background: var(--d-hair); }
.d-steps strong { color: var(--ink); font-weight: 700; }

/* ---------- kalit maydoni ---------- */
.d-key {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0 8px; padding: 12px 14px;
  border: 1px solid var(--d-hair); border-radius: 12px; background: var(--d-surface);
}
.d-key label { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.d-key input {
  flex: 1 1 240px; min-width: 0; padding: 0.58rem 0.85rem;
  font-family: var(--mono); font-size: 0.88rem; color: var(--ink);
  background: var(--d-code); border: 1px solid var(--d-hair); border-radius: 9px;
}
.d-key input::placeholder { color: var(--muted); }
.d-key input:focus { outline: none; border-color: var(--d-accent); box-shadow: 0 0 0 3px var(--d-accent-soft); }
[data-key].filled { color: var(--d-get); }

/* ---------- kod bloklari ---------- */
.d-code {
  margin: 14px 0 24px; background: var(--d-code); border: 1px solid var(--d-hair); border-radius: var(--d-radius);
  font-family: var(--mono); font-size: 0.84rem; overflow: hidden;
  box-shadow: 0 14px 34px -22px rgba(0, 0, 0, 0.8);
}
.d-code-head { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 4px; min-height: 44px; border-bottom: 1px solid var(--d-hair); background: rgba(255, 255, 255, 0.025); }
.d-tabs { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.d-tab {
  font-family: var(--font); font-weight: 600; font-size: 0.85rem; padding: 0.76rem 0.82rem 0.7rem;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.d-tab:hover { color: var(--ink); }
.d-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--d-accent); }
.d-label { flex: 1; display: flex; align-items: center; gap: 8px; padding-left: 12px; font-family: var(--font); font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.d-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--d-accent); opacity: 0.7; }
.d-copy {
  flex: none; font-family: var(--font); font-weight: 600; font-size: 0.8rem; padding: 0.32rem 0.78rem;
  border-radius: 8px; border: 1px solid var(--d-hair); background: transparent; color: var(--muted-strong); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.d-copy:hover { color: var(--ink); border-color: var(--line-strong); background: var(--d-surface); }
.d-copy.ok { color: var(--d-get); border-color: rgba(79, 224, 176, 0.4); }
.d-code pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; line-height: 1.72; color: var(--ink); white-space: pre; tab-size: 2; scrollbar-width: thin; }
.d-code pre[hidden] { display: none; }
/* uzun JSON javoblar: "Hammasini ko'rsatish" bilan ochiladi */
.d-code.is-long pre { max-height: 22rem; overflow-y: hidden; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
.d-code.is-long.open pre { max-height: none; overflow-y: visible; -webkit-mask-image: none; mask-image: none; }
.d-more {
  display: block; width: 100%; padding: 0.6rem; border: 0; border-top: 1px solid var(--d-hair); background: rgba(255, 255, 255, 0.025);
  font-family: var(--font); font-size: 0.84rem; font-weight: 600; color: var(--muted-strong); cursor: pointer;
}
.d-more:hover { color: var(--ink); background: var(--d-surface); }

/* ---------- jadvallar ---------- */
.d-main .tbl-wrap { margin: 16px 0 28px; border: 1px solid var(--d-hair); border-radius: var(--d-radius); overflow-x: auto; background: var(--d-surface); }
.d-main table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 0.93rem; }
.d-main th {
  padding: 10px 14px; text-align: left; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  background: rgba(255, 255, 255, 0.035); border-bottom: 1px solid var(--d-hair);
}
.d-main td { padding: 11px 14px; vertical-align: top; color: var(--muted-strong); border-bottom: 1px solid var(--d-hair); }
.d-main tbody tr:last-child td { border-bottom: 0; }
.d-main tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.d-main td.k { font-family: var(--mono); font-size: 0.85rem; color: var(--ink); white-space: nowrap; }
.d-main td.t { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.d-main td.t.w { white-space: normal; min-width: 13rem; }
.d-main td.desc { min-width: 14rem; }

/* ---------- pastki qism ---------- */
.d-foot {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px;
  padding: 26px max(24px, env(safe-area-inset-right, 0px)) 30px max(24px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--d-hair); font-size: 0.9rem;
}
.d-foot a { color: var(--muted); text-decoration: none; }
.d-foot a:hover { color: var(--ink); }

/* ---------- mobil ---------- */
@media (max-width: 900px) {
  .d-shell { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: calc(68px + 20px + env(safe-area-inset-top, 0px)); }
  .d-side { position: static; max-height: none; overflow: visible; padding: 0; }
  .d-search { display: none; }
  .d-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .d-nav > li { flex: none; }
  .d-nav-h { display: none; }
  .d-nav > li > a { border: 1px solid var(--d-hair); border-radius: 999px; padding: 0.4rem 0.95rem; white-space: nowrap; color: var(--muted-strong); }
  .d-nav > li > a[aria-current="true"] { border-color: var(--d-accent); }
  .d-nav > li > a[aria-current="true"]::before { display: none; }
  .d-nav .sub, .d-nav > li:has([aria-current="true"]) > .sub { display: none; }
  .d-main h2 { margin-top: 56px; }
  .d-steps li { padding-left: 42px; }
  .d-ex-panel { grid-template-columns: minmax(0, 1fr); }
  .d-ex-req { border-right: 0; border-bottom: 1px solid var(--d-hair); }
}
@media (max-width: 640px) {
  .d-main { font-size: 0.97rem; }
  .d-ep { flex-wrap: wrap; }
  .d-actions-note { max-width: none; }
  .d-facts-strip { grid-template-columns: minmax(0, 1fr); }
  .d-nftgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-nftgrid li:nth-child(3) { display: none; }
  .d-main .d-callout { flex-wrap: wrap; }
  .d-callout .d-btn { margin-left: 0; width: 100%; }
}

/* =====================================================================
   Hujjatlar bosh sahifasi (/docs)
   ===================================================================== */
.d-hub {
  position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1140px; margin-inline: auto;
  padding: calc(68px + clamp(44px, 8vw, 88px) + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 96px max(24px, env(safe-area-inset-left, 0px));
}
.d-hub-head { text-align: center; max-width: 720px; margin-inline: auto; }
.d-eyebrow { margin: 0 0 12px; font-size: 0.95rem; font-weight: 600; color: var(--accent); }
.d-hub h1 { margin: 0 0 14px; font-size: clamp(2.2rem, 5.4vw, 3.4rem); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
.d-hub .d-lead { margin: 0 auto; font-weight: 500; }
.d-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 48px; }
.d-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 26px;
  border: 1px solid var(--d-hair); border-radius: 18px; background: var(--d-surface);
  color: var(--ink); text-decoration: none; overflow: hidden; transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.d-card::after {
  content: ""; position: absolute; inset: -40% -20% auto auto; width: 260px; height: 260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(155, 131, 255, 0.18), transparent); opacity: 0; transition: opacity 0.25s ease;
}
.d-card:hover { border-color: var(--d-accent); background: rgba(255, 255, 255, 0.055); transform: translateY(-2px); }
.d-card:hover::after { opacity: 1; }
.d-card h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
.d-card p { margin: 0; max-width: 34ch; color: var(--muted-strong); font-size: 0.98rem; }
.d-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.d-card li { padding: 0.25rem 0.75rem; border: 1px solid var(--d-hair); border-radius: 999px; font-size: 0.82rem; color: var(--muted-strong); }
.d-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.2); }
.d-ico svg, .d-go svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.d-go { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--ink); }
.d-go svg { width: 18px; height: 18px; stroke: currentColor; transition: transform 0.2s ease; }
.d-card:hover .d-go svg { transform: translateX(3px); }
.d-card-new { position: absolute; top: 22px; right: 22px; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #2A1B00; background: var(--accent); }
.d-quick { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 760px) { .d-quick { grid-template-columns: repeat(3, 1fr); } }
.d-quick a {
  display: grid; gap: 2px; padding: 16px 18px; border-radius: 12px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--d-hair); background: var(--d-surface); transition: border-color 0.2s ease;
}
.d-quick a:hover { border-color: var(--line-strong); }
.d-quick span { color: var(--muted); font-size: 0.9rem; }
.d-under { margin: 28px 0 0; color: var(--muted); font-size: 0.93rem; text-align: center; }
.d-under a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.d-under a:hover { text-decoration-color: var(--d-accent); }
@media (max-width: 980px) { .d-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .d-cards { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .d-card, .d-quick a, .d-go svg, .d-btn { transition: none; } .d-card:hover { transform: none; } }

/* =====================================================================
   Tezkor ma'lumotnoma, qoidalar, ketma-ketlik (docs/_ref.php)
   ===================================================================== */

/* metod belgisi jadvalda (endpoint satridagi .m bilan bir xil ranglar) */
.d-mb {
  display: inline-block; min-width: 3.7rem; padding: 0.18rem 0.55rem; border-radius: 7px; text-align: center;
  font-family: var(--mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--d-get); background: color-mix(in srgb, var(--d-get) 14%, transparent);
}
.d-mb[data-m="POST"] { color: var(--d-post); background: color-mix(in srgb, var(--d-post) 14%, transparent); }
.d-mb[data-m="PUT"], .d-mb[data-m="PATCH"] { color: var(--d-put); background: color-mix(in srgb, var(--d-put) 14%, transparent); }
.d-mb[data-m="DELETE"] { color: var(--d-del); background: color-mix(in srgb, var(--d-del) 14%, transparent); }

/* endpointlar jadvali: bosiladigan, ixcham */
.d-ref table { min-width: 0; }
.d-ref td:first-child { width: 1%; white-space: nowrap; }
.d-ref td.k a {
  color: var(--ink); text-decoration: none; overflow-wrap: anywhere; white-space: normal;
  border-bottom: 1px dashed var(--line-strong);
}
.d-ref td.k a:hover { border-bottom-color: var(--d-accent); }
.d-ref td.desc { min-width: 12rem; font-size: 0.9rem; }
.d-ref tbody tr { transition: background 0.15s ease; }
.d-main h4[id^="ref-"] {
  margin: 32px 0 4px; font-family: var(--font); font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--d-accent);
}
.d-main h4[id^="ref-"] + .d-hint { margin-bottom: 8px !important; }

/* umumiy qoidalar: yorliq — qiymat */
.d-facts { margin: 14px 0 26px; border: 1px solid var(--d-hair); border-radius: var(--d-radius); overflow: hidden; background: var(--d-surface); }
.d-facts > div {
  display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: 4px 18px;
  padding: 11px 16px; border-bottom: 1px solid var(--d-hair);
}
.d-facts > div:last-child { border-bottom: 0; }
.d-facts dt { margin: 0; font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.d-facts dd { margin: 0; min-width: 0; font-size: 0.95rem; color: var(--muted-strong); overflow-wrap: anywhere; }
@media (max-width: 640px) { .d-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* odatiy ketma-ketlik */
.d-flow { list-style: none; counter-reset: flow; margin: 14px 0 26px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 10px; }
.d-flow li {
  counter-increment: flow; display: grid; align-content: start; gap: 5px; padding: 14px 14px 12px;
  border: 1px solid var(--d-hair); border-radius: 12px; background: var(--d-surface);
}
.d-flow li::before {
  content: counter(flow); width: 22px; height: 22px; display: grid; place-items: center; margin-bottom: 4px;
  border-radius: 50%; background: var(--d-accent-soft); color: var(--ink); font-size: 0.78rem; font-weight: 700;
}
.d-flow b { color: var(--ink); font-size: 0.95rem; }
.d-flow span { color: var(--muted); font-size: 0.82rem; line-height: 1.45; overflow-wrap: anywhere; }
.d-flow a { color: var(--muted-strong); font-family: var(--mono); font-size: 0.78rem; }

/* klaviatura bilan yurganda ham aniq ko'rinsin */
.d-main a:focus-visible, .d-nav a:focus-visible, .d-copy:focus-visible, .d-tab:focus-visible, .d-switch a:focus-visible,
.d-ex-tab:focus-visible, .d-more:focus-visible, .d-ep-copy:focus-visible {
  outline: 2px solid var(--d-accent); outline-offset: 2px; border-radius: 6px;
}
/* jadvalda kod-tilda yozilgan katta qiymatlar mobil ekranda sahifani kengaytirmasin */
.d-main td code { overflow-wrap: anywhere; }
.d-main pre { max-width: 100%; }
@media print {
  .sh, .d-side, .d-switch, .d-actions, .d-key, .d-copy, .d-foot, .d-progress, .d-ex-tabs, .d-callout, .d-anchor, .d-ep-copy, .d-more { display: none !important; }
  .d-shell { display: block; padding: 0; }
  .d-code, .d-main table { break-inside: avoid; }
  .d-code.is-long pre { max-height: none; -webkit-mask-image: none; mask-image: none; }
}

/* Docs Bot hozircha yopiq: "Tez orada" kartasi va sahifasi */
.d-card.is-soon { opacity: 0.62; cursor: default; pointer-events: none; }
.d-card.is-soon:hover { border-color: var(--d-hair); background: var(--d-surface); transform: none; }
.d-soon-tag { padding: 0.2rem 0.8rem; border: 1px dashed var(--line-strong); border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--muted-strong); }
.d-soon-page { display: grid; place-items: center; min-height: 100vh; min-height: 100svh; padding-top: 0; padding-bottom: 0; }
.d-soon-act { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 28px !important; }

/* =====================================================================
   Docs MCP sahifasi (/docs/mcp)
   ===================================================================== */
.m-page {
  position: relative; z-index: 1; flex: 1; width: 100%; max-width: 980px; margin-inline: auto;
  padding: calc(68px + clamp(36px, 6vw, 72px) + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 96px max(24px, env(safe-area-inset-left, 0px));
}
.m-head { max-width: 760px; }
.m-head h1 { margin: 0 0 14px; font-size: clamp(2.2rem, 5.2vw, 3.3rem); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
.m-head h1 em { font-style: normal; background: linear-gradient(95deg, #C9BBFF, var(--d-accent) 50%, var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.m-head .d-lead { max-width: 60ch; }

/* ulanish manzili qutisi */
.m-url { margin: 28px 0 0; padding: 18px; border: 1px solid rgba(155, 131, 255, 0.35); border-radius: 18px; background: linear-gradient(120deg, rgba(155, 131, 255, 0.14), rgba(255, 255, 255, 0.03)); }
.m-url-label { margin: 0 0 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-strong); }
.m-url-row { display: flex; gap: 10px; align-items: stretch; }
.m-url-row code {
  flex: 1; min-width: 0; display: flex; align-items: center; padding: 0.8rem 1rem; border-radius: 12px; background: var(--d-code); border: 1px solid var(--d-hair);
  font-family: var(--mono); font-size: clamp(0.88rem, 2.4vw, 1.08rem); color: var(--ink); overflow-x: auto; white-space: nowrap; scrollbar-width: none;
}
.m-url-row .d-btn { flex: none; }
.m-test { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 14px; }
.m-status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--muted-strong); min-height: 1.5rem; }
.m-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.m-status[data-s="ok"] i { background: var(--d-get); box-shadow: 0 0 0 4px rgba(79, 224, 176, 0.18); }
.m-status[data-s="bad"] i { background: var(--d-del); box-shadow: 0 0 0 4px rgba(255, 125, 142, 0.18); }
.m-status[data-s="wait"] i { background: var(--accent); animation: m-pulse 1s ease-in-out infinite; }
@keyframes m-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .m-status[data-s="wait"] i { animation: none; } }
.m-tools-out { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.m-tools-out li { padding: 0.25rem 0.7rem; border: 1px solid var(--d-hair); border-radius: 999px; font-family: var(--mono); font-size: 0.78rem; color: var(--muted-strong); background: var(--d-code); }

/* bo'limlar */
.m-sec { margin: 64px 0 0; }
.m-sec > h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.15; font-weight: 700; }
.m-sec > p { margin: 0 0 18px; max-width: 66ch; color: var(--muted-strong); }
.m-sec code { font-family: var(--mono); font-size: 0.85em; padding: 0.12em 0.42em; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--ink); }
.m-sec a { color: var(--ink); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.m-sec a:hover { text-decoration-color: var(--d-accent); }

/* qadamlar */
.m-how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: how; }
.m-how li { counter-increment: how; display: grid; align-content: start; gap: 6px; padding: 18px; border: 1px solid var(--d-hair); border-radius: 16px; background: var(--d-surface); }
.m-how li::before { content: counter(how); width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 50%; background: var(--d-accent-soft); border: 1px solid rgba(155, 131, 255, 0.35); font-weight: 700; font-size: 0.85rem; }
.m-how b { font-size: 1rem; }
.m-how span { font-size: 0.92rem; color: var(--muted-strong); line-height: 1.5; }

/* mijozlar tabi */
.m-clients { border: 1px solid var(--d-hair); border-radius: 18px; background: var(--d-surface); overflow: hidden; }
.m-ctabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--d-hair); background: rgba(255, 255, 255, 0.02); overflow-x: auto; scrollbar-width: none; }
.m-ctab { flex: none; padding: 0.5rem 0.95rem; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--muted); background: none; cursor: pointer; }
.m-ctab:hover { color: var(--ink); }
.m-ctab[aria-selected="true"] { color: var(--ink); background: var(--d-accent-soft); border-color: rgba(155, 131, 255, 0.35); }
.m-ctab:focus-visible { outline: 2px solid var(--d-accent); outline-offset: 2px; }
.m-cpanel { padding: 22px; }
.m-cpanel[hidden] { display: none; }
.m-cpanel > p { margin: 0 0 12px; max-width: 70ch; color: var(--muted-strong); }
.m-cpanel > ol { margin: 0 0 14px; padding-left: 1.2rem; color: var(--muted-strong); }
.m-cpanel > ol li { margin: 0 0 6px; }
.m-cpanel .d-code { margin: 12px 0 0; }
.m-cpanel .d-hint { margin-top: 12px !important; }

/* vositalar kartochkalari */
.m-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.m-tool { display: grid; align-content: start; gap: 6px; padding: 16px 18px; border: 1px solid var(--d-hair); border-radius: 14px; background: var(--d-surface); min-width: 0; }
.m-tool code { width: fit-content; font-size: 0.88rem; color: #C9BBFF; background: var(--d-accent-soft); }
.m-tool p { margin: 0; font-size: 0.92rem; color: var(--muted-strong); line-height: 1.5; }
.m-tool small { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); overflow-wrap: anywhere; }

/* misol so'rovlar */
.m-asks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.m-asks li { position: relative; padding: 14px 16px 14px 44px; border: 1px solid var(--d-hair); border-radius: 14px; background: var(--d-surface); color: var(--ink); font-size: 0.97rem; line-height: 1.5; }
.m-asks li::before { content: "›"; position: absolute; left: 16px; top: 10px; font-size: 1.5rem; line-height: 1.2; color: var(--accent); font-weight: 700; }

/* xavfsizlik */
.m-safe { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-safe li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border: 1px solid var(--d-hair); border-radius: 12px; background: var(--d-surface); color: var(--muted-strong); font-size: 0.95rem; line-height: 1.5; }
.m-safe li::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; font-size: 0.72rem; font-weight: 800; color: #07281D; background: var(--d-get); }
.m-safe b { color: var(--ink); }

@media (max-width: 760px) {
  .m-how { grid-template-columns: minmax(0, 1fr); }
  .m-tools { grid-template-columns: minmax(0, 1fr); }
  .m-url-row { flex-direction: column; }
  .m-cpanel { padding: 16px; }
}

/* "Nusxalandi" holati: endpoint va sarlavha tugmalari ham .d-copy.ok kabi yashil */
.d-ep-copy.ok, .d-anchor.ok { color: var(--d-get); border-color: rgba(79, 224, 176, 0.4); opacity: 1; }
.d-btn.ok { color: var(--d-get); border-color: rgba(79, 224, 176, 0.4); }

/* Misol sarlavhasida POST metodi amber rangda */
.d-ex-cap em[data-m="POST"] { color: var(--d-post); }
/* MCP sahifasi: pastdagi havola qatori xavfsizlik ro'yxatidan ajralib tursin */
.m-sec > .d-hint { margin-top: 16px !important; }
