@font-face {
    font-family: "GuideNazanin";
    src: url("../fonts/B-NAZANIN.TTF") format("truetype");
    font-display: swap;
}

:root {
    color-scheme: light;
    --font: "GuideNazanin", Tahoma, Arial, sans-serif;
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-soft: #f1f5fb;
    --surface-raised: #ffffff;
    --text: #182235;
    --text-soft: #617086;
    --text-faint: #8793a5;
    --brand: #0f61cf;
    --brand-deep: #0a4598;
    --brand-soft: #eaf2ff;
    --accent: #16a3b6;
    --border: #dfe6ef;
    --border-strong: #cbd6e4;
    --success-bg: #ecf9f5;
    --success: #087d62;
    --warning-bg: #fff8e8;
    --warning: #936300;
    --shadow-sm: 0 2px 8px rgba(20, 42, 74, .06);
    --shadow-md: 0 14px 38px rgba(20, 42, 74, .10);
    --radius-sm: 10px;
    --radius-md: 16px;
    --topbar: 72px;
    --sidebar: 280px;
    --toc: 210px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d1420;
    --surface: #121c2a;
    --surface-soft: #182535;
    --surface-raised: #172333;
    --text: #edf3fb;
    --text-soft: #aab8ca;
    --text-faint: #8291a5;
    --brand: #6aa8ff;
    --brand-deep: #9bc4ff;
    --brand-soft: #182f4e;
    --accent: #5bc8d6;
    --border: #29394d;
    --border-strong: #3c5068;
    --success-bg: #12372f;
    --success: #7bdec4;
    --warning-bg: #392f18;
    --warning: #f0c66d;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .18);
    --shadow-md: 0 18px 46px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
[data-guide-access]:not([data-guide-authorized="true"]) { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 28px); }

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 18px;
    line-height: 1.8;
    text-align: right;
    transition: background-color .2s ease, color .2s ease;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.skip-link {
    position: fixed;
    top: 8px;
    right: 12px;
    z-index: 100;
    transform: translateY(-150%);
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--brand);
    color: white;
}
.skip-link:focus { transform: translateY(0); }

.topbar {
    position: sticky;
    inset-block-start: 0;
    z-index: 50;
    height: var(--topbar);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(14px);
}
.topbar__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 28px; }
.brand-group, .topbar__tools, .brand { display: flex; align-items: center; }
.brand-group { gap: 12px; }
.brand { gap: 12px; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand__text { display: grid; line-height: 1.3; }
.brand__text strong { font-size: 17px; }
.brand__text small { margin-top: 3px; color: var(--text-soft); font-size: 13px; }
.version-badge { padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); font-size: 13px; }
.topbar__tools { gap: 10px; }

.global-search {
    width: min(340px, 30vw);
    height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    color: var(--text-soft);
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.global-search:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.global-search svg { width: 20px; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.global-search input::placeholder { color: var(--text-faint); }
.global-search kbd { direction: ltr; padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--text-faint); font: 11px Arial, sans-serif; }

.icon-button, .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-soft);
    cursor: pointer;
    transition: border-color .2s, color .2s, background-color .2s, transform .2s;
}
.icon-button { width: 42px; padding: 0; }
.icon-button:hover, .secondary-button:hover { border-color: var(--brand); color: var(--brand); }
.icon-button:active, .secondary-button:active { transform: translateY(1px); }
.icon-button svg { width: 20px; height: 20px; }
.secondary-button { gap: 7px; padding: 0 14px; color: var(--brand-deep); font-size: 14px; font-weight: 700; }
.secondary-button svg { width: 18px; }
.theme-icon--dark { display: none; }
html[data-theme="dark"] .theme-icon--light { display: none; }
html[data-theme="dark"] .theme-icon--dark { display: block; }
.mobile-menu-button { display: none; }

.reading-progress { position: fixed; inset: var(--topbar) 0 auto; z-index: 51; height: 2px; background: transparent; }
.reading-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .1s linear; }

.guide-shell { max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: var(--sidebar) minmax(0, 860px) var(--toc); justify-content: center; gap: 44px; padding: 0 28px; }

