/* ============================================================
   CodeMeet Go v1.1.0 — Documentation UI
   Handcrafted CSS. Light / Dark, RTL / LTR, responsive.
   Modular, PWA-ready. Bilingual (fa/en).
   ============================================================ */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f2f4fa;
  --surface-3: #e9edf6;
  --text: #121725;
  --text-soft: #3d465c;
  --muted: #69738c;
  --border: #e0e5f0;
  --border-strong: #cdd5e6;
  --brand: #5b4df5;
  --brand-2: #0fb9a6;
  --brand-3: #ff7a59;
  --brand-soft: rgba(91, 77, 245, .10);
  --brand-soft-2: rgba(15, 185, 166, .12);
  --danger: #e5484d;
  --warn: #d97706;
  --ok: #12a150;
  --info: #2f7cf6;
  --code-bg: #0f1526;
  --code-text: #dbe3f4;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 10px 30px -12px rgba(16, 24, 40, .18);
  --shadow-lg: 0 30px 70px -30px rgba(16, 24, 40, .30);
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --header-h: 66px;
  --sidebar-w: 292px;
  --toc-w: 232px;
  --font-fa: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --grad: linear-gradient(135deg, #5b4df5 0%, #8b5cf6 48%, #0fb9a6 100%);
  --grad-soft: linear-gradient(135deg, rgba(91, 77, 245, .12), rgba(15, 185, 166, .12));
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #080b14;
  --bg-soft: #0c111d;
  --surface: #101625;
  --surface-2: #151d2f;
  --surface-3: #1b2439;
  --text: #eef2fb;
  --text-soft: #c4cde0;
  --muted: #8b97b0;
  --border: #212b42;
  --border-strong: #2d3a57;
  --brand: #8175ff;
  --brand-2: #2ad4bf;
  --brand-3: #ff9277;
  --brand-soft: rgba(129, 117, 255, .16);
  --brand-soft-2: rgba(42, 212, 191, .14);
  --danger: #ff6369;
  --warn: #f5a524;
  --ok: #3dd68c;
  --info: #5b9dff;
  --code-bg: #050912;
  --code-text: #dbe3f4;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 16px 40px -18px rgba(0, 0, 0, .75);
  --shadow-lg: 0 40px 90px -35px rgba(0, 0, 0, .85);
  --grad-soft: linear-gradient(135deg, rgba(129, 117, 255, .16), rgba(42, 212, 191, .10));
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
html[dir="rtl"] body { font-family: var(--font-fa); }
html[dir="ltr"] body { font-family: var(--font-en); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58rem 30rem at 12% -8%, var(--brand-soft), transparent 60%),
    radial-gradient(48rem 26rem at 100% 0%, var(--brand-soft-2), transparent 60%);
}
img, svg { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: fixed; inset-inline-start: 12px; top: -80px; z-index: 300; background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 10px; transition: top .2s; }
.skip-link:focus { top: 0; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. Header ---------- */
.progress-bar {
  position: fixed; inset-inline: 0; top: 0; height: 3px; z-index: 210;
  background: var(--grad); transform-origin: left; transform: scaleX(0);
  transition: transform .1s linear;
}
html[dir="rtl"] .progress-bar { transform-origin: right; }

.site-header {
  position: fixed; top: 0; inset-inline: 0; height: var(--header-h); z-index: 200;
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 8px 18px -8px rgba(91, 77, 245, .7);
  flex: 0 0 auto;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-name { font-weight: 800; letter-spacing: -.2px; font-size: 15.5px; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .4px; font-family: var(--font-mono); }
.header-spacer { flex: 1 1 auto; }

.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  transition: .18s ease; flex: 0 0 auto;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.search-trigger {
  display: flex; align-items: center; gap: 9px; min-width: 210px;
  height: 38px; padding: 0 12px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  transition: .18s;
}
.search-trigger:hover { border-color: var(--brand); color: var(--brand); }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger span { font-size: 13px; flex: 1; text-align: start; }
.search-trigger kbd {
  font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--border);
  border-bottom-width: 2px; padding: 1px 6px; border-radius: 5px; color: var(--muted); background: var(--surface-2);
}

.segmented {
  display: inline-flex; padding: 3px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); gap: 2px;
}
.segmented button {
  border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 5px 10px; border-radius: 8px; line-height: 1.2; transition: .18s;
}
.segmented button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.menu-btn { display: none; }

