/* مستندات API و کنسول تست — فقط از توکن‌های site.css رنگ می‌گیرد */

.ad-root { --ad-code: #c2185b; --ad-hero: radial-gradient(600px 300px at 0% 0%, rgba(255, 255, 255, .13), transparent 60%), linear-gradient(135deg, #12937a 0%, #0d6f5c 55%, #0b4f49 100%); font-family: var(--font); color: var(--text); direction: rtl; text-align: right; line-height: 1.6; font-size: 16px; }
html[data-theme="dark"] .ad-root { --ad-code: #ff8fb8; --ad-hero: radial-gradient(600px 300px at 0% 0%, rgba(47, 197, 159, .16), transparent 60%), linear-gradient(135deg, #0f4a3d 0%, #0b3a30 60%, #08231f 100%); }
.ad-root, .ad-root *, .ad-root *::before, .ad-root *::after { box-sizing: border-box; }
.ad-root [hidden] { display: none !important; }
.ad-root h1, .ad-root h2, .ad-root h3, .ad-root h4 { color: var(--text); letter-spacing: 0; font-family: var(--font); }
.ad-root p { margin-top: 0; }
.ad-root a { text-decoration: none; }
.ad-root code, .ad-root pre, .ad-root kbd, .ad-root .ad-block { font-family: var(--font-en); }
.ad-root code { color: var(--ad-code); background: var(--surface-3); padding: .1rem .4rem; border-radius: 6px; font-size: .8em; direction: ltr; unicode-bidi: embed; }
.ad-root ol, .ad-root ul { margin-top: 0; }
.ad-root input, .ad-root select, .ad-root textarea, .ad-root button { font-family: var(--font); }
.ad-ltr { direction: ltr !important; text-align: left; }
.ad-mute { color: var(--muted); }
.ad-mt { margin-top: 1rem; }
.ad-mb { margin-bottom: 1rem; }
.ad-scroll-x { overflow-x: auto; }

/* کنترل‌های پایه؛ هم‌شکل تم پنل ولی بدون وابستگی به bootstrap */
.ad-btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid transparent; border-radius: 12px; font: 700 .88rem/1.5 var(--font); padding: .5rem 1.1rem; cursor: pointer; text-decoration: none !important; transition: all .15s ease; white-space: nowrap; }
.ad-btn:focus-visible { outline: 0; box-shadow: 0 0 0 .2rem var(--primary-ring); }
.ad-btn-sm { border-radius: 10px; padding: .28rem .7rem; font-size: .8rem; }
.ad-btn-block { display: flex; width: 100%; }
.ad-root .ad-btn-primary, .docs-top .ad-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.ad-root .ad-btn-primary:hover, .docs-top .ad-btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.ad-root .ad-btn-light { background: var(--surface); border-color: var(--border-2); color: var(--text-2); }
.ad-root .ad-btn-light:hover { background: var(--surface-3); color: var(--text); }
.ad-input { display: block; width: 100%; height: 42px; padding: .4rem .8rem; background: var(--surface); color: var(--text); border: 1px solid var(--border-2); border-radius: 12px; font-size: .88rem; outline: 0; transition: border-color .15s, box-shadow .15s; }
.ad-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.ad-seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-3); border-radius: 99px; padding: 3px; gap: 2px; }
.ad-seg > button { border: 0; background: transparent; color: var(--text-2); font: 500 .78rem/1.5 var(--font); padding: .32rem .9rem; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.ad-seg > button:hover { color: var(--text); }
.ad-seg > .active, .ad-seg > .active:hover { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.ad-block { direction: ltr; text-align: left; background: var(--code-bg); color: var(--code-text); padding: 16px 18px; border-radius: 16px; font-size: .82rem; line-height: 1.7; overflow-x: auto; white-space: pre; border: 1px solid rgba(255, 255, 255, .05); }
.ad-table { width: 100%; border-collapse: collapse; color: var(--text); background: transparent; }
.ad-root .ad-table th { background: var(--surface-2); color: var(--muted); font-weight: 700; text-align: right; padding: .75rem; border-bottom: 1px solid var(--border); }
.ad-root .ad-table td { padding: .75rem; border-top: 1px solid var(--border); text-align: right; }

.ad-head { margin-bottom: 18px; }
.ad-head h1, .ad-head .ad-h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 .2rem; }
.ad-head p { color: var(--muted); font-size: .88rem; margin: 0; }

.ad-toasts { position: fixed; top: 24px; left: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 48px); background: none; }
.ad-toast { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-right: 4px solid var(--primary); border-radius: 12px; padding: .6rem .95rem; font-size: .84rem; box-shadow: var(--shadow-lg); }
.ad-toast.err { border-right-color: var(--danger); }
.ad-dialog { position: fixed; inset: 0; z-index: 1990; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(7, 20, 17, .5); }
.ad-dialog-box { width: 400px; max-width: 100%; background: var(--surface); border-radius: var(--r-lg); padding: 24px; text-align: center; box-shadow: var(--shadow-lg); }
.ad-dialog-box p { margin: 12px 0 18px; color: var(--text-2); font-size: .9rem; line-height: 2; }
.ad-dialog-icon { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; background: var(--primary-soft); color: var(--primary); }
.ad-dialog-actions { display: flex; justify-content: center; gap: .5rem; }

