:root {
    /* Light theme palette */
    --bg: #f7f9fc;
    --card: #ffffff;
    --muted: #5f6b7a;
    --text: #1a1d23;
    --accent: #f27127; /* primary blue */
    --accent-2: #12b886; /* green accent */
    --border: #e2e8f0;
    --overlay: rgba(0, 0, 0, .35);
    --btn: #f1f5f9;
}

body {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

header {
    margin-bottom: 8px;
}

footer {
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 16px
}

.logo {
     background-image: url(/static/front/img/logo-black.png) !important;
}


.doc-scope html, .doc-scope body {
    height: 100%
}

.doc-scope * {
    box-sizing: border-box;
}

.doc-scope {
    margin: 0;
    font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.doc-scope ul {
    list-style: inside;
}

.doc-scope ol {
    list-style: auto;
}

/* Header (non-sticky) */
.doc-scope header {
    border-bottom: 1px solid var(--border);
    background: radial-gradient(1200px 400px at 20% -10%, rgba(122, 162, 255, .15), transparent 60%),
    radial-gradient(1200px 400px at 80% -10%, rgba(110, 231, 183, .12), transparent 60%);
}

/* Header text overrides on light background (doc pages load this file) */
header .map p:first-child,
header .email p:first-child {
    color: #6b7280; /* muted on light */
}

header .map p:last-child,
header .email p:last-child {
    color: #1a1d23; /* main text */
}

header .contacts a,
header .contacts p:first-child {
    color: #1a1d23;
}

header .contacts p:last-child {
    color: #6b7280;
}

.doc-scope .title {
    font-weight: 800;
    letter-spacing: .2px;
    font-size: clamp(28px, 4vw, 40px);
    margin: 10px 0 !important;
    line-height: 1.2em;
}

.doc-scope .subtitle {
    color: var(--muted);
    margin-top: 0
}

.doc-scope main {
    display: grid;
    grid-template-columns:1fr;
    gap: 24px;
    margin-top: 24px
}

@media (min-width: 960px) {
    .doc-scope main {
        grid-template-columns:280px 1fr
    }
}

/* Desktop sidebar: sticky */
.doc-scope aside.desktop-nav {
    align-self: start;
    position: sticky;
    top: 24px; /* stays visible during scroll */
    height: fit-content;
}

.doc-scope nav.toc {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

.doc-scope nav.toc h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .12em
}

.doc-scope nav.toc a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent
}

.doc-scope nav.toc a:hover {
    background: #eef2f7;
    border-color: var(--border)
}

.doc-scope nav.toc a span {
    color: var(--muted);
    margin-right: 6px
}

/* Cards */
.doc-scope section.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 15px;
}

.doc-scope h2 {
    margin: 0 0 10px 0;
    font-size: clamp(20px, 2.8vw, 26px);
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 10px
}

.doc-scope h2 .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #eef2f7;
    border: 1px solid var(--border);
    color: var(--accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.doc-scope h3 {
    margin: 16px 0 8px 0;
    font-size: 18px
}

.doc-scope p {
    margin: 8px 0
}

.doc-scope ul {
    margin: 8px 0 8px 24px
}

.doc-scope a {
    color: var(--accent)
}

.doc-scope .badge {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: 14px
}

.doc-scope .btn {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--btn);
    color: #0f172a;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
}

.doc-scope .btn:hover {
    background: #e2e8f0
}

.doc-scope .btn.secondary {
    background: #ffffff;
    color: var(--accent);
}


.doc-scope .callout {
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 8px 0;
    color: var(--muted)
}

/* ---- Topbar layout ---- */
.doc-scope .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-scope .spacer {
    flex: 1
}

/* Desktop "Вернуться на сайт" button visible >=960px */
.doc-scope .back-desktop {
    display: none
}

@media (min-width: 960px) {
    .doc-scope .back-desktop {
        display: inline-flex
    }
}

/* -------- Mobile burger FAB -------- */
.doc-scope .menu-fab {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    top: max(16px, env(safe-area-inset-top));
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

/* Hidden state for burger FAB */
.doc-scope .menu-fab.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
}

.doc-scope .menu-fab .sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0
}

/* Hide FAB on desktop */
@media (min-width: 960px) {
    .doc-scope .menu-fab {
        display: none
    }
}

/* Off-canvas drawer */
.doc-scope .drawer-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    pointer-events: none;
    transition: .2s opacity ease;
    z-index: 900;
}

.doc-scope .drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(86vw, 320px);
    background: var(--card);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform .25s ease;
    padding: 16px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 901;
}

.doc-scope .drawer h3 {
    margin-top: 8px
}

.doc-scope .drawer a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent
}

.doc-scope .drawer a:hover {
    background: #eef2f7;
    border-color: var(--border)
}

.doc-scope .drawer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
}

.doc-scope.drawer-open .drawer {
    transform: translateX(0)
}

.doc-scope.drawer-open .drawer-overlay {
    opacity: 1;
    pointer-events: auto
}

.doc-scope .drawer-sep {
    margin: 12px 0;
    border-top: 1px dashed var(--border)
}

/* Drawer CTA button */
.doc-scope .drawer .cta {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
}

.doc-scope .drawer .cta a {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none
}

/* Disable sticky TOC on mobile */
@media (max-width: 959.98px) {
    .doc-scope aside.desktop-nav {
        position: static;
        top: auto;
    }
}
