/* Академия — GitBook-подобная база знаний. Тема hustlegso (CORE/DESIGN-SYSTEM.md), контракт токенов.
   Каркас: шапка 64 · меню 288 · контент 768 · «На этой странице» 200. Inter 16/26, H1 36/45. */

/* ---------- Шрифты (локально, без CDN) ---------- */
@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/Inter-400-cyrillic-ext.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/Inter-400-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(/fonts/Inter-400-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/Inter-500-cyrillic-ext.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/Inter-500-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(/fonts/Inter-500-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/Inter-600-cyrillic-ext.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/Inter-600-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(/fonts/Inter-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/Inter-700-cyrillic-ext.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}
@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/Inter-700-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/Inter-700-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Oswald;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/Oswald-700-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Oswald;font-style:normal;font-weight:700;font-display:swap;src:url(/fonts/Oswald-700-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* ---------- Токены: светлая (как GitBook) ---------- */
:root{
  --bg:#ffffff; --surface:#ffffff; --surface-2:#f8f7f5; --surface-3:#f1efeb; --text:#1c1d1f; --text-muted:#6a6e77; --text-soft:rgba(35,35,40,.66);
  --line:#e6e3de; --line-2:#efece8;
  --accent:#ff7a1a; --accent-ink:#c2500b; --accent-soft:#fff3ea; --accent-line:#f6d2b6; --on-accent:#111111;
  --success:#15803d; --danger:#d92d20; --warning:#f5b544;
  --hint-info-bg:#f6f6f7; --hint-info-line:#e4e4e7; --hint-info-ic:#52525b;
  --hint-ok-bg:#effaf3; --hint-ok-line:#c4e9d1; --hint-ok-ic:#15803d;
  --hint-warn-bg:#fff5ec; --hint-warn-line:#f2d3b6; --hint-warn-ic:#e0620b;
  --hint-bad-bg:#fef2f1; --hint-bad-line:#f6cbc7; --hint-bad-ic:#d92d20;
  --dark:#121316; --dark-2:#1b1c20; --dark-line:#2a2b30; --on-dark:#ffffff; --on-dark-muted:#a1a1a6;
  --font-sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',system-ui,sans-serif; --font-head:'Oswald',Impact,sans-serif;
  --font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --r-sm:6px; --r-md:8px; --r-lg:12px; --r-xl:16px; --r-full:999px;
  --shadow-1:0 1px 2px rgba(16,16,20,.05); --shadow-2:0 8px 24px rgba(16,16,20,.08); --shadow-3:0 24px 64px rgba(16,16,20,.22);
  --ease:cubic-bezier(.2,.6,.2,1); --dur:.2s;
  --header-h:64px; --side-w:288px; --main-w:768px; --toc-w:200px;
  color-scheme:light;
}
/* тёмная: системная или выбранная вручную */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#121316; --surface:#17181c; --surface-2:#18191d; --surface-3:#212227; --text:#ececee; --text-muted:#a1a1a8; --text-soft:rgba(236,236,240,.68);
  --line:#2a2b30; --line-2:#232428;
  --accent:#ff7a1a; --accent-ink:#ff9a4d; --accent-soft:rgba(255,122,26,.10); --accent-line:rgba(255,122,26,.32);
  --hint-info-bg:#1b1c20; --hint-info-line:#2c2d33; --hint-info-ic:#c4c4cc;
  --hint-ok-bg:rgba(34,197,94,.08); --hint-ok-line:rgba(34,197,94,.28); --hint-ok-ic:#4ade80;
  --hint-warn-bg:rgba(255,122,26,.09); --hint-warn-line:rgba(255,122,26,.30); --hint-warn-ic:#ff9a4d;
  --hint-bad-bg:rgba(239,68,68,.09); --hint-bad-line:rgba(239,68,68,.30); --hint-bad-ic:#f87171;
  --shadow-2:0 8px 24px rgba(0,0,0,.4); --shadow-3:0 24px 64px rgba(0,0,0,.6);
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#121316; --surface:#17181c; --surface-2:#18191d; --surface-3:#212227; --text:#ececee; --text-muted:#a1a1a8; --text-soft:rgba(236,236,240,.68);
  --line:#2a2b30; --line-2:#232428;
  --accent:#ff7a1a; --accent-ink:#ff9a4d; --accent-soft:rgba(255,122,26,.10); --accent-line:rgba(255,122,26,.32);
  --hint-info-bg:#1b1c20; --hint-info-line:#2c2d33; --hint-info-ic:#c4c4cc;
  --hint-ok-bg:rgba(34,197,94,.08); --hint-ok-line:rgba(34,197,94,.28); --hint-ok-ic:#4ade80;
  --hint-warn-bg:rgba(255,122,26,.09); --hint-warn-line:rgba(255,122,26,.30); --hint-warn-ic:#ff9a4d;
  --hint-bad-bg:rgba(239,68,68,.09); --hint-bad-line:rgba(239,68,68,.30); --hint-bad-ic:#f87171;
  --shadow-2:0 8px 24px rgba(0,0,0,.4); --shadow-3:0 24px 64px rgba(0,0,0,.6);
  color-scheme:dark;
}

/* ---------- База ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-padding-top:calc(var(--header-h) + 24px)}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font-sans);font-size:16px;line-height:26px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}
a{color:inherit}
img{max-width:100%;height:auto}
button{font:inherit;color:inherit}
svg.i{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:12px;top:-60px;z-index:100;background:var(--text);color:var(--bg);padding:8px 14px;border-radius:var(--r-md);text-decoration:none}
.skip:focus{top:12px}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

/* ---------- Шапка 64 ---------- */
.hdr{position:sticky;top:0;z-index:40;height:var(--header-h);background:color-mix(in srgb,var(--bg) 88%,transparent);-webkit-backdrop-filter:saturate(1.5) blur(12px);backdrop-filter:saturate(1.5) blur(12px);border-bottom:1px solid var(--line)}
.hdr-in{max-width:1440px;height:100%;margin:0 auto;padding:0 32px;display:flex;align-items:center;gap:16px}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;width:calc(var(--side-w) + 48px);flex:none;min-width:0}
.brand-mark{width:32px;height:32px;border-radius:8px;background:var(--accent);color:#111;display:grid;place-items:center;font:700 19px/1 var(--font-head);flex:none}
.brand-name{font-size:16px;font-weight:600;letter-spacing:-.005em;white-space:nowrap}
.brand-name span{color:var(--text-muted);font-weight:500}
.search-btn{display:flex;align-items:center;gap:8px;width:512px;max-width:100%;height:40px;padding:0 8px 0 12px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--text-muted);font-size:14px;cursor:pointer;box-shadow:var(--shadow-1);transition:border-color var(--dur) var(--ease),box-shadow var(--dur) var(--ease)}
.search-btn:hover{border-color:color-mix(in srgb,var(--text-muted) 45%,var(--line))}
.search-btn .i{width:18px;height:18px}
.search-btn .ph{flex:1;text-align:left}
kbd{font:500 11px/1 var(--font-sans);color:var(--text-muted);border:1px solid var(--line);border-radius:5px;padding:3px 5px;background:var(--surface-2);min-width:20px;text-align:center}
.hdr-right{margin-left:auto;display:flex;align-items:center;gap:6px}
.icon-btn{width:36px;height:36px;display:grid;place-items:center;border:1px solid transparent;border-radius:var(--r-md);background:none;cursor:pointer;color:var(--text-muted);text-decoration:none;transition:background var(--dur) var(--ease),color var(--dur) var(--ease)}
.icon-btn:hover{background:var(--surface-3);color:var(--text)}
.icon-btn .i{width:18px;height:18px}
.lang{font-size:13px;font-weight:600;letter-spacing:.02em;width:auto;padding:0 10px;display:flex;gap:6px}
.burger,.search-ico{display:none}
.theme-btn .moon{display:none}
:root[data-theme="dark"] .theme-btn .sun{display:none}
:root[data-theme="dark"] .theme-btn .moon{display:block}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .theme-btn .sun{display:none}:root:not([data-theme="light"]) .theme-btn .moon{display:block}}