/* ---------- 4. Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0;
  max-width: 1560px;
  margin: 0 auto;
  padding-top: var(--header-h);
  min-height: 100vh;
}
.sidebar {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain;
  border-inline-end: 1px solid var(--border);
  padding: 22px 14px 40px;
}
.sidebar-inner { padding-inline: 6px; }
.nav-group { margin-bottom: 22px; }
.nav-group-title {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px; padding-inline-start: 12px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin: 2px 0; border-radius: 9px;
  color: var(--text-soft); font-size: 13.7px; font-weight: 550;
  transition: .15s; position: relative;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; transition: .15s; }
.nav-link:hover svg { color: var(--brand); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 750; }
.nav-link.active svg { color: var(--brand); }
.nav-link.active::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; translate: 0 -50%;
  width: 3px; height: 18px; border-radius: 99px; background: var(--brand);
}
.nav-badge {
  margin-inline-start: auto; font-family: var(--font-mono); font-size: 9.5px;
  padding: 1px 6px; border-radius: 99px; background: var(--surface-3); color: var(--muted);
}

.content-col { min-width: 0; padding: 34px clamp(24px, 4vw, 62px) 70px; }
.doc-header { max-width: 900px; margin: 0 auto 26px; }
.breadcrumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted); margin-bottom: 14px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb svg { width: 12px; height: 12px; }
.doc-title { font-size: clamp(28px, 3.3vw, 42px); line-height: 1.18; letter-spacing: -.8px; margin: 0 0 12px; font-weight: 850; }
.doc-subtitle { font-size: 16.5px; color: var(--muted); margin: 0; max-width: 760px; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; border: 1px solid var(--border); color: var(--muted);
  background: var(--surface);
}
.pill.brand { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: transparent; }

/* ---------- 5. Article ---------- */
.article { max-width: 900px; margin: 0 auto; }
.article > section { margin: 0 0 42px; scroll-margin-top: calc(var(--header-h) + 26px); }
.article h2 {
  font-size: clamp(22px, 2.2vw, 28px); line-height: 1.3; letter-spacing: -.35px;
  margin: 0 0 14px; padding-top: 4px; font-weight: 800; position: relative;
}
.article h2 .h-anchor { opacity: 0; margin-inline-start: 8px; color: var(--muted); font-size: .7em; }
.article h2:hover .h-anchor { opacity: 1; }
.article h3 { font-size: 18.5px; margin: 28px 0 10px; font-weight: 750; letter-spacing: -.2px; }
.article h4 { font-size: 15.5px; margin: 22px 0 8px; font-weight: 750; }
.article p { margin: 0 0 14px; color: var(--text-soft); }
.article strong { color: var(--text); }
.article ul, .article ol { margin: 0 0 16px; padding-inline-start: 24px; color: var(--text-soft); }
.article li { margin: 5px 0; }
.article li::marker { color: var(--brand); }
.article hr { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }
.article a { font-weight: 550; }
.lead { font-size: 17px; color: var(--text-soft); }

/* Inline code */
.article :not(pre) > code, .code-inline {
  font-family: var(--font-mono); font-size: .855em; direction: ltr; unicode-bidi: isolate;
  background: var(--surface-3); color: var(--brand); padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--border); white-space: nowrap;
}
.article a code { color: inherit; }