.sidebar {
    position: sticky;
    top: var(--topbar);
    height: calc(100vh - var(--topbar));
    display: flex;
    flex-direction: column;
    padding: 30px 0 24px 18px;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    scrollbar-width: thin;
}
.sidebar__mobile-head { display: none; }
.guide-nav { display: grid; gap: 4px; }
.nav-label { margin: 22px 13px 7px; color: var(--text-faint); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.nav-label:first-child { margin-top: 0; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 6px 11px; border-radius: 9px; color: var(--text-soft); font-size: 15px; transition: background-color .18s, color .18s; }
.nav-link:hover { background: var(--surface-soft); color: var(--text); }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.nav-link.is-active::before { content: ""; position: absolute; inset: 9px auto 9px -19px; width: 3px; border-radius: 3px; background: var(--brand); }
.nav-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: var(--surface); box-shadow: var(--shadow-sm); }
.nav-icon svg { width: 16px; height: 16px; }
.nav-link.is-active .nav-icon { background: var(--brand); color: white; }
.nav-link[hidden] { display: none; }

.sidebar-help { margin-top: auto; display: grid; grid-template-columns: 38px 1fr; gap: 8px 10px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.sidebar-help__icon { width: 38px; height: 38px; display: grid; place-items: center; grid-row: span 2; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.sidebar-help__icon svg { width: 21px; }
.sidebar-help div { display: grid; line-height: 1.45; }
.sidebar-help strong { font-size: 14px; }
.sidebar-help div span { color: var(--text-soft); font-size: 12px; }
.sidebar-help a { grid-column: 2; color: var(--brand); font-size: 13px; font-weight: 700; }

.content { min-width: 0; padding: 28px 0 80px; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 31px; color: var(--text-faint); font-size: 13px; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs svg { width: 13px; transform: scaleX(-1); }
.breadcrumbs span { color: var(--text-soft); }

.doc-section { padding: 0 0 72px; margin-bottom: 70px; border-bottom: 1px solid var(--border); }
.doc-section[hidden] { display: none; }
.area-context { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 22px; padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border)); border-radius: 12px; background: var(--brand-soft); color: var(--brand-deep); }
.area-context strong { font-size: 15px; }
.area-context span { color: var(--text-soft); font-size: 13px; }
.intro-section { padding-top: 3px; }
.eyebrow { display: block; margin-bottom: 6px; color: var(--brand); font-size: 14px; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 17px; font-size: clamp(34px, 4vw, 50px); line-height: 1.35; letter-spacing: -.025em; }
h2 { margin: 0; font-size: 30px; line-height: 1.4; }
h3 { margin-bottom: 4px; font-size: 18px; }
p { color: var(--text-soft); }
.lead { max-width: 730px; margin-bottom: 18px; font-size: 20px; line-height: 1.9; }
.intro-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--text-faint); font-size: 13px; }
.intro-meta span { display: flex; align-items: center; gap: 6px; }
.intro-meta svg { width: 16px; }

.start-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; }
.start-card { position: relative; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .2s, border-color .2s, box-shadow .2s; }
.start-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); box-shadow: var(--shadow-md); }
.start-card--primary { border-color: transparent; background: linear-gradient(145deg, #0f61cf, #0a4da9); color: white; }
.start-card--primary::after { content: ""; position: absolute; width: 120px; height: 120px; top: -62px; left: -45px; border: 24px solid rgba(255,255,255,.08); border-radius: 50%; }
.start-card__number { color: var(--brand); font: 700 14px Arial, sans-serif; }
.start-card--primary .start-card__number { color: #cfe2ff; }
.start-card div { display: grid; }
.start-card strong { font-size: 17px; }
.start-card div span { color: var(--text-soft); font-size: 13px; }
.start-card--primary div span { color: #d8e8ff; }
.start-card__arrow { position: absolute; left: 15px; bottom: 19px; width: 18px; color: var(--brand); }
.start-card--primary .start-card__arrow { color: white; }

.section-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 19px; }
.section-number { width: 50px; height: 50px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border)); border-radius: 14px; background: var(--brand-soft); color: var(--brand); font: 700 15px Arial, sans-serif; }
.section-heading .eyebrow { margin: 0; font-size: 12px; }
.doc-section > p { max-width: 730px; }

.steps { position: relative; display: grid; gap: 0; margin: 31px 0; padding: 0; list-style: none; counter-reset: guide-step; }
.steps::before { content: ""; position: absolute; top: 29px; bottom: 29px; right: 23px; width: 1px; background: var(--border-strong); }
.steps li { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 17px; padding: 0 0 27px; }
.steps li:last-child { padding-bottom: 0; }
.step-number { z-index: 1; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--brand); font: 700 14px Arial, sans-serif; }
.steps p { margin-bottom: 0; font-size: 16px; }