/* ---------- Каркас 288 | 768 | 200 ---------- */
.layout{max-width:1440px;margin:0 auto;padding:0 32px;display:grid;grid-template-columns:var(--side-w) minmax(0,1fr);column-gap:48px}
.side{position:sticky;top:calc(var(--header-h) + 24px);height:calc(100vh - var(--header-h) - 32px);height:calc(100dvh - var(--header-h) - 32px);margin-top:24px;display:flex;flex-direction:column;background:var(--surface-2);border-radius:var(--r-xl);overflow:hidden}
.side-scroll{flex:1;overflow-y:auto;padding:16px 12px 16px 8px;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.nav-group{margin-top:20px}
.nav-group:first-child{margin-top:4px}
.nav-title{display:block;padding:6px 12px;font-size:12px;line-height:16px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text);text-decoration:none}
a.nav-title:hover{color:var(--accent-ink)}
.nav-list{list-style:none;margin:4px 0 0;padding:0}
.nav-link{display:flex;align-items:flex-start;gap:10px;padding:6px 8px 6px 12px;border-radius:var(--r-sm);font-size:14px;line-height:20px;color:var(--text-soft);text-decoration:none;transition:background var(--dur) var(--ease),color var(--dur) var(--ease)}
.nav-link .i{margin-top:2px;opacity:.85}
.nav-link:hover{background:color-mix(in srgb,var(--text) 5%,transparent);color:var(--text)}
.nav-link[aria-current="page"]{color:var(--accent-ink);font-weight:600;background:var(--accent-soft)}
.nav-link[aria-current="page"] .i{opacity:1}

