/* ==========================================================
   مستندات و راهنما — استایل قالب وردپرس (تم روشن، RTL، سبک ابرآروان)
   ستون راست: دسته‌بندی راهنماها | وسط: محتوا | چپ: عناوین صفحه
   ========================================================== */

/* ---------- فونت وزیرمتن (لوکال، بدون نیاز به CDN) ---------- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---------- متغیرها ---------- */
:root {
  --header-h: 64px;
  --theme-header-h: 0px;       /* ارتفاع هدر قالب در حالت «هدر قالب» */
  --admin-h: 0px;              /* ارتفاع نوار مدیریت وردپرس */
  --sidebar-w: 280px;
  --toc-w: 240px;
  --bg: #ffffff;
  --bg-soft: #f5f7f9;
  --border: #e7eaee;
  --text: #22282f;
  --text-2: #5b6472;
  --text-3: #8b93a1;
  --accent: #00b8b8;           /* فیروزه‌ای برند ابرآروان */
  --accent-dark: #0a9090;
  --accent-soft: #e4fafa;
  --accent-border: #b9eeee;
  --code-bg: #0f1728;
  --code-border: #1e2a44;
  --code-text: #d8e1ee;
  --radius: 10px;
  --font: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  --mono: 'Cascadia Code', 'JetBrains Mono', Consolas, Menlo, monospace;
}
body.dg-mode-theme, body.dg-custom-html { --header-h: var(--theme-header-h); }
body.admin-bar { --admin-h: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar { --admin-h: 46px; }
}