.apidoc { --ad-top: 84px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; align-items: start; }
.apidoc [id] { scroll-margin-top: calc(var(--ad-top) + 10px); }

/* ---------- رنگ متدها ---------- */
.m-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: .12rem .45rem; border-radius: 8px; font: 800 .66rem/1.5 var(--font-en); letter-spacing: .04em; direction: ltr; }
.m-get { background: var(--info-soft); color: var(--info); }
.m-post { background: var(--success-soft); color: var(--success); }
.m-delete { background: var(--danger-soft); color: var(--danger); }
.m-put { background: var(--warning-soft); color: var(--warning); }

.ad-icon-btn { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: background .15s, color .15s; }
.ad-icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.ad-icon-btn.done { color: var(--success); }

/* ---------- فهرست کناری ---------- */
.ad-toc { position: sticky; top: var(--ad-top); height: calc(100vh - var(--ad-top) - 28px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.ad-toc-search { position: relative; padding: 12px 12px 8px; }
.ad-toc-search .fa { position: absolute; right: 24px; top: 50%; transform: translateY(-30%); color: var(--muted); font-size: .8rem; }
.ad-toc-search input { width: 100%; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: .45rem 2rem .45rem .7rem; font-size: .78rem; color: var(--text); outline: 0; }
.ad-toc-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.ad-toc-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 14px; scrollbar-width: thin; }
.ad-toc-nav a { display: flex; align-items: center; gap: .45rem; padding: .32rem .6rem; border-radius: 10px; color: var(--text-2); font-size: .78rem; text-decoration: none; line-height: 1.6; }
.ad-toc-nav a:hover { background: var(--surface-3); color: var(--text); }
.ad-toc-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.ad-toc-nav .m-pill { min-width: 38px; font-size: .58rem; padding: .05rem .3rem; }
.ad-toc-title { margin: .9rem .6rem .25rem; font-size: .7rem; font-weight: 800; color: var(--muted); }
.ad-toc-title a { padding: 0; margin: 0; color: var(--muted); font-weight: 800; font-size: .7rem; background: none !important; }
.ad-toc-title a.active { color: var(--primary); }
.ad-toc-nav a.hide { display: none; }

/* ---------- معرفی ---------- */
.ad-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; padding: 30px; border-radius: var(--r-xl); overflow: hidden; color: #fff;
    background: var(--ad-hero); box-shadow: var(--shadow-lg); margin-bottom: 26px; }