/* CTA в меню — вместо «Работает на GitBook» */
.side-cta{margin:8px;padding:14px 14px 14px;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--bg);text-decoration:none;display:block;transition:border-color var(--dur) var(--ease),box-shadow var(--dur) var(--ease)}
.side-cta:hover{border-color:var(--accent-line);box-shadow:var(--shadow-2)}
.side-cta .eb{font-size:11px;line-height:14px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--accent-ink)}
.side-cta b{display:block;margin-top:4px;font:700 17px/1.15 var(--font-head);text-transform:uppercase;letter-spacing:.01em}
.side-cta b mark{background:var(--accent);color:#111;padding:0 4px}
.side-cta p{margin:6px 0 0;font-size:13px;line-height:18px;color:var(--text-muted)}
.side-cta .go{display:inline-flex;align-items:center;gap:4px;margin-top:8px;font-size:13px;font-weight:600;color:var(--text)}

.page{display:grid;grid-template-columns:minmax(0,var(--main-w)) var(--toc-w);column-gap:60px;justify-content:start;min-width:0}
.main{min-width:0;padding:32px 0 48px}
.toc{position:sticky;top:var(--header-h);align-self:start;max-height:calc(100vh - var(--header-h));overflow-y:auto;padding:38px 0 24px;scrollbar-width:none}
.toc-title{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--text);margin:0 0 12px}
.toc-title .i{width:14px;height:14px}
.toc ul{list-style:none;margin:0;padding:0}
.toc li a{display:block;padding:6px 0;font-size:14px;line-height:20px;color:var(--text-muted);text-decoration:none;transition:color var(--dur) var(--ease)}
.toc li.l3 a{padding-left:12px;border-left:1px solid var(--line);margin-left:2px;font-size:13px}
.toc li a:hover{color:var(--text)}
.toc li a.on{color:var(--accent-ink);font-weight:500}
.toc li.l3 a.on{border-left-color:var(--accent)}