/* Code block */
.code-block {
  position: relative; margin: 16px 0 22px; border-radius: var(--radius);
  background: var(--code-bg); border: 1px solid #1d2740; overflow: hidden;
  box-shadow: var(--shadow-sm); direction: ltr;
}
.code-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .025);
}
.code-dots { display: flex; gap: 5px; }
.code-dots i { width: 9px; height: 9px; border-radius: 99px; display: block; }
.code-dots i:nth-child(1) { background: #ff5f57; }
.code-dots i:nth-child(2) { background: #febc2e; }
.code-dots i:nth-child(3) { background: #28c840; }
.code-lang {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase;
  color: #7d8ba8; margin-inline-start: 4px;
}
.copy-btn {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04);
  color: #aab6cf; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 7px; transition: .16s;
}
.copy-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .09); }
.copy-btn svg { width: 13px; height: 13px; }
.copy-btn.copied { color: #3dd68c; border-color: rgba(61, 214, 140, .4); }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; }
.code-block code {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.72;
  color: var(--code-text); background: transparent; padding: 0; border: 0; white-space: pre;
}
.hljs { background: transparent !important; padding: 0 !important; }

/* Callouts */
.callout {
  position: relative; display: flex; gap: 12px; padding: 14px 16px; margin: 18px 0;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); font-size: 14.3px;
}
.callout::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 99px; background: var(--info); }
.callout .c-icon { flex: 0 0 auto; width: 20px; height: 20px; color: var(--info); margin-top: 3px; }
.callout .c-icon svg { width: 20px; height: 20px; }
.callout p:last-child { margin-bottom: 0; }
.callout b, .callout strong { color: var(--text); }
.callout.info { background: color-mix(in srgb, var(--info) 6%, var(--surface)); }
.callout.tip { background: color-mix(in srgb, var(--ok) 6%, var(--surface)); }
.callout.tip::before, .callout.tip .c-icon { background: var(--ok); color: var(--ok); }
.callout.warning { background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.callout.warning::before { background: var(--warn); }
.callout.warning .c-icon { color: var(--warn); }
.callout.danger { background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.callout.danger::before { background: var(--danger); }
.callout.danger .c-icon { color: var(--danger); }
.callout.note::before { background: var(--brand); }
.callout.note .c-icon { color: var(--brand); }

/* Tables */
.table-wrap {
  margin: 16px 0 24px; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; background: var(--surface); box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13.6px; min-width: 480px; }
thead th {
  text-align: start; padding: 11px 14px; background: var(--surface-2);
  font-size: 12px; font-weight: 800; letter-spacing: .3px; color: var(--muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--brand) 3.5%, transparent); }
td code, th code { white-space: nowrap; }
td:first-child { color: var(--text); font-weight: 600; }
.table-wrap.compact table { min-width: 0; }
.table-wrap.compact tbody td { padding: 7px 12px; }

/* Cards / grids inside content */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0 24px; }
.card {
  display: block; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); transition: .2s; box-shadow: var(--shadow-sm);
}
a.card:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.card .card-ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 12px;
}
.card .card-ico svg { width: 20px; height: 20px; }
.card h4 { margin: 0 0 6px; font-size: 14.5px; font-weight: 750; }
.card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.card .card-more { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--brand); margin-top: 10px; }

/* API signature blocks */
.sig {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  padding: 11px 14px; margin: 8px 0; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); font-family: var(--font-mono);
  font-size: 12.7px; direction: ltr; text-align: left; overflow-x: auto;
}
.sig .fn { color: var(--brand); font-weight: 700; }
.sig .ret { color: var(--muted); }
.sig .tag { font-family: var(--font-en); font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }

/* Steps */
.steps { counter-reset: step; margin: 18px 0 24px; padding: 0; list-style: none; }
.steps li { position: relative; padding-inline-start: 44px; padding-bottom: 20px; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; inset-inline-start: 0; top: 0;
  width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; font-family: var(--font-en);
}
.steps li::after { content: ""; position: absolute; inset-inline-start: 14px; top: 32px; bottom: 2px; width: 1px; background: var(--border); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps li b { display: block; color: var(--text); margin-bottom: 3px; }

/* Feature chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 20px; }
.chip { font-size: 11.5px; font-weight: 650; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }

/* TOC */
.toc-col { padding: 36px 16px; position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; }
.toc-title { font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; padding-inline-start: 10px; }
.toc a {
  display: block; font-size: 12.5px; color: var(--muted); padding: 4px 10px;
  border-inline-start: 2px solid transparent; line-height: 1.5; transition: .15s;
}
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--brand); border-inline-start-color: var(--brand); font-weight: 650; background: var(--brand-soft); border-radius: 0 6px 6px 0; }
html[dir="rtl"] .toc a.active { border-radius: 6px 0 0 6px; }
.toc a.toc-sub { padding-inline-start: 22px; font-size: 12px; }