.callout { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 17px 18px; border-radius: 12px; }
.callout--tip { border-right: 3px solid var(--success); background: var(--success-bg); }
.callout--warning { border-right: 3px solid var(--warning); background: var(--warning-bg); }
.callout__icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, currentColor 10%, transparent); }
.callout--tip .callout__icon { color: var(--success); }
.callout--warning .callout__icon { color: var(--warning); }
.callout__icon svg { width: 20px; }
.callout strong { font-size: 15px; }
.callout p { margin: 1px 0 0; color: var(--text-soft); font-size: 14px; }

.interface-preview { position: relative; margin: 31px 0 20px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; }
.interface-preview--real img { display: block; width: 100%; height: auto; }
.preview-toolbar { height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 15px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.preview-logo { width: 23px; height: 23px; margin-left: auto; border-radius: 7px; background: var(--brand); }
.preview-search { width: 27%; height: 20px; border-radius: 6px; background: var(--border); }
.preview-avatar { width: 25px; height: 25px; border-radius: 50%; background: var(--border-strong); }
.preview-body { height: 335px; display: grid; grid-template-columns: 145px 1fr; }
.preview-side { display: flex; flex-direction: column; gap: 15px; padding: 22px 16px; border-left: 1px solid var(--border); background: color-mix(in srgb, var(--surface-soft) 65%, var(--surface)); }
.preview-side i { display: block; width: 70%; height: 10px; border-radius: 5px; background: var(--border); }
.preview-side i:first-child { width: 90%; background: color-mix(in srgb, var(--brand) 42%, var(--surface)); }
.preview-workspace { padding: 27px; }
.preview-title b, .preview-title span { display: block; height: 11px; border-radius: 6px; background: var(--border); }
.preview-title b { width: 28%; height: 15px; background: var(--border-strong); }
.preview-title span { width: 42%; margin-top: 10px; }
.preview-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.preview-metrics i { height: 62px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.preview-chart { height: 135px; display: flex; align-items: flex-end; gap: 9px; margin-top: 22px; padding: 16px 20px 0; border: 1px solid var(--border); border-radius: 9px; }
.preview-chart span { flex: 1; min-height: 25%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--brand) 36%, var(--surface)); }
.preview-chart span:nth-child(2) { height: 45%; }.preview-chart span:nth-child(3) { height: 75%; }.preview-chart span:nth-child(4) { height: 54%; }.preview-chart span:nth-child(5) { height: 88%; }.preview-chart span:nth-child(6) { height: 67%; }
.preview-pin { position: absolute; width: 30px; height: 30px; display: grid; place-items: center; border: 3px solid var(--surface); border-radius: 50%; background: var(--brand); color: white; box-shadow: 0 4px 10px rgba(15,97,207,.35); font: 700 13px Arial, sans-serif; }
.preview-pin--one { top: 118px; right: 97px; }.preview-pin--two { top: 13px; left: 120px; }.preview-pin--three { top: 205px; left: 33%; }
.interface-preview figcaption { padding: 11px 15px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12px; }

.definition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.definition-grid > div { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.definition-grid > div > span { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: white; font: 700 11px Arial, sans-serif; }
.definition-grid strong { font-size: 14px; }
.definition-grid p { margin: 2px 0 0; font-size: 12px; line-height: 1.65; }

.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 26px; }
.feature-list article { display: flex; gap: 13px; padding: 20px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.feature-list article > span { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.feature-list h3 { margin: 0 0 4px; }
.feature-list p { margin-bottom: 9px; font-size: 14px; }
.feature-list a { color: var(--brand); font-size: 13px; font-weight: 700; }
.compact-section { padding-bottom: 54px; margin-bottom: 54px; }

.faq-list { display: grid; gap: 9px; margin-top: 23px; }
.faq-list details { border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; cursor: pointer; font-size: 15px; font-weight: 700; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary svg { width: 17px; transition: transform .2s; }
.faq-list details[open] summary svg { transform: rotate(180deg); }
.faq-list p { margin: 0; padding: 0 17px 15px; font-size: 14px; }

.article-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; color: var(--text-soft); font-size: 13px; }
.article-footer div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.article-footer button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text-soft); cursor: pointer; }
.article-footer button:hover { border-color: var(--brand); color: var(--brand); }
.article-footer > a { color: var(--brand); font-weight: 700; }