/* ---------- Заголовок статьи ---------- */
.crumbs{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0;list-style:none;font-size:12px;line-height:16px;font-weight:500}
.crumbs a{color:var(--accent-ink);text-decoration:none}
.crumbs a:hover{text-decoration:underline}
.crumbs li+li::before{content:"›";margin-right:6px;color:var(--text-muted)}
.crumbs li:last-child{color:var(--text-muted)}
.head-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px}
.tools{display:flex;gap:8px;flex:none}
.copy{position:relative;display:flex}
.btn-s{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--line);background:var(--bg);color:var(--text-muted);font-size:13px;font-weight:500;cursor:pointer;border-radius:var(--r-md);text-decoration:none;transition:color var(--dur) var(--ease),border-color var(--dur) var(--ease)}
.btn-s:hover{color:var(--text);border-color:color-mix(in srgb,var(--text-muted) 40%,var(--line))}
.btn-s .i{width:14px;height:14px}
.copy .btn-s:first-child{border-radius:var(--r-md) 0 0 var(--r-md)}
.copy .btn-s.more{border-radius:0 var(--r-md) var(--r-md) 0;margin-left:-1px;padding:0 6px}
.menu{position:absolute;right:0;top:34px;z-index:30;min-width:230px;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-2);display:none}
.menu.open{display:block}
.menu a,.menu button{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:none;border-radius:var(--r-sm);font-size:14px;line-height:20px;color:var(--text);text-decoration:none;cursor:pointer;text-align:left}
.menu a:hover,.menu button:hover{background:var(--surface-3)}
.toc-btn{display:none}
h1.title{margin:12px 0 0;font-size:36px;line-height:45px;font-weight:700;letter-spacing:-.02em;text-wrap:balance}
.lead{margin:12px 0 0;font-size:18px;line-height:28px;color:var(--text-muted)}
.byline{display:flex;align-items:center;gap:10px;margin:20px 0 0;font-size:14px;line-height:20px;color:var(--text-muted);font-style:normal;flex-wrap:wrap}
.byline img{width:28px;height:28px;border-radius:50%;object-fit:cover;flex:none}
.byline a[rel="author"]{color:var(--text);font-weight:600;text-decoration:none}
.byline a[rel="author"]:hover{color:var(--accent-ink)}
.byline .dot{opacity:.5}
.cover{margin:28px 0 0}
.cover img{display:block;width:100%;height:auto;border-radius:var(--r-lg)}
.cover[hidden]{display:none}

/* ---------- Тело статьи ---------- */
.prose{margin-top:28px}
.prose>*:first-child{margin-top:0}
.prose p{margin:0 0 16px}
.prose h2{margin:40px 0 16px;padding-top:8px;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.015em}
.prose h3{margin:32px 0 12px;font-size:20px;line-height:28px;font-weight:600;letter-spacing:-.01em}
.prose h4{margin:24px 0 8px;font-size:16px;line-height:24px;font-weight:600}
.prose h2+h3{margin-top:16px}
.prose :is(h2,h3,h4){position:relative;scroll-margin-top:calc(var(--header-h) + 24px)}
.hlink{position:absolute;display:inline-grid;place-items:center;width:24px;height:24px;margin:2px 0 0 6px;border-radius:var(--r-sm);color:var(--text-muted);opacity:0;text-decoration:none;transition:opacity var(--dur) var(--ease),background var(--dur) var(--ease)}
.hlink .i{width:15px;height:15px}
:is(h2,h3,h4):hover .hlink,.hlink:focus-visible{opacity:1}
@media (hover:none){.hlink{display:none}}
.hlink:hover{background:var(--surface-3);color:var(--text)}
.prose a{color:var(--accent-ink);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;text-decoration-color:color-mix(in srgb,var(--accent-ink) 45%,transparent);transition:text-decoration-color var(--dur) var(--ease)}
.prose a:hover{text-decoration-color:currentColor}
.prose a.ext::after{content:"↗";display:inline-block;margin-left:2px;font-size:.8em;text-decoration:none;opacity:.8}
.prose strong{font-weight:600}
.prose :is(ul,ol){margin:0 0 16px;padding-left:28px}
.prose li{margin:0 0 8px;padding-left:4px}
.prose li>:is(ul,ol){margin:8px 0 0}
.prose li>p{margin:0 0 8px}
.prose ol>li::marker{color:var(--text-muted);font-variant-numeric:tabular-nums}
.prose ul>li::marker{color:var(--text-muted)}
.prose hr{border:0;border-top:1px solid var(--line);margin:32px 0}
.prose blockquote{margin:0 0 16px;padding:2px 0 2px 24px;border-left:2px solid var(--line);color:var(--text-muted)}
.prose code{font:14px/1 var(--font-mono);background:var(--surface-3);border:1px solid var(--line-2);border-radius:5px;padding:2px 5px}
.prose pre{margin:0 0 16px;padding:16px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--r-lg);overflow-x:auto;font:14px/22px var(--font-mono)}
.prose pre code{background:none;border:0;padding:0;font:inherit}