/* Page footer */
.page-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 900px; margin: 54px auto 0; padding-top: 26px; border-top: 1px solid var(--border); }
.page-nav a {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: .18s;
}
.page-nav a:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow); }
.page-nav a.next { text-align: end; }
.page-nav svg { width: 16px; height: 16px; flex: 0 0 auto; }
.page-nav .pn-label { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.page-nav .pn-title { font-size: 14px; font-weight: 700; color: var(--brand); }
.page-nav a.next .pn-label { justify-content: flex-end; }
.page-nav .empty { border: 0; background: transparent; }

.site-footer {
  max-width: 900px; margin: 44px auto 0; padding: 22px 0 0; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- 6. Landing ---------- */
.landing { padding-top: var(--header-h); }
.hero {
  position: relative; overflow: hidden; padding: clamp(60px, 9vw, 110px) 24px 64px;
  text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(42rem 24rem at 50% -10%, var(--brand-soft), transparent 70%),
    radial-gradient(30rem 20rem at 88% 18%, var(--brand-soft-2), transparent 70%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  font-size: 12px; font-weight: 650; box-shadow: var(--shadow-sm); margin-bottom: 22px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.hero h1 {
  font-size: clamp(38px, 6.4vw, 72px); line-height: 1.08; letter-spacing: -2.2px;
  margin: 0 auto 18px; max-width: 980px; font-weight: 900;
}
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .hero-sub { max-width: 720px; margin: 0 auto 30px; font-size: clamp(15px, 2vw, 18px); color: var(--muted); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 34px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; font-size: 14px; font-weight: 700;
  border: 1px solid transparent; transition: .2s; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 10px 24px -10px var(--brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); box-shadow: 0 14px 30px -10px var(--brand); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn svg { width: 17px; height: 17px; }
.install-box {
  display: flex; align-items: center; gap: 12px; max-width: 620px; margin: 0 auto;
  padding: 11px 12px 11px 18px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--code-bg); color: #c9d5ee; box-shadow: var(--shadow);
  direction: ltr; text-align: left; overflow: hidden;
}
.install-box .prompt { color: var(--brand-2); font-family: var(--font-mono); font-size: 13px; }
.install-box code { font-family: var(--font-mono); font-size: 13px; color: #e6ecfa; white-space: nowrap; overflow-x: auto; flex: 1; }
.install-box .copy-btn { flex: 0 0 auto; }

.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 34px auto 0; max-width: 820px;
}
.hero-stat {
  flex: 1 1 150px; max-width: 200px; padding: 13px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(8px);
}
.hero-stat b { display: block; font-size: 22px; font-weight: 850; letter-spacing: -.5px; color: var(--text); line-height: 1.2; }
.hero-stat span { font-size: 11.5px; color: var(--muted); }

.landing-section { max-width: 1180px; margin: 0 auto; padding: 42px 24px; }
.landing-section h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.7px; margin: 0 0 8px; font-weight: 850; }
.landing-section .sec-sub { color: var(--muted); margin: 0 0 26px; max-width: 680px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.feature-card {
  padding: 22px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-sm); transition: .2s;
}
.feature-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.feature-card .fc-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--brand); margin-bottom: 14px; }
.feature-card .fc-ico svg { width: 21px; height: 21px; }
.feature-card h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 750; }
.feature-card p { margin: 0; color: var(--muted); font-size: 13.2px; line-height: 1.65; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.doc-link {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: .18s;
}
.doc-link:hover { text-decoration: none; border-color: var(--brand); background: var(--brand-soft); }
.doc-link .dl-ico { color: var(--brand); flex: 0 0 auto; margin-top: 2px; }
.doc-link .dl-ico svg { width: 18px; height: 18px; }
.doc-link b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.doc-link span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.cta-band {
  max-width: 1180px; margin: 20px auto 60px; padding: 36px clamp(22px, 4vw, 44px);
  border-radius: var(--radius-lg); background: var(--grad); color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  box-shadow: 0 30px 60px -30px rgba(91, 77, 245, .6);
}
.cta-band h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.4px; }
.cta-band p { margin: 0; opacity: .85; font-size: 13.5px; }
.cta-band .btn { background: #fff; color: var(--brand); box-shadow: none; }

/* ---------- 7. Search ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 400; display: none;
  background: rgba(8, 11, 20, .55); backdrop-filter: blur(7px);
  padding: 12vh 18px 24px; overflow-y: auto;
}
.search-overlay.open { display: block; animation: fadeIn .15s ease; }
.search-panel {
  max-width: 660px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: popIn .18s ease;
}
.search-field { display: flex; align-items: center; gap: 11px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.search-field svg { width: 19px; height: 19px; color: var(--muted); flex: 0 0 auto; }
.search-field input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15.5px; min-width: 0; }
.search-field kbd { font-family: var(--font-mono); font-size: 10px; border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; color: var(--muted); }
.search-results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-result {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: var(--text);
}
.search-result:hover, .search-result.sel { background: var(--brand-soft); text-decoration: none; }
.search-result .sr-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex: 0 0 auto; }
.search-result .sr-ico svg { width: 15px; height: 15px; }
.search-result b { display: block; font-size: 13.5px; }
.search-result span { display: block; font-size: 11px; color: var(--muted); }
.search-result .sr-page { margin-inline-start: auto; font-size: 10px; color: var(--muted); background: var(--surface-2); padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.search-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }
.search-hint { padding: 9px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.search-hint kbd { font-family: var(--font-mono); border: 1px solid var(--border); border-bottom-width: 2px; padding: 0 5px; border-radius: 4px; font-size: 9.5px; }

/* ---------- 8. Misc ---------- */
.mobile-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 149; display: none; }
.toast {
  position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 500;
  background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px;
  font-size: 12.5px; font-weight: 650; opacity: 0; transform: translateY(10px);
  transition: .22s; pointer-events: none; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: none; }