.ad-hero::after { content: ""; position: absolute; width: 340px; height: 340px; left: -120px; bottom: -180px; border-radius: 50%; background: rgba(255, 255, 255, .05); pointer-events: none; }
.ad-hero > * { position: relative; z-index: 1; }
.ad-hero h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.7; margin: .9rem 0 .5rem; color: #fff; }
.ad-hero p { color: rgba(255, 255, 255, .82); line-height: 2; font-size: .9rem; margin-bottom: 1rem; }
.ad-hero-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.ad-chip { display: inline-flex; align-items: center; gap: .35rem; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); padding: .2rem .7rem; border-radius: 99px; font-size: .72rem; font-weight: 700; }
.ad-base { display: flex; align-items: center; gap: .5rem; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .12); padding: .4rem .5rem .4rem .4rem; border-radius: 14px; margin-bottom: 1.1rem; max-width: 100%; }
.ad-base-label { font-size: .7rem; background: rgba(255, 255, 255, .14); padding: .2rem .6rem; border-radius: 9px; white-space: nowrap; }
.ad-hero .ad-base code { direction: ltr; color: #c9fff0; font-size: .82rem; background: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.ad-base .ad-icon-btn { color: rgba(255, 255, 255, .75); }
.ad-base .ad-icon-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.ad-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ad-root .ad-hero-actions .ad-btn-primary { background: #fff; color: #0d6f5c; border-color: #fff; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }
.ad-root .ad-hero-actions .ad-btn-primary:hover { background: #eafff8; color: #0b5a4b; }
.ad-root .ad-hero-actions .ad-btn-light { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.ad-root .ad-hero-actions .ad-btn-light:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.ad-hero-term { align-self: center; background: #071613; border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; box-shadow: 0 30px 50px -25px rgba(0, 0, 0, .7); overflow: hidden; direction: ltr; }
.ad-term-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.ad-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.ad-term-bar i:nth-child(2) { background: #febc2e; }
.ad-term-bar i:nth-child(3) { background: #28c840; }
.ad-term-bar span { margin-left: auto; font-size: .7rem; color: rgba(255, 255, 255, .45); font-family: var(--font); direction: rtl; }
.ad-term-body { margin: 0; padding: 16px 18px; color: #d9ece6; font: .8rem/1.75 var(--font-en); white-space: pre-wrap; word-break: break-all; min-height: 130px; text-align: left; direction: ltr; }
.ad-term-body .t-c { color: #2fc59f; }
.ad-term-body .t-k { color: #ffb86b; }
.ad-term-body .t-o { color: #9fdcc9; }
.ad-term-body .t-err { color: #ff8a8d; }
.ad-term-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 10px 14px; border-top: 1px solid rgba(255, 255, 255, .06); direction: rtl; }
.ad-key-state { font-size: .75rem; display: inline-flex; align-items: center; gap: .35rem; }
.ad-key-state.on { color: #7de8c6; }
.ad-key-state.off { color: #ffcf8a; }

/* ---------- بخش‌ها ---------- */
.ad-section, .ad-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 22px; }
.ad-section > p, .ad-section li { color: var(--text-2); line-height: 2; font-size: .88rem; }
.ad-h { display: flex; align-items: center; gap: .6rem; font-size: 1.12rem; font-weight: 800; margin: 0 0 1rem; color: var(--text); }
.ad-h > .fa { width: 34px; height: 34px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
.ad-h-num { width: 34px; height: 34px; border-radius: 11px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; box-shadow: var(--shadow-primary); }

.ad-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: step; }
.ad-step { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.ad-step::before { counter-increment: step; content: counter(step, persian); position: absolute; top: 14px; left: 16px; font-size: 2rem; font-weight: 900; color: var(--primary); opacity: .13; line-height: 1; }
.ad-step-icon { width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--secondary-brand)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; margin-bottom: .7rem; box-shadow: var(--shadow-primary); }
.ad-step h4 { font-size: .95rem; font-weight: 800; margin-bottom: .35rem; }
.ad-step p { font-size: .8rem; color: var(--text-2); line-height: 1.95; margin: 0; }
.ad-step a, .ad-section a:not(.ad-btn), .ad-group a:not(.ad-btn) { color: var(--primary); font-weight: 700; }

.ad-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ad-note { border-radius: 16px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface-2); }
.ad-note b { display: flex; align-items: center; gap: .4rem; font-size: .86rem; margin-bottom: .3rem; }
.ad-note p { margin: 0; font-size: .8rem; line-height: 1.95; color: var(--text-2); }
.ad-note.ok { background: var(--success-soft); border-color: transparent; }
.ad-note.ok b { color: var(--success); }
.ad-note.warn { background: var(--warning-soft); border-color: transparent; }
.ad-note.warn b { color: var(--warning); }

.ad-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ad-facts > div { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: .7rem; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.ad-facts .fa { grid-row: span 2; width: 36px; height: 36px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.ad-facts b { font-size: .86rem; }
.ad-facts span { font-size: .78rem; color: var(--text-2); line-height: 1.9; }

.ad-table { font-size: .82rem; margin: 0; }
.ad-table th { font-size: .74rem; white-space: nowrap; }
.ad-table td { vertical-align: middle; line-height: 1.8; }
.ad-code { display: inline-block; font: 800 .74rem/1.6 var(--font-en); padding: .05rem .5rem; border-radius: 7px; }
.ad-code.c-2 { background: var(--success-soft); color: var(--success); }
.ad-code.c-4 { background: var(--warning-soft); color: var(--warning); }
.ad-code.c-5 { background: var(--danger-soft); color: var(--danger); }

/* ---------- گروه و متد ---------- */
.ad-group { padding: 0; overflow: hidden; }
.ad-group-head { display: flex; gap: 14px; align-items: flex-start; padding: 24px 28px 18px; background: linear-gradient(180deg, var(--primary-soft), transparent); }
.ad-group-icon { width: 48px; height: 48px; border-radius: 16px; flex: none; background: linear-gradient(135deg, var(--primary), var(--secondary-brand)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; box-shadow: var(--shadow-primary); }
.ad-group-head h3 { font-size: 1.15rem; font-weight: 800; margin: .1rem 0 .3rem; }
.ad-group-head p { margin: 0; font-size: .84rem; line-height: 2; color: var(--text-2); }
.ad-group > .ad-note { margin: 0 28px 16px; }

.ad-ep { border-top: 1px solid var(--border); padding: 22px 28px 24px; }
.ad-ep:target, .ad-ep.flash { animation: ad-flash 1.6s ease; }
@keyframes ad-flash { 0% { background: var(--primary-soft-2); } 100% { background: transparent; } }
.ad-ep-head { margin-bottom: 14px; }
.ad-ep-line { display: flex; align-items: center; gap: .5rem; direction: ltr; justify-content: flex-end; }
.ad-ep .ad-path { direction: ltr; font-size: .86rem; color: var(--text); background: var(--surface-3); padding: .2rem .65rem; border-radius: 9px; word-break: break-all; }
.ad-ep-title { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin-top: .55rem; }
.ad-ep-title h4 { font-size: 1.02rem; font-weight: 800; margin: 0 0 0 .3rem; }
.ad-ep-title .ad-try { margin-right: auto; border-radius: 99px; padding: .25rem .9rem; }
.ad-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .68rem; font-weight: 700; padding: .15rem .6rem; border-radius: 99px; }
.ad-badge.free { background: var(--success-soft); color: var(--success); }
.ad-badge.write { background: var(--info-soft); color: var(--info); }
.ad-badge.paid { background: var(--accent-soft); color: var(--accent); }
.ad-badge.audio { background: var(--secondary-soft); color: var(--secondary); }

.ad-ep-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.ad-summary { font-size: .86rem; line-height: 2.05; color: var(--text-2); margin-bottom: .9rem; }
.ad-params-title { font-size: .72rem; font-weight: 800; color: var(--muted); margin: .9rem 0 .4rem; }
.ad-params { margin: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ad-param { padding: .6rem .85rem; }
.ad-param + .ad-param { border-top: 1px solid var(--border); }
.ad-param dt { font-weight: 400; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .2rem; }
.ad-params .ad-param dt code { font-size: .8rem; font-weight: 700; color: var(--text); background: none; padding: 0; direction: ltr; }
.ad-param dd { margin: 0; font-size: .78rem; color: var(--text-2); line-height: 1.9; }
.ad-type { font: .68rem var(--font-en); color: var(--info); direction: ltr; }
.ad-in { font-size: .64rem; color: var(--muted); background: var(--surface-3); padding: 0 .4rem; border-radius: 6px; }
.ad-req { font-size: .64rem; font-weight: 700; color: var(--danger); background: var(--danger-soft); padding: 0 .45rem; border-radius: 6px; }
.ad-tip { display: flex; gap: .6rem; margin-top: .9rem; padding: .7rem .85rem; border-radius: 14px; background: var(--warning-soft); font-size: .78rem; line-height: 1.95; color: var(--text-2); }
.ad-tip > .fa { color: var(--warning); font-size: 1rem; margin-top: .3rem; }

/* ---------- جعبه کد ---------- */
.ad-ep-code { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--ad-top) + 6px); }
.ad-codebox { background: var(--code-bg); border-radius: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .05); }
.ad-codebox-bar { display: flex; align-items: center; gap: .3rem; padding: 6px 8px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.ad-codebox-bar .ad-icon-btn { color: rgba(255, 255, 255, .5); margin-right: auto; }
.ad-codebox-bar .ad-icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ad-langs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; direction: ltr; flex: 1; min-width: 0; }
.ad-langs button { border: 0; background: transparent; color: rgba(255, 255, 255, .5); font: 600 .7rem var(--font-en); padding: .3rem .6rem; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.ad-langs button:hover { color: #fff; }
.ad-langs button.active { background: rgba(47, 197, 159, .18); color: #5fe0bd; }
.ad-resp-label { font-size: .72rem; color: rgba(255, 255, 255, .6); padding: .25rem .4rem; display: inline-flex; align-items: center; gap: .4rem; }
.ad-pre { margin: 0; padding: 14px 16px; color: var(--code-text); font: .76rem/1.75 var(--font-en); direction: ltr; text-align: left; white-space: pre; overflow: auto; max-height: 420px; tab-size: 2; background: var(--code-bg); }
.ad-codebox.resp .ad-pre { max-height: 300px; }
.ad-codebox .ad-pre code, .ad-pre code { background: none; color: inherit; padding: 0; font: inherit; border-radius: 0; white-space: inherit; }
.j-key { color: #7cc7ff; }
.j-str { color: #a5e3a0; }
.j-num { color: #ffb86b; }
.j-bool { color: #ff8fb8; }
.j-null { color: #b39dfa; }
.c-com { color: #6f8f87; font-style: italic; }
.c-kw { color: #ff8fb8; }

/* ---------- مرجع ---------- */
.ad-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ad-types > div { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: .6rem; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.ad-types b { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font: 800 1.05rem var(--font-en); background: var(--primary-soft); color: var(--primary); }
.ad-types span { font-weight: 700; font-size: .86rem; }
.ad-types small { color: var(--muted); font-size: .74rem; }
.ad-st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: .5rem; background: var(--secondary); }
.ad-st-dot.success { background: var(--success); }
.ad-st-dot.danger { background: var(--danger); }
.ad-st-dot.warning { background: var(--warning); }
.ad-st-dot.info { background: var(--info); }
.ad-st-dot.primary { background: var(--primary); }
.ad-flow { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1rem; padding: 12px; border-radius: 14px; background: var(--surface-2); direction: ltr; justify-content: flex-end; }
.ad-flow .fa { color: var(--muted); font-size: .8rem; transform: scaleX(-1); }
.sf { font: 700 .7rem var(--font-en); padding: .2rem .55rem; border-radius: 8px; }
.sf.info { background: var(--info-soft); color: var(--info); }
.sf.warning { background: var(--warning-soft); color: var(--warning); }
.sf.success { background: var(--success-soft); color: var(--success); }
.sf.danger { background: var(--danger-soft); color: var(--danger); }
.sf-or { font-size: .72rem; color: var(--muted); }

.ad-recipes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ad-recipe { border: 1px solid var(--border); border-radius: 18px; padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; }
.ad-recipe h4 { font-size: .95rem; font-weight: 800; margin: .6rem 0 .4rem; }
.ad-recipe ol { padding-right: 1.1rem; margin: 0 0 .8rem; flex: 1; }
.ad-recipe li { font-size: .8rem; line-height: 1.95; color: var(--text-2); }
.ad-recipe .ad-btn { align-self: flex-start; border-radius: 99px; }
.ad-recipe-icon { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.ad-recipe-icon.r1 { background: var(--primary-soft); color: var(--primary); }
.ad-recipe-icon.r2 { background: var(--accent-soft); color: var(--accent); }
.ad-recipe-icon.r3 { background: var(--info-soft); color: var(--info); }
.ad-recipe-icon.r4 { background: var(--success-soft); color: var(--success); }

.ad-checks { list-style: none; padding: 0; margin: 0; }
.ad-checks li { position: relative; padding: .55rem 1.9rem .55rem 0; border-bottom: 1px dashed var(--border); }
.ad-checks li:last-child { border-bottom: 0; }
.ad-checks li::before { content: "\f00c"; font-family: FontAwesome; position: absolute; right: 0; top: .7rem; width: 20px; height: 20px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: .62rem; display: flex; align-items: center; justify-content: center; }

.ad-timeline { list-style: none; padding: 0 1.2rem 0 0; margin: 0; border-right: 2px solid var(--border); }
.ad-timeline li { position: relative; padding: 0 0 1rem 0; font-size: .84rem; color: var(--text-2); line-height: 1.9; }
.ad-timeline li::before { content: ""; position: absolute; right: calc(-1.2rem - 7px); top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.ad-timeline time { display: block; font-size: .72rem; font-weight: 700; color: var(--primary); }
.ad-timeline b { color: var(--text); }

/* ---------- کنسول ---------- */
.ad-fab { position: fixed; left: 26px; bottom: 26px; z-index: 1030; display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 99px; padding: .7rem 1.2rem; background: var(--primary); color: #fff; font: 700 .85rem var(--font); box-shadow: var(--shadow-primary), 0 14px 30px -12px rgba(0, 0, 0, .35); cursor: pointer; transition: transform .2s, opacity .2s; }
.ad-fab:hover { transform: translateY(-2px); }
body.ad-console-open .ad-fab { opacity: 0; pointer-events: none; transform: translateY(10px); }

.ad-console { position: fixed; top: 14px; bottom: 14px; left: 14px; width: min(540px, calc(100vw - 28px)); z-index: 1038; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); transform: translateX(calc(-100% - 30px)); visibility: hidden; transition: transform .35s cubic-bezier(.4, 0, .2, 1), visibility 0s .35s; }
.ad-console.open { transform: none; visibility: visible; transition: transform .35s cubic-bezier(.4, 0, .2, 1); }
.adc-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.adc-title { font-weight: 800; font-size: .95rem; display: flex; align-items: center; gap: .5rem; }
.adc-title > .fa { width: 30px; height: 30px; border-radius: 10px; background: var(--code-bg); color: #5fe0bd; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.adc-live { font-size: .64rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: .1rem .5rem; border-radius: 99px; }
.adc-scroll { flex: 1; overflow-y: auto; padding: 14px 16px 18px; overscroll-behavior: contain; }
.adc-block { margin-bottom: 14px; }
.adc-label { display: block; font-size: .74rem; font-weight: 800; color: var(--muted); margin-bottom: .35rem; }
.adc-label-row { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.adc-label-row .adc-label { margin: 0; }
.adc-tools { margin-right: auto; display: flex; gap: 2px; }
.adc-tool { border: 0; background: var(--surface-3); color: var(--text-2); width: 28px; height: 26px; border-radius: 8px; cursor: pointer; font-size: .78rem; }
.adc-tool:hover { background: var(--primary-soft); color: var(--primary); }
.adc-key { display: flex; align-items: center; gap: .35rem; }
.adc-key .ad-input { flex: 1; font-size: .82rem; }
.adc-key-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .4rem; flex-wrap: wrap; }
.adc-remember { font-size: .74rem; color: var(--text-2); display: inline-flex; align-items: center; gap: .35rem; margin: 0; cursor: pointer; }
.adc-key-state { font-size: .74rem; font-weight: 700; }
.adc-key-state.ok { color: var(--success); }
.adc-key-state.bad { color: var(--danger); }
.adc-hint { font-size: .74rem; color: var(--text-2); margin-top: .35rem; }
.adc-url { display: flex; align-items: center; gap: .45rem; margin-top: .5rem; padding: .45rem .55rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); direction: ltr; }
.ad-console .adc-url code { font-size: .76rem; color: var(--text); background: none; padding: 0; word-break: break-all; }
.adc-params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.adc-param label { display: flex; align-items: center; gap: .3rem; font: 700 .72rem var(--font-en); color: var(--text-2); margin-bottom: .2rem; direction: ltr; justify-content: flex-end; }
.adc-param label .ad-req { font-family: var(--font); }
.adc-param .ad-input { font-size: .8rem; height: calc(1.5em + .6rem + 2px); padding: .3rem .6rem; }
.adc-body { width: 100%; min-height: 190px; resize: vertical; border-radius: 14px; border: 1px solid var(--border); background: var(--code-bg); color: var(--code-text); font: .78rem/1.7 var(--font-en); padding: 12px 14px; outline: 0; tab-size: 2; }
.adc-body:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.adc-body.invalid { border-color: var(--danger); }
.adc-json-state { font-size: .7rem; font-weight: 700; }
.adc-json-state.ok { color: var(--success); }
.adc-json-state.bad { color: var(--danger); }
.adc-warn { display: none; margin-bottom: 12px; padding: .65rem .8rem; border-radius: 14px; font-size: .78rem; line-height: 1.9; }
.adc-warn.show { display: block; }
.adc-warn.paid { background: var(--accent-soft); color: var(--text-2); }
.adc-warn.paid b { color: var(--accent); }
.adc-warn.write { background: var(--info-soft); color: var(--text-2); }
.adc-warn .ad-btn { margin-top: .4rem; border-radius: 99px; }
.adc-send-row { margin-bottom: 16px; }
.adc-send-row .ad-btn { border-radius: 14px; padding: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.adc-send-row kbd { background: rgba(255, 255, 255, .2); font-size: .65rem; padding: .1rem .4rem; border-radius: 6px; direction: ltr; }
.adc-send-row .ad-btn.loading { pointer-events: none; opacity: .8; }

.adc-resp { margin-top: 16px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; animation: rise .3s ease both; }
.adc-resp-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.adc-status { font: 800 .76rem var(--font-en); padding: .2rem .6rem; border-radius: 9px; direction: ltr; }
.adc-status.s2 { background: var(--success-soft); color: var(--success); }
.adc-status.s4 { background: var(--warning-soft); color: var(--warning); }
.adc-status.s5, .adc-status.s0 { background: var(--danger-soft); color: var(--danger); }
.adc-meta { font-size: .72rem; color: var(--muted); direction: ltr; }
.adc-resp-head .ad-seg { margin-right: auto; }
.ad-seg-sm > button { font-size: .7rem; padding: .22rem .65rem; }
.adc-rt .ad-pre { max-height: 360px; border-radius: 0; white-space: pre-wrap; word-break: break-word; }
.adc-rt .ad-codebox { border-radius: 0; border: 0; }
.adc-realkey { font-size: .66rem; color: rgba(255, 255, 255, .6); display: inline-flex; align-items: center; gap: .25rem; margin: 0 .3rem; white-space: nowrap; cursor: pointer; }
#adcAudio:empty { display: none; }
#adcAudio { padding: 14px; background: var(--surface-2); }
#adcAudio audio { width: 100%; }
#adcAudio .adc-spoken { margin-top: .6rem; font-size: .78rem; color: var(--text-2); line-height: 1.9; }
.adc-explain:empty { display: none; }
.adc-explain { padding: .7rem .9rem; font-size: .78rem; line-height: 1.9; color: var(--text-2); background: var(--warning-soft); border-top: 1px solid var(--border); }
.adc-explain b { color: var(--text); }

.adc-history { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.adc-history li { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem; font-size: .74rem; cursor: pointer; direction: ltr; }
.adc-history li + li { border-top: 1px solid var(--border); }
.adc-history li:hover { background: var(--surface-2); }
.adc-history .h-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-en); color: var(--text); }
.adc-history .h-time { color: var(--muted); font-family: var(--font-en); }
.adc-history .m-pill { min-width: 38px; font-size: .58rem; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1399.98px) {
    .ad-ep-body { grid-template-columns: minmax(0, 1fr); }
    .ad-ep-code { position: static; }
}
@media (max-width: 1199.98px) {
    .apidoc { grid-template-columns: minmax(0, 1fr); }
    .ad-toc, .ad-full .ad-toc { position: static; height: auto; }
    .ad-toc-search { display: none; }
    .ad-toc-nav { display: flex; overflow-x: auto; overflow-y: hidden; padding: 10px; gap: .35rem; scrollbar-width: none; }
    .ad-toc-nav > a.ad-toc-ep { display: none; }
    .ad-toc-nav > a, .ad-toc-title { flex: none; margin: 0; white-space: nowrap; }
    .ad-toc-title:not(:has(a)) { display: none; }
    .ad-toc-title a, .ad-toc-nav > a { padding: .3rem .8rem; border-radius: 99px; background: var(--surface-3) !important; color: var(--text-2); font-size: .74rem; font-weight: 700; }
    .ad-toc-title a.active, .ad-toc-nav > a.active { background: var(--primary) !important; color: #fff; }
}
@media (max-width: 991.98px) {
    .ad-hero { grid-template-columns: minmax(0, 1fr); padding: 22px; }
    .ad-steps, .ad-grid-2, .ad-facts, .ad-recipes { grid-template-columns: minmax(0, 1fr); }
    .ad-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ad-fab { bottom: calc(18px + env(safe-area-inset-bottom)); left: 16px; padding: .6rem 1rem; }
    .app-body .ad-fab { bottom: calc(var(--dock-h, 64px) + 22px + env(safe-area-inset-bottom)); }
}
@media (max-width: 767.98px) {
    .ad-section { padding: 18px 16px; }
    .ad-group-head { padding: 18px 16px 14px; }
    .ad-group > .ad-note { margin: 0 16px 14px; }
    .ad-ep { padding: 18px 16px 20px; }
    .ad-hero h2 { font-size: 1.2rem; }
    .ad-types { grid-template-columns: minmax(0, 1fr); }
    .ad-ep-title .ad-try { margin-right: 0; }
    .ad-console { top: 0; bottom: 0; left: 0; width: 100vw; border-radius: 0; border: 0; }
    .adc-params { grid-template-columns: minmax(0, 1fr); }
    .ad-fab span, .adc-send-row kbd { display: none; }
    .ad-fab { width: 52px; height: 52px; padding: 0; justify-content: center; font-size: 1.1rem; }
    .ad-table { font-size: .76rem; }
}

/* ---------- نسخه عمومی بدون پنل (/api-docs) ---------- */
html:has(> body.docs-body), body.docs-body { overflow-x: clip !important; overflow-y: visible !important; }
body.docs-body { background: radial-gradient(900px 500px at 100% 0, var(--primary-soft), transparent 60%), var(--main-bg); color: var(--text); min-height: 100vh; }
.docs-top { position: sticky; top: 0; z-index: 1020; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.docs-top-in { max-width: 1440px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.docs-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none !important; }
.docs-brand .brand-logo { width: 40px; height: 40px; border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.docs-brand .brand-initial { background: var(--primary); color: #fff; font-weight: 800; }
.docs-brand-name { font-weight: 800; font-size: 1.02rem; color: var(--text); }
.docs-brand-tag { font: 700 .66rem var(--font-en); color: var(--primary); background: var(--primary-soft); padding: .15rem .55rem; border-radius: 99px; letter-spacing: .03em; }
.docs-top-nav { display: flex; align-items: center; gap: .5rem; }
.docs-top-nav .ad-btn { border-radius: 99px; padding: .35rem 1rem; font-weight: 700; }
.docs-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-2) !important; font-size: .86rem; font-weight: 700; padding: .35rem .7rem; border-radius: 99px; text-decoration: none !important; }
.docs-link:hover { background: var(--surface-3); color: var(--text) !important; }
.docs-icon { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2) !important; background: var(--surface-3); }
.docs-foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 10px 0 28px; }
@media (max-width: 767.98px) {
    .docs-top-in { padding-right: 14px; padding-left: 14px; }
    .docs-brand-name { display: none; }
}

/* ---------- کادر وسط‌چین با فهرست کارتی تمام‌قد (صفحه عمومی و سایت) ---------- */
.ad-full.apidoc { max-width: 1320px; margin-inline: auto; padding: 22px 24px 30px; }
.ad-full .ad-toc { top: calc(var(--ad-top) + 14px); }
.ad-full .ad-main { min-width: 0; }
@media (max-width: 1199.98px) {
    .ad-full.apidoc { grid-template-columns: minmax(0, 1fr); }
    .ad-full .ad-toc { position: static; height: auto; }
}
@media (max-width: 767.98px) {
    .ad-full.apidoc { padding: 16px 14px 24px; }
    .ad-head h1, .ad-head .ad-h1 { font-size: 1.25rem; }
}

/* ---------- داخل سایت: توکن‌های رنگ پنل تا خروجی یکسان بماند ---------- */
.ad-site {
    --font: Yekan, Tahoma, sans-serif; --font-en: YekanEn, Yekan, Tahoma, sans-serif;
    --primary: #14957a; --primary-600: #0f7d66; --primary-soft: rgba(20, 149, 122, .10); --primary-soft-2: rgba(20, 149, 122, .16); --primary-ring: rgba(20, 149, 122, .24);
    --secondary-brand: #45b35d; --accent: #f2703f; --accent-soft: rgba(242, 112, 63, .12);
    --success: #1e9c5a; --success-soft: rgba(30, 156, 90, .12); --info: #2f7fe0; --info-soft: rgba(47, 127, 224, .11);
    --warning: #e59a1b; --warning-soft: rgba(229, 154, 27, .14); --danger: #e5484d; --danger-soft: rgba(229, 72, 77, .11);
    --secondary: #6b7a8c; --secondary-soft: rgba(107, 122, 140, .13);
    --main-bg: #f2f7f4; --surface: #ffffff; --surface-2: #f6faf8; --surface-3: #ebf3ef; --border: #e3ece7; --border-2: #d5e3db;
    --text: #17272a; --text-2: #4a5d5f; --muted: #8a9c9a; --r-xl: 30px; --r-lg: 22px; --radius: 18px;
    --shadow-sm: 0 1px 2px rgba(16, 40, 34, .05); --shadow: 0 1px 2px rgba(16, 40, 34, .04), 0 14px 34px -20px rgba(15, 95, 74, .28);
    --shadow-lg: 0 24px 60px -18px rgba(12, 60, 48, .32); --shadow-primary: 0 12px 26px -12px rgba(20, 149, 122, .75);
    --code-bg: #0f1f1c; --code-text: #d9ece6;
}
main > .sec.sec-apiDocs, main > .sec.sec-apiDocs:first-child:not(.hero) { padding: 0 !important; }
html[data-theme="dark"] .ad-site {
    --primary: #2fc59f; --primary-600: #25ab89; --primary-soft: rgba(47, 197, 159, .12); --primary-soft-2: rgba(47, 197, 159, .2); --primary-ring: rgba(47, 197, 159, .3);
    --accent: #ff8a5b; --accent-soft: rgba(255, 138, 91, .14);
    --success: #3ccf86; --success-soft: rgba(60, 207, 134, .14); --info: #5aa2f5; --info-soft: rgba(90, 162, 245, .14);
    --warning: #f5b83d; --warning-soft: rgba(245, 184, 61, .14); --danger: #ff6b6f; --danger-soft: rgba(255, 107, 111, .14);
    --secondary: #9aabaa; --secondary-soft: rgba(154, 171, 170, .14);
    --main-bg: #0e1917; --surface: #14221f; --surface-2: #182825; --surface-3: #1d302c; --border: #22362f; --border-2: #2b443c;
    --text: #e4efeb; --text-2: #b3c6c0; --muted: #7c938d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 16px 34px -20px rgba(0, 0, 0, .7);
    --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .7); --shadow-primary: 0 12px 26px -12px rgba(47, 197, 159, .5); --code-bg: #050c0a;
}
@media (prefers-color-scheme: dark) {
    html:not([data-theme]) .ad-site {
        --ad-code: #ff8fb8;
        --ad-hero: radial-gradient(600px 300px at 0% 0%, rgba(47, 197, 159, .16), transparent 60%), linear-gradient(135deg, #0f4a3d 0%, #0b3a30 60%, #08231f 100%);
        --primary: #2fc59f; --primary-600: #25ab89; --primary-soft: rgba(47, 197, 159, .12); --primary-soft-2: rgba(47, 197, 159, .2); --primary-ring: rgba(47, 197, 159, .3);
        --accent: #ff8a5b; --accent-soft: rgba(255, 138, 91, .14);
        --success: #3ccf86; --success-soft: rgba(60, 207, 134, .14); --info: #5aa2f5; --info-soft: rgba(90, 162, 245, .14);
        --warning: #f5b83d; --warning-soft: rgba(245, 184, 61, .14); --danger: #ff6b6f; --danger-soft: rgba(255, 107, 111, .14);
        --secondary: #9aabaa; --secondary-soft: rgba(154, 171, 170, .14);
        --main-bg: #0e1917; --surface: #14221f; --surface-2: #182825; --surface-3: #1d302c; --border: #22362f; --border-2: #2b443c;
        --text: #e4efeb; --text-2: #b3c6c0; --muted: #7c938d;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 16px 34px -20px rgba(0, 0, 0, .7);
        --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .7); --shadow-primary: 0 12px 26px -12px rgba(47, 197, 159, .5); --code-bg: #050c0a;
    }
}