/* таблицы */
.table{margin:0 0 20px;overflow-x:auto;border:1px solid var(--line);border-radius:var(--r-lg);-webkit-overflow-scrolling:touch}
.table table{width:100%;border-collapse:collapse;font-size:14px;line-height:22px}
.table th{text-align:left;font-weight:600;background:var(--surface-2);color:var(--text)}
.table :is(th,td){padding:10px 14px;border-bottom:1px solid var(--line);vertical-align:top}
.table tr:last-child td{border-bottom:0}
.table td{min-width:110px}

/* картинки с подписью */
.prose figure{margin:24px 0}
.prose figure img{display:block;margin:0 auto;border-radius:var(--r-sm);border:1px solid var(--line-2)}
.prose figcaption{margin-top:8px;text-align:center;font-size:14px;line-height:20px;color:var(--text-muted)}

/* hint / callout */
.hint{position:relative;margin:0 0 20px;padding:14px 16px 14px 46px;border:1px solid var(--hint-info-line);background:var(--hint-info-bg);border-radius:var(--r-md);font-size:14px;line-height:22px}
.hint>.hint-ic{position:absolute;left:16px;top:16px;width:18px;height:18px;color:var(--hint-info-ic);fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.hint>p:last-child,.hint>:is(ul,ol):last-child,.hint>details:last-child{margin-bottom:0}
.hint p{margin-bottom:8px}
.hint :is(ul,ol){margin-bottom:8px;padding-left:22px}
.hint li{margin-bottom:4px}
.hint-success{background:var(--hint-ok-bg);border-color:var(--hint-ok-line)}.hint-success>.hint-ic{color:var(--hint-ok-ic)}
.hint-warning{background:var(--hint-warn-bg);border-color:var(--hint-warn-line)}.hint-warning>.hint-ic{color:var(--hint-warn-ic)}
.hint-danger{background:var(--hint-bad-bg);border-color:var(--hint-bad-line)}.hint-danger>.hint-ic{color:var(--hint-bad-ic)}
.hint-info{border-left:3px solid color-mix(in srgb,var(--hint-info-ic) 70%,transparent)}

/* раскрывашки */
.prose details{margin:0 0 12px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--bg);transition:border-color var(--dur) var(--ease)}
.prose details+details{margin-top:-4px}
.prose details[open]{border-color:color-mix(in srgb,var(--text-muted) 35%,var(--line))}
.prose summary{display:flex;align-items:center;gap:10px;padding:12px 16px;cursor:pointer;list-style:none;font-weight:600;font-size:15px;line-height:22px;border-radius:var(--r-md)}
.prose summary::-webkit-details-marker{display:none}
.prose summary::before{content:"";width:16px;height:16px;flex:none;background:currentColor;opacity:.6;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/16px no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/16px no-repeat;transition:transform var(--dur) var(--ease)}
.prose details[open]>summary::before{transform:rotate(90deg)}
.prose summary:hover{background:var(--surface-2)}
.prose details>:not(summary){margin-left:16px;margin-right:16px}
.prose details>summary+*{margin-top:4px}
.prose details>:last-child{margin-bottom:14px}