kbd { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* External link icon */
.ext::after { content: "↗"; font-size: .75em; margin-inline-start: 3px; opacity: .6; }

/* Endpoint methods */
.http { font-family: var(--font-mono); font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 5px; letter-spacing: .3px; display: inline-block; }
.http.get { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.http.post { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.http.get, .http.post { direction: ltr; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero > * { animation: fadeUp .55s cubic-bezier(.2, .7, .2, 1) both; }
.hero > *:nth-child(2) { animation-delay: .05s; }
.hero > *:nth-child(3) { animation-delay: .1s; }
.hero > *:nth-child(4) { animation-delay: .15s; }
.hero > *:nth-child(5) { animation-delay: .2s; }
.hero > *:nth-child(6) { animation-delay: .25s; }

/* ---------- 9. Responsive ---------- */
@media (max-width: 1280px) {
  :root { --toc-w: 0px; }
  .toc-col { display: none; }
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .search-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .brand-sub { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: 60px; }
  .menu-btn { display: grid; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: var(--header-h) 0; inset-inline-start: 0; width: min(300px, 86vw);
    z-index: 150; background: var(--bg); transform: translateX(-105%); transition: transform .22s ease;
    height: auto; border-inline-end: 1px solid var(--border);
  }
  html[dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.open { transform: none !important; }
  .mobile-backdrop.open { display: block; }
  .content-col { padding: 26px 20px 60px; }
  .segmented .lang-label { display: none; }
  .header-tools { gap: 6px; }
  .doc-title { letter-spacing: -.5px; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .site-header { padding: 0 13px; gap: 10px; }
  .brand-text { display: none; }
  .search-trigger { display: none; }
  .content-col { padding: 22px 15px 52px; }
  .article > section { margin-bottom: 34px; }
  .page-nav { grid-template-columns: 1fr; }
  .page-nav a.next { text-align: start; }
  .page-nav a.next .pn-label { justify-content: flex-start; }
  .hero { padding-top: 48px; }
  .hero h1 { letter-spacing: -1.2px; }
  .install-box { padding-inline: 12px; }
  .install-box code { font-size: 11.5px; }
  .code-block pre { padding: 14px; }
  .code-block code { font-size: 12px; }
  .callout { padding: 12px 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- 10. Print ---------- */
@media print {
  .site-header, .sidebar, .toc-col, .page-nav, .site-footer, .progress-bar, .copy-btn, .mobile-backdrop { display: none !important; }
  .layout { display: block; padding-top: 0; }
  .content-col { padding: 0; }
  body { background: #fff; color: #000; }
  .code-block { border: 1px solid #ccc; box-shadow: none; }
  .article > section { break-inside: avoid; }
}