.page-toc { position: sticky; top: calc(var(--topbar) + 38px); align-self: start; padding-top: 6px; }
.page-toc > strong { display: block; margin-bottom: 11px; font-size: 14px; }
.page-toc nav { display: grid; }
.page-toc nav a { position: relative; padding: 5px 13px 5px 0; border-right: 1px solid var(--border); color: var(--text-faint); font-size: 13px; transition: color .2s, border-color .2s; }
.page-toc nav a:hover { color: var(--text); }
.page-toc nav a.is-active { border-right: 2px solid var(--brand); color: var(--brand); font-weight: 700; }
.toc-divider { height: 1px; margin: 18px 0; background: var(--border); }
.toc-edit { display: flex; align-items: center; gap: 7px; color: var(--text-soft); font-size: 12px; }
.toc-edit:hover { color: var(--brand); }
.toc-edit svg { width: 16px; }

.search-empty { position: fixed; top: 83px; left: 50%; z-index: 70; transform: translateX(-50%); padding: 9px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-md); color: var(--text-soft); font-size: 14px; }

@media (max-width: 1180px) {
    .guide-shell { grid-template-columns: var(--sidebar) minmax(0, 820px); gap: 38px; }
    .page-toc { display: none; }
}

@media (max-width: 860px) {
    :root { --topbar: 64px; }
    body { font-size: 17px; }
    .topbar__inner { padding: 0 16px; }
    .mobile-menu-button { display: inline-flex; }
    .brand__text small, .version-badge, .print-button, .global-search kbd { display: none; }
    .global-search { width: min(260px, 36vw); }
    .guide-shell { display: block; padding: 0 20px; }
    .sidebar { position: fixed; inset: 0 0 0 auto; z-index: 80; width: min(330px, 88vw); height: 100vh; padding: 16px 18px 24px; border-left: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-md); transform: translateX(105%); transition: transform .25s ease; }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar__mobile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 75; background: rgba(8, 18, 32, .5); backdrop-filter: blur(2px); }
    .sidebar-backdrop:not([hidden]) { display: block; }
    .content { max-width: 820px; margin: 0 auto; }
    .start-grid { grid-template-columns: 1fr; }
    .start-card { min-height: 118px; }
}

@media (max-width: 600px) {
    .brand img { width: 34px; height: 34px; }
    .brand__text strong { font-size: 14px; }
    .topbar__tools { margin-right: auto; }
    .global-search { width: 42px; padding: 0; justify-content: center; background: var(--surface); }
    .global-search input { position: fixed; top: 70px; right: 12px; left: 12px; width: calc(100% - 24px); height: 46px; padding: 0 14px; border: 1px solid var(--brand); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transform: translateY(-7px); transition: opacity .2s, transform .2s; }
    .global-search:focus-within input { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .guide-shell { padding: 0 16px; }
    .content { padding-top: 20px; }
    .breadcrumbs { margin-bottom: 21px; }
    h1 { font-size: 34px; }
    h2 { font-size: 25px; }
    .lead { font-size: 18px; }
    .doc-section { padding-bottom: 52px; margin-bottom: 50px; }
    .intro-meta { display: grid; gap: 4px; }
    .section-heading { align-items: flex-start; }
    .section-number { width: 43px; height: 43px; border-radius: 12px; }
    .preview-body { height: 260px; grid-template-columns: 82px 1fr; }
    .preview-workspace { padding: 17px 12px; }
    .preview-metrics { gap: 6px; }
    .preview-chart { padding-inline: 9px; gap: 5px; }
    .preview-pin--one { right: 49px; }
    .definition-grid, .feature-list { grid-template-columns: 1fr; }
    .article-footer { align-items: flex-start; flex-direction: column; }
}

@media print {
    :root { --bg: #fff; --surface: #fff; --surface-soft: #f5f7fa; --text: #111827; --text-soft: #4b5563; --border: #d1d5db; }
    body { background: white; font-size: 13pt; }
    .topbar, .reading-progress, .sidebar, .page-toc, .breadcrumbs, .article-footer, .search-empty { display: none !important; }
    .guide-shell { display: block; max-width: none; padding: 0; }
    .content { padding: 0; }
    .doc-section { break-inside: avoid; }
    .interface-preview, .start-card, .feature-list article { box-shadow: none; }
    a { color: inherit; }
}