/* шаги (stepper) */
.prose ol.steps{list-style:none;padding:0;margin:8px 0 24px;counter-reset:step}
.prose ol.steps>li{position:relative;counter-increment:step;padding:0 0 20px 44px;margin:0}
.prose ol.steps>li::before{content:counter(step);position:absolute;left:0;top:0;width:26px;height:26px;border-radius:50%;background:var(--accent);color:#111;font:600 13px/26px var(--font-sans);text-align:center}
.prose ol.steps>li::after{content:"";position:absolute;left:12.5px;top:32px;bottom:6px;width:1px;background:var(--line)}
.prose ol.steps>li:last-child{padding-bottom:4px}
.prose ol.steps>li:last-child::after{display:none}
.prose ol.steps>li>:is(h2,h3,h4):first-child{margin-top:0;padding-top:0;line-height:26px}

/* чек-лист */
.prose ul.tasks{list-style:none;padding-left:0}
.prose ul.tasks>li{display:flex;gap:10px;align-items:flex-start;padding-left:0}
.prose ul.tasks input{appearance:none;-webkit-appearance:none;flex:none;width:18px;height:18px;margin:4px 0 0;border:1.5px solid color-mix(in srgb,var(--text-muted) 60%,transparent);border-radius:5px;background:var(--bg);cursor:pointer;display:grid;place-items:center;transition:background var(--dur) var(--ease),border-color var(--dur) var(--ease)}
.prose ul.tasks input:checked{background:var(--accent);border-color:var(--accent)}
.prose ul.tasks input:checked::after{content:"";width:10px;height:6px;border:2px solid #111;border-top:0;border-right:0;transform:translateY(-1px) rotate(-45deg)}
.prose ul.tasks li:has(input:checked)>span{color:var(--text-muted);text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--text-muted) 60%,transparent)}

/* кнопка-реф */
.prose p.ref-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:20px 0 24px}
.prose a.btn-ref{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 20px;border-radius:var(--r-full);background:var(--accent);color:#111;font-weight:600;font-size:15px;text-decoration:none;box-shadow:0 1px 0 rgba(255,255,255,.35) inset,0 6px 16px rgba(255,122,26,.22);transition:transform var(--dur) var(--ease),box-shadow var(--dur) var(--ease)}
.prose a.btn-ref:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(255,122,26,.34)}
.prose a.btn-ref .i{width:15px;height:15px;stroke-width:2}
.prose a.btn-ref::after{content:none}
.ref-note{font-size:12px;line-height:16px;color:var(--text-muted)}