/* ---------- پایه (اسکوپ‌شده تا با قالب وردپرس تداخل نکند) ---------- */
html { scroll-behavior: smooth; }
body.dg-docs {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
  margin: 0 !important;
  padding: 0 !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.topbar *, .layout *, .footer *, .dg-header-custom *, .dg-fab-menu { margin: 0; padding: 0; box-sizing: border-box; }
.dg-docs a { color: var(--accent); text-decoration: none; }
.dg-docs a:hover { text-decoration: underline; }
.dg-docs button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
.dg-docs img, .dg-docs svg { flex-shrink: 0; }
.dg-docs ::selection { background: var(--accent-soft); }
.dg-docs :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- هدر اختصاصی ---------- */
.topbar {
  position: sticky; top: var(--admin-h); z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 16px;
}
.topbar-start { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #00b8b8, #16ccc4 65%, #52ded6);
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(0, 184, 184, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.4; }
.brand-text strong { font-size: 15.5px; font-weight: 700; }
.brand-text small { font-size: 11px; color: var(--text-3); font-weight: 400; }
.topnav { display: flex; align-items: center; gap: 24px; }
.topnav a { color: var(--text-2); font-size: 14px; font-weight: 500; }
.topnav a:hover { color: var(--accent); text-decoration: none; }
.topnav .btn-panel {
  background: var(--accent); color: #fff;
  padding: 8px 18px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  transition: background .15s;
}
.topnav .btn-panel:hover { background: var(--accent-dark); color: #fff; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; color: var(--text-2);
  display: none; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.menu-btn { display: none; }

/* دکمه شناور منوی موبایل (فقط وقتی هدر افزونه نمایش داده نمی‌شود) */
.dg-fab-menu {
  display: none;
  position: fixed; bottom: 18px; inset-inline-start: 16px; z-index: 70;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px rgba(0, 184, 184, .4);
  align-items: center; justify-content: center;
}

/* ---------- چیدمان ----------
   در RTL ستون اول (سایدبار) در راست، ستون آخر (فهرست) در چپ قرار می‌گیرد */
.layout {
  max-width: 1440px; margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  align-items: start;
}
.layout.no-toc { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.layout.no-toc .toc { display: none; }

/* ---------- سایدبار راست (دسته‌بندی راهنماها) — سبک ابرآروان ---------- */
.sidebar {
  position: sticky;
  top: calc(var(--admin-h) + var(--header-h));
  height: calc(100vh - var(--admin-h) - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg);
  border-inline-end: 1px solid var(--border);
  padding: 14px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: #d9dde5 transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #d9dde5; border-radius: 6px; }
.sidebar-close {
  position: absolute; top: 8px; inset-inline-end: 10px;
  width: 32px; height: 32px; z-index: 2;
}
.dg-docs a.docs-home-link {
  display: block;
  padding: 4px 18px 12px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.dg-docs a.docs-home-link:hover { color: var(--accent); text-decoration: none; }

/* جعبه جستجو: دکمهٔ باز کردن مودال جستجوی کامل */
.search-wrap { margin: 0 14px 14px; }
.dg-docs .search-fake {
  width: 100%; height: 38px;
  display: flex; align-items: center; gap: 9px;
  padding-inline-start: 12px; padding-inline-end: 8px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-soft);
  font: inherit; font-size: 13px; color: var(--text-3); text-align: start;
  transition: border-color .15s, box-shadow .15s, background .15s, color .15s;
}
.dg-docs .search-fake > svg { color: var(--text-3); }
.dg-docs .search-fake .search-fake-text {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dg-docs .search-fake kbd {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
  background: #fff; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px;
}
.dg-docs .search-fake:hover, .dg-docs .search-fake:focus-visible {
  border-color: var(--accent); background: #fff; color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-soft); text-decoration: none;
}

/* دسته‌ها (آکاردئون) — ردیف دسته با فلش چپ/پایین مثل ابرآروان */
.cats { padding: 0; }
.cat { margin: 0; }
.cat-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; padding-inline-start: 18px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  text-align: start; line-height: 1.7;
  transition: background .15s;
}
.cat-head:hover, .cat.open > .cat-head { background: var(--bg-soft); }
.cat-head .chev { color: var(--text-3); transition: transform .25s ease; }
.cat.open > .cat-head .chev { transform: rotate(-90deg); }

.cat-body {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.cat-body-inner { overflow: hidden; min-height: 0; }
.cat.open > .cat-body { grid-template-rows: 1fr; }

/* نام دسته + تصویر کوچک دسته */
.cat-head .cat-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.cat-head .cat-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-thumb {
  width: 20px; height: 20px; border-radius: 6px; object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
}

/* زیر‌دسته‌ها (دسته‌های فرزند داخل دسته والد) */
.cat.sub .cat-head { padding: 6px 14px; padding-inline-start: 34px; font-size: 12.5px; color: var(--text-2); }
.cat.sub .cat-head .cat-name-text { font-weight: 500; }
.cat.sub .guide-link { padding-inline-start: 50px; font-size: 12.5px; }
.cat.sub .cat.sub .cat-head { padding-inline-start: 52px; }
.cat.sub .cat.sub .guide-link { padding-inline-start: 68px; }

.dg-docs a.guide-link {
  position: relative; display: block;
  padding: 6px 14px; padding-inline-start: 30px;
  font-size: 13px; font-weight: 400; line-height: 1.8;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.dg-docs a.guide-link:hover { background: var(--bg-soft); color: var(--accent); text-decoration: none; }
.dg-docs a.guide-link.active { color: var(--accent); font-weight: 600; }
.dg-docs a.guide-link.active::after {
  content: '';
  position: absolute; inset-inline-start: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 2px;
  background: var(--accent);
}
.empty-state {
  padding: 28px 16px; text-align: center;
  color: var(--text-3); font-size: 13px; line-height: 2;
}
.empty-state b { color: var(--text-2); }

/* لایه تاریک پشت منوی موبایل */
.overlay {
  position: fixed; inset: 0; z-index: 59;
  background: rgba(15, 23, 42, .45);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

/* ---------- ستون میانی (محتوا) ---------- */
.content { padding: 26px 42px 60px; max-width: 920px; min-width: 0; }

/* breadcrumb چیپ‌مانند مثل ابرآروان */
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.breadcrumb .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff;
  font-size: 12px; color: var(--text-2); line-height: 1.9;
  transition: border-color .15s, color .15s;
}
.breadcrumb a.chip:hover {
  color: var(--accent); border-color: var(--accent-border);
  text-decoration: none;
}
.breadcrumb .chip-icon { padding: 3px 8px; }
.breadcrumb .chip-icon svg { color: var(--text-3); }
.breadcrumb a.chip-icon:hover svg { color: var(--accent); }
.breadcrumb .crumb-sep { color: #c9cfd8; font-size: 11px; user-select: none; }
.breadcrumb .chip-current {
  background: var(--accent-soft); border-color: var(--accent-border);
  color: var(--accent-dark); font-weight: 600;
}

.doc-head h1 {
  font-size: 27px; font-weight: 700; line-height: 1.55;
  letter-spacing: -.2px;
  color: var(--accent);
}
.doc-desc { color: var(--text-2); font-size: 14.5px; margin-top: 8px; max-width: 640px; }
.doc-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 14px; font-size: 12.5px; color: var(--text-3);
}
.doc-meta b { color: var(--text-2); font-weight: 600; }
.doc-meta .sep { color: #c6ccd6; font-size: 10px; }

/* ---------- تایپوگرافی مقاله (تیترها فیروزه‌ای مثل ابرآروان) ---------- */
.article { margin-top: 26px; }
.article h2 {
  font-size: 21px; font-weight: 700; line-height: 1.6;
  margin: 40px 0 14px;
  color: var(--accent);
  scroll-margin-top: calc(var(--admin-h) + var(--header-h) + 18px);
  clear: both;
}
.article h2:first-child { margin-top: 0; }
.article h3 {
  font-size: 16.5px; font-weight: 600; line-height: 1.7;
  margin: 30px 0 10px;
  scroll-margin-top: calc(var(--admin-h) + var(--header-h) + 18px);
}
.article p {
  color: #343b47; font-size: 14.5px; line-height: 2.1;
  margin: 12px 0;
  text-align: justify;
}
.article ul, .article ol { margin: 12px 0; padding-inline-start: 26px; color: #343b47; font-size: 14.5px; }
.article li { margin: 8px 0; line-height: 2; }
.article ul li::marker { color: var(--accent); }
.article ol li::marker { color: var(--text-3); font-size: .9em; }
.article strong { font-weight: 700; color: var(--text); }
.article a { color: var(--accent); font-weight: 500; }
.article img { max-width: 100%; height: auto; border-radius: 10px; }
.article figure { margin: 16px 0; }
.article figcaption { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 8px; }
.article blockquote {
  border-inline-start: 3px solid var(--accent);
  background: var(--bg-soft);
  padding: 10px 16px; margin: 16px 0;
  border-radius: 8px; color: var(--text-2);
}

/* لیست مراحل با شماره دایره‌ای */
ol.steps { list-style: none; counter-reset: step; padding-inline-start: 0; margin: 18px 0; }
ol.steps li {
  counter-increment: step;
  position: relative;
  padding-inline-start: 46px;
  margin: 0 0 18px;
  line-height: 2;
}
ol.steps li::before {
  content: counter(step, persian);
  position: absolute; inset-inline-start: 0; top: 4px;
  width: 31px; height: 31px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  border: 1px solid var(--accent-border);
  font-size: 13.5px; font-weight: 700;
  display: grid; place-items: center;
}
ol.steps li:not(:last-child)::after {
  content: '';
  position: absolute; inset-inline-start: 15px; top: 40px; bottom: -12px;
  width: 1px;
  background: var(--accent-border);
}

/* کد و ترمینال */
.article pre {
  direction: ltr; text-align: left;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  padding: 16px 18px; margin: 16px 0;
  overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.9;
  scrollbar-width: thin; scrollbar-color: #33415e transparent;
}
.article pre::-webkit-scrollbar { height: 6px; }
.article pre::-webkit-scrollbar-thumb { background: #33415e; border-radius: 6px; }
.article pre code { font-family: var(--mono); background: none; padding: 0; border: none; color: inherit; font-size: inherit; }
.article :not(pre) > code {
  direction: ltr; unicode-bidi: isolate;
  font-family: var(--mono); font-size: .86em;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 7px;
  color: #b3541e;
}

/* کادرهای نکته و هشدار */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid; border-radius: 12px;
  padding: 14px 16px; margin: 18px 0;
  font-size: 13.5px; line-height: 2;
}
.callout > div { flex: 1; min-width: 0; }
.callout svg { width: 18px; height: 18px; margin-top: 5px; }
.callout .callout-title { display: block; font-weight: 700; margin-bottom: 1px; }
.callout.note { background: #eefbfb; border-color: #bfe9ec; color: #1d5f66; }
.callout.note svg { color: var(--accent); }
.callout.warning { background: #fffaec; border-color: #f3dc94; color: #6f5210; }
.callout.warning svg { color: #cf9d0d; }
.callout.danger { background: #fef3f3; border-color: #f4c7c7; color: #79252a; }
.callout.danger svg { color: #d64550; }

/* جدول‌ها (هم جداول با کلاس tbl و هم جدول‌های بلوکی وردپرس) */
.table-wrap {
  margin: 16px 0;
  border: 1px solid var(--border); border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}
table.tbl, .article table {
  width: 100%; min-width: 540px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tbl th, .article thead th {
  background: var(--bg-soft);
  text-align: start;
  padding: 11px 16px;
  font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td, .article td {
  padding: 11px 16px;
  text-align: start;
  color: #343b47;
  border-bottom: 1px solid var(--border);
}
.tbl tbody tr:last-child td, .article tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover, .article tbody tr:hover { background: #f2fbfb; }
.tbl td code, .article td code { font-size: .85em; }
.article figure.wp-block-table { border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }

/* ---------- ستون چپ (عناوین این صفحه) — سبک ابرآروان، تم روشن ---------- */
.toc {
  position: sticky;
  top: calc(var(--admin-h) + var(--header-h));
  height: calc(100vh - var(--admin-h) - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain;
  border-inline-start: 1px solid var(--border);
  padding: 26px 0 24px;
  padding-inline-start: 0;
  padding-inline-end: 14px;
  scrollbar-width: thin;
  scrollbar-color: #d9dde5 transparent;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: #d9dde5; border-radius: 6px; }
.toc-list a {
  display: block; position: relative;
  padding: 4px 14px;
  font-size: 12.5px; line-height: 1.9;
  color: var(--text-2);
  transition: color .15s;
}
.toc-list a.t3 { padding-inline-start: 30px; color: var(--text-3); font-size: 12px; }
.toc-list a:hover { color: var(--accent); text-decoration: none; }
.toc-list a.active { color: var(--accent); font-weight: 600; }
.toc-list a.active::after {
  content: '';
  position: absolute; inset-inline-start: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 2px;
  background: var(--accent);
}

/* ---------- راهنمای قبلی / بعدی ---------- */
.pager {
  display: flex; gap: 14px;
  margin-top: 46px; padding-top: 26px;
  border-top: 1px solid var(--border);
}
.pager a {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 16px;
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.pager a:hover {
  text-decoration: none;
  border-color: var(--accent-border);
  box-shadow: 0 3px 14px rgba(0, 184, 184, .10);
}
.pager a.next { align-items: flex-start; text-align: start; }
.pager .dir {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500; color: var(--text-3);
}
.pager .dir svg { width: 13px; height: 13px; }
.pager .pt {
  font-size: 13.5px; font-weight: 600; color: var(--accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- صفحه خانه مستندات: کارت‌های راهنما ---------- */
.dg-section { margin-top: 34px; }
.dg-section:first-of-type { margin-top: 30px; }
.dg-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700;
  margin: 0 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.dg-section-title .cat-dot {
  width: 9px; height: 9px; border-radius: 3px;
  outline: 1px solid var(--accent-border);
}
.dg-section-title .count {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 20px; padding: 0 8px; line-height: 20px;
}

/* تصویر دسته در عنوان بخش‌ها و زیر‌بخش‌ها */
.dg-section-title .cat-img, .dg-subtitle .cat-img {
  width: 26px; height: 26px; border-radius: 8px; object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
}
.dg-section-title a, .dg-subtitle a { color: inherit; }
.dg-section-title a:hover, .dg-subtitle a:hover { color: var(--accent); text-decoration: none; }

/* زیر‌بخش دسته‌های فرزند در صفحه خانه */
.dg-subtitle {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700;
  margin: 26px 0 12px;
}
.dg-subtitle .count {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 20px; padding: 0 8px; line-height: 20px;
}

/* سربرگ صفحه دسته با تصویر */
.term-head { display: flex; align-items: flex-start; gap: 16px; }
.term-head .term-img {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
  border: 1px solid var(--border); margin-top: 4px;
}
.term-head .term-head-text { min-width: 0; }
.term-head .doc-desc { margin-top: 6px; }
.dg-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.dg-card {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff;
  padding: 16px 18px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dg-card:hover {
  text-decoration: none;
  border-color: var(--accent-border);
  box-shadow: 0 4px 16px rgba(0, 184, 184, .12);
  transform: translateY(-1px);
}
.dg-card h3 { font-size: 15px; font-weight: 700; line-height: 1.7; }
.dg-card:hover h3 { color: var(--accent); }
.dg-card p {
  font-size: 13px; color: var(--text-2); line-height: 1.9;
  margin: 0; flex: 1;
}
.dg-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 11.5px; color: var(--text-3);
}
.dg-meta .sep { color: #c6ccd6; font-size: 10px; }
.dg-empty-home {
  border: 1px dashed var(--border); border-radius: 14px;
  margin-top: 30px; padding: 40px 20px; font-size: 14px;
}

/* ---------- فوتر ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; color: var(--text-3);
}

/* ==========================================================
   جستجوی کامل: مودال تیره (سبک مستندات ابرآروان) + صفحهٔ نتایج
   ========================================================== */

/* هایلایت واژهٔ جستجو در زمینهٔ روشن */
.dg-docs mark {
  background: #fdeea6; color: inherit;
  border-radius: 3px; padding: 0 2px;
}

body.dg-search-modal-open { overflow: hidden; }

.dg-docs .dg-search-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 11vh 16px 24px;
  background: rgba(6, 12, 24, .55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.dg-docs .dg-search-modal[hidden] { display: none; }
.dg-docs .dg-search-panel {
  width: 100%; max-width: 640px;
  background: #0f1728;
  border: 1px solid #2a3854; border-radius: 14px;
  box-shadow: 0 30px 70px rgba(2, 8, 20, .55);
  overflow: hidden;
  animation: dgSearchIn .16s ease;
}
@keyframes dgSearchIn {
  from { opacity: 0; transform: translateY(-10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.dg-docs .dg-search-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  border-bottom: 1px solid #1f2b45;
}
.dg-docs .dg-search-head > svg { color: #64748c; width: 19px; height: 19px; }
.dg-docs .dg-search-input {
  flex: 1; min-width: 0; height: 50px;
  background: none; border: none; outline: none;
  color: #f2f6ff; font: inherit; font-size: 15px;
}
.dg-docs .dg-search-input::placeholder { color: #5d6c8c; }
.dg-docs .dg-search-close {
  width: 30px; height: 30px; border-radius: 8px; color: #8ea0bd;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.dg-docs .dg-search-close:hover { background: #1c2846; color: #fff; }

.dg-docs .dg-search-results {
  max-height: 46vh; overflow-y: auto;
  padding: 8px; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #2c3a5c transparent;
}
.dg-docs .dg-search-results::-webkit-scrollbar { width: 6px; }
.dg-docs .dg-search-results::-webkit-scrollbar-thumb { background: #2c3a5c; border-radius: 6px; }

.dg-docs .dg-sres {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; border-radius: 9px;
  transition: background .12s;
}
.dg-docs .dg-sres-t { font-size: 13.5px; font-weight: 600; color: #eef3ff; line-height: 1.8; }
.dg-docs .dg-sres-s {
  font-size: 12px; color: #94a3bd; line-height: 1.9;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.dg-docs .dg-sres-c {
  align-self: flex-start;
  font-size: 10.5px; font-weight: 600; color: #7fd8d2;
  background: rgba(0, 184, 184, .13);
  border-radius: 20px; padding: 1px 9px; margin-top: 3px;
}
.dg-docs .dg-sres.sel { background: rgba(0, 184, 184, .12); }
.dg-docs .dg-sres.sel .dg-sres-t { color: #46e3d4; }
.dg-docs .dg-sres mark {
  background: #fbbf24; color: #12203a;
  border-radius: 3px; padding: 0 2px;
}

.dg-docs .dg-search-state {
  padding: 26px 18px 30px;
  text-align: center;
  color: #7c8bad; font-size: 13px; line-height: 2;
}
.dg-docs .dg-search-state b { color: #eef3ff; }
.dg-docs .dg-search-state .dg-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid #2c3a5c; border-top-color: #46e3d4;
  margin: 0 auto 10px;
  animation: dgSpin .8s linear infinite;
}
@keyframes dgSpin { to { transform: rotate(360deg); } }

.dg-docs .dg-search-foot { border-top: 1px solid #1f2b45; }
.dg-docs .dg-search-all {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  font-size: 13px; font-weight: 600; color: #46e3d4;
}
.dg-docs .dg-search-all:hover { text-decoration: none; background: rgba(0, 184, 184, .08); }
.dg-docs .dg-search-all .dg-search-badge {
  font-size: 11px; font-weight: 700; color: #0f1728;
  background: #46e3d4; border-radius: 20px; padding: 1px 9px;
}
.dg-docs .dg-search-hints {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 0 16px 12px;
  color: #5d6c8c; font-size: 11px;
}
.dg-docs .dg-search-hints kbd {
  font-family: var(--mono); font-size: 10px; color: #aebadb;
  background: #1c2846; border: 1px solid #2c3a5c; border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; margin-inline-end: 4px;
}

/* ---------- صفحهٔ نتایج جستجو ---------- */
.dg-docs .dg-search-form { display: flex; gap: 8px; margin: 4px 0 14px; }
.dg-docs .dg-search-form input[type="search"] {
  flex: 1; min-width: 0; height: 46px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-soft); font: inherit; font-size: 14px;
  padding: 0 16px; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.dg-docs .dg-search-form input[type="search"]:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dg-docs .dg-search-form button {
  height: 46px; padding: 0 24px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 14px;
  transition: background .15s;
}
.dg-docs .dg-search-form button:hover { background: var(--accent-dark); color: #fff; }
.dg-docs .dg-search-count-line { font-size: 13px; color: var(--text-3); margin: 0 0 4px; }
.dg-docs .dg-search-count-line b { color: var(--text); }
.dg-docs .sres-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 18px;
}
.dg-docs .sres {
  display: block; padding: 14px 18px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dg-docs .sres:hover {
  text-decoration: none;
  border-color: var(--accent-border);
  box-shadow: 0 4px 16px rgba(0, 184, 184, .12);
  transform: translateY(-1px);
}
.dg-docs .sres h3 { font-size: 15px; font-weight: 700; line-height: 1.8; color: var(--text); }
.dg-docs .sres:hover h3 { color: var(--accent); }
.dg-docs .sres-snip { font-size: 13px; color: var(--text-2); line-height: 2; margin: 4px 0 10px; }
.dg-docs .sres-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 11.5px; color: var(--text-3);
}
.dg-docs .sres-meta .chip {
  display: inline-flex; align-items: center;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: var(--accent-dark); border-radius: 20px;
  padding: 2px 11px; font-size: 11px; font-weight: 600;
}
.dg-docs .dg-search-cap-note {
  margin-top: 18px; font-size: 12.5px;
  color: var(--text-3); text-align: center;
}

@media (max-width: 640px) {
  .dg-docs .dg-search-modal { padding: 8vh 10px 16px; }
  .dg-docs .dg-search-input { font-size: 14px; }
  .dg-docs .dg-search-hints { display: none; }
  .dg-docs .dg-search-form button { padding: 0 16px; }
}

/* ==========================================================
   ریسپانسیو
   ========================================================== */

/* تبلت: حذف ستون چپ */
@media (max-width: 1200px) {
  .toc { display: none; }
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .layout.no-toc { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .content { padding: 24px 32px 56px; }
}

/* موبایل: منوی کشویی از راست */
@media (max-width: 900px) {
  .layout, .layout.no-toc { grid-template-columns: minmax(0, 1fr); }

  .menu-btn { display: inline-flex; }
  .topnav a:not(.btn-panel) { display: none; }

  body.dg-mode-theme .dg-fab-menu,
  body.dg-custom-html .dg-fab-menu { display: inline-flex; }

  .sidebar {
    position: fixed;
    top: var(--admin-h); bottom: 0;
    inset-inline-start: 0;           /* در RTL یعنی لبه راست صفحه */
    width: 302px; max-width: 86vw;
    height: auto;
    z-index: 60;
    box-shadow: -14px 0 34px rgba(15, 23, 42, .14);
    transform: translateX(100%);
    transition: transform .28s ease;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .overlay { opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }

  .sidebar-close { display: inline-flex; }

  .content { padding: 20px 18px 48px; }
  .doc-head h1 { font-size: 22px; }
  .article h2 { font-size: 18.5px; margin-top: 32px; }
  .article h3 { font-size: 15.5px; }
  .article p { text-align: start; }
  .pager { flex-direction: column; }
  .dg-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-inner { justify-content: center; text-align: center; }
}

/* موبایل خیلی کوچک */
@media (max-width: 480px) {
  .topnav .btn-panel { padding: 7px 12px; font-size: 12.5px; }
  .brand-text small { display: none; }
  .content { padding: 18px 14px 44px; }
  .doc-head h1 { font-size: 20px; }
  table.tbl, .article table { min-width: 480px; }
}