/* карточка-ссылка (content-ref) */
.cards{display:grid;gap:12px;margin:0 0 20px}
.cards.grid{grid-template-columns:repeat(2,minmax(0,1fr))}
a.card{display:flex;align-items:center;gap:14px;padding:14px 16px;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--bg);text-decoration:none!important;color:var(--text)!important;transition:border-color var(--dur) var(--ease),box-shadow var(--dur) var(--ease)}
a.card:hover{border-color:var(--accent-line);box-shadow:var(--shadow-2)}
a.card .ci{width:36px;height:36px;border-radius:var(--r-md);background:var(--surface-2);display:grid;place-items:center;flex:none;color:var(--text-muted)}
a.card .ci .i{width:18px;height:18px}
a.card .ct{flex:1;min-width:0}
a.card .ct b{display:block;font-size:15px;line-height:22px;font-weight:600}
a.card .ct span{display:block;font-size:13px;line-height:19px;color:var(--text-muted);margin-top:2px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
a.card .arr{color:var(--text-muted);flex:none}
a.card:hover .arr{color:var(--accent-ink)}
.prose a.card::after{content:none}

/* ---------- CTA в конце статьи ---------- */
.cta{position:relative;margin:48px 0 0;padding:24px 24px 24px;border-radius:var(--r-xl);background:var(--dark);color:var(--on-dark);overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px 24px;align-items:center}
.cta::before{content:"";position:absolute;inset:0;background:radial-gradient(520px 220px at 100% 0%,rgba(255,122,26,.20),transparent 70%);pointer-events:none}
.cta>*{position:relative}
.cta .eb{font-size:11px;line-height:14px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#ff9a4d}
.cta .h{margin:6px 0 0;font:700 26px/1.1 var(--font-head);text-transform:uppercase;letter-spacing:.01em}
.cta .h mark{background:var(--accent);color:#111;padding:0 6px;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.cta p{margin:8px 0 0;font-size:14px;line-height:21px;color:var(--on-dark-muted);max-width:460px}
.cta .stats{display:flex;flex-wrap:wrap;gap:6px 16px;margin:12px 0 0;padding:0;list-style:none;font-size:13px;color:#d6d6da}
.cta .stats b{color:#fff;font-weight:600}
.cta .btn-cta{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 20px;border-radius:var(--r-full);background:var(--accent);color:#111;font-weight:600;font-size:15px;text-decoration:none;white-space:nowrap;transition:transform var(--dur) var(--ease)}
.cta .btn-cta:hover{transform:translateY(-1px)}

/* ---------- Prev / Next ---------- */
.pager{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:40px 0 0}
.pager a{display:flex;flex-direction:column;gap:2px;padding:16px;border:1px solid var(--line);border-radius:var(--r-lg);text-decoration:none;min-height:72px;transition:border-color var(--dur) var(--ease),box-shadow var(--dur) var(--ease)}
.pager a:hover{border-color:var(--accent-line);box-shadow:var(--shadow-1)}
.pager a span{font-size:13px;line-height:18px;color:var(--text-muted)}
.pager a b{font-size:16px;line-height:24px;font-weight:500;color:var(--text)}
.pager a:hover b{color:var(--accent-ink)}
.pager .next{text-align:right;grid-column:2}
.updated{margin:24px 0 0;font-size:13px;line-height:18px;color:var(--text-muted)}

/* ---------- Подвал ---------- */
.foot{margin:48px 0 0;padding:24px 0 8px;border-top:1px solid var(--line);font-size:13px;line-height:20px;color:var(--text-muted)}
.foot-top{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:center;margin-bottom:12px}
.foot-top a{color:var(--text);text-decoration:none;font-weight:500}
.foot-top a:hover{color:var(--accent-ink)}
.foot p{margin:0 0 8px}
.foot b{color:var(--text);font-weight:600}

/* ---------- Карточки раздела / главная ---------- */
.group-list{margin-top:28px}

/* ---------- Поиск ⌘K ---------- */
.sdlg{position:fixed;inset:0;z-index:80;display:none;align-items:flex-start;justify-content:center;padding:10vh 16px 16px;background:rgba(10,10,12,.42);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.sdlg.open{display:flex}
.sbox{width:640px;max-width:100%;max-height:72vh;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-xl);box-shadow:var(--shadow-3);overflow:hidden}
.shead{display:flex;align-items:center;border-bottom:1px solid var(--line)}
.sfield{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:0 16px}
.sclose{display:none;flex:none;width:44px;height:44px;margin-right:6px}
.sclose .i{width:20px;height:20px}
.sfield .i{width:18px;height:18px;color:var(--text-muted)}
.sfield input{flex:1;height:56px;border:0;outline:0;background:none;color:var(--text);font:400 16px var(--font-sans)}
.sres{overflow-y:auto;padding:8px;list-style:none;margin:0}
.sres li a{display:block;padding:10px 12px;border-radius:var(--r-md);text-decoration:none}
.sres li a .st{display:block;font-size:15px;line-height:22px;font-weight:600;color:var(--text)}
.sres li a .sg{font-size:12px;line-height:16px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}
.sres li a .ss{display:block;font-size:13px;line-height:19px;color:var(--text-muted);margin-top:2px}
.sres mark{background:var(--accent-soft);color:var(--accent-ink);border-radius:3px;padding:0 1px}
.sres li a.sel,.sres li a:hover{background:var(--surface-3)}
.sempty{padding:24px 16px;text-align:center;color:var(--text-muted);font-size:14px}
.sfoot{display:flex;gap:16px;padding:10px 16px;border-top:1px solid var(--line);font-size:12px;color:var(--text-muted)}

.toast{position:fixed;left:50%;bottom:24px;z-index:90;transform:translate(-50%,20px);opacity:0;padding:10px 16px;border-radius:var(--r-md);background:var(--text);color:var(--bg);font-size:14px;font-weight:500;box-shadow:var(--shadow-2);pointer-events:none;transition:opacity var(--dur) var(--ease),transform var(--dur) var(--ease)}
.toast.show{opacity:1;transform:translate(-50%,0)}
.scrim{position:fixed;inset:0;z-index:45;background:rgba(10,10,12,.4);opacity:0;pointer-events:none;transition:opacity var(--dur) var(--ease)}
.scrim.on{opacity:1;pointer-events:auto}

/* ---------- Адаптив ---------- */
@media (max-width:1279px){
  .page{grid-template-columns:minmax(0,var(--main-w))}
  .toc{display:none}
  .toc-btn{display:inline-flex}
  .toc.drawer{display:block;position:fixed;top:auto;bottom:0;left:0;right:0;z-index:50;max-height:70vh;padding:20px 20px calc(20px + env(safe-area-inset-bottom));background:var(--surface);border-top-left-radius:var(--r-xl);border-top-right-radius:var(--r-xl);box-shadow:var(--shadow-3);transform:translateY(105%);visibility:hidden;transition:transform .25s var(--ease),visibility 0s .25s}
  .toc.drawer.open{transform:none;visibility:visible;transition:transform .25s var(--ease)}
}
@media (min-width:1280px){.toc-btn{display:none!important}}
@media (max-width:1023px){
  .hdr-in{padding:0 16px;gap:8px}
  .brand{width:auto}
  .burger,.search-ico{display:grid}
  .search-btn{display:none}
  .hdr-right .lang{display:none}
  .layout{display:block;padding:0 16px}
  .side{position:fixed;top:0;left:0;bottom:0;z-index:50;width:min(320px,86vw);height:100%;margin:0;border-radius:0 var(--r-xl) var(--r-xl) 0;transform:translateX(-102%);visibility:hidden;transition:transform .25s var(--ease),visibility 0s .25s}
  .side.open{transform:none;visibility:visible;box-shadow:var(--shadow-3);transition:transform .25s var(--ease)}
  .side-head{display:flex!important}
  .page{display:block}
  .main{padding:20px 0 40px}
}
.side-head{display:none;align-items:center;justify-content:space-between;gap:8px;padding:12px 12px 4px 20px}
.side-head .lang{display:flex}
@media (max-width:640px){
  h1.title{font-size:30px;line-height:37.5px}
  .lead{font-size:17px;line-height:27px}
  .prose h2{font-size:21px;line-height:29px;margin-top:32px}
  .prose h3{font-size:18px;line-height:26px}
  .prose :is(ul,ol){padding-left:24px}
  .cards.grid{grid-template-columns:1fr}
  .pager{grid-template-columns:1fr;gap:12px}
  .pager a{padding:12px 14px;min-height:0}
  .pager .next{grid-column:1}
  .cta{grid-template-columns:1fr;padding:20px}
  .cta .h{font-size:23px}
  .copy .label{display:none}
  .crumbs li:first-child{display:none}
  .crumbs li+li::before{content:none}
  .hint{padding:12px 14px 12px 42px}
  .hint>.hint-ic{left:14px;top:14px}
  .sdlg{padding:0}
  .sbox{max-height:100vh;height:100%;border-radius:0;border:0}
  .sclose{display:grid}
}
@media print{.hdr,.side,.toc,.tools,.cta,.pager,.foot,.hlink{display:none!important}.layout,.page{display:block}}
