/* Оформление справки (ноябрь 2026): родные стили Starlight не сохранились.
 * Шрифты, цвета и скругления — из дизайн-системы основного сайта (landing-site/src/styles/global.css),
 * шапка — как у блога (decap/src/components/layout/Navbar.astro). */
@font-face { font-family: "Inter"; src: url("/help/_astro/Inter-subset.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --accent: #5479F7; --accent-high: #2C58E8; --accent-low: #F0F3FF;
  --text: #101115; --muted: #707377; --faint: #9D9FA2; --line: #E7E8EB; --divider: #D2D4D8; --page: #F2F4F7; --bg: #fff;
  --font-display: "Manrope", system-ui, -apple-system, sans-serif; --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --side: 280px; --head: 72px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--head) + 16px); }
body { margin: 0; font: 16px/1.55 var(--font-body); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-high); text-decoration: underline; }
svg { width: 1em; height: 1em; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Убираем то, что без родных скриптов Starlight не работает */
starlight-rapide-theme-select, mobile-starlight-toc, .right-sidebar-container,
.mobile-preferences, .sl-anchor-link, .pagination-links, script, template { display: none !important; }
body > a[href="#_top"] { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: #fff; }
body > a[href="#_top"]:focus { top: 16px; }

/* Шапка — как у блога */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--head); display: flex; align-items: center; gap: 24px; padding: 0 24px;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px); -webkit-backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.site-header__logo { display: flex; align-items: center; flex-shrink: 0; }
.site-header__logo:hover { text-decoration: none; }
.site-header__nav { display: flex; align-items: center; gap: 30px; flex-shrink: 0; }
.site-header__link { font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color .15s; }
.site-header__link:hover { color: var(--text); text-decoration: none; }
.site-header__demo { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 12px 20px; border: 1px solid transparent; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; transition: background .15s, box-shadow .15s; }
.site-header__demo:hover { background: var(--accent-high); color: #fff; text-decoration: none; box-shadow: 0 10px 24px rgba(84, 121, 247, .25); }

.site-header__dd { position: relative; display: inline-flex; }
.site-header__dd-trigger { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; line-height: 1; cursor: pointer; }
.site-header__chev { transition: transform .18s ease; margin-top: 1px; }
.site-header__dd:hover .site-header__chev, .site-header__dd:focus-within .site-header__chev { transform: rotate(180deg); }
.site-header__dd-menu { position: absolute; top: 100%; left: 50%; z-index: 60; min-width: 210px; padding: 8px; display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 17, 21, .08);
  transform: translateX(-50%) translateY(4px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .16s ease, transform .16s ease, visibility .16s ease; }
.site-header__dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.site-header__dd:hover .site-header__dd-menu, .site-header__dd:focus-within .site-header__dd-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(8px); }
.site-header__dd-item { padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background .12s ease, color .12s ease; }
.site-header__dd-item:hover { background: var(--page); color: var(--text); text-decoration: none; }

.site-header__burger { display: none; flex-direction: column; justify-content: center; gap: 5px; flex-shrink: 0; width: 40px; height: 40px; margin-left: auto; padding: 0 9px; border: 0; background: transparent; cursor: pointer; }
.site-header__burger span { display: block; height: 2px; border-radius: 2px; background: var(--text); transition: transform .22s ease, opacity .18s ease; }
.site-header__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header__burger.is-open span:nth-child(2) { opacity: 0; }
.site-header__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Меню сайта столбиком: выпадающая панель на средней ширине и низ бокового меню на телефоне */
.site-header__mobile { display: none; position: fixed; top: calc(var(--head) + 8px); right: 16px; z-index: 55; width: 300px; max-height: calc(100vh - var(--head) - 24px); overflow-y: auto;
  padding: 8px 16px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 17, 21, .08); }
.site-mobile-nav { display: flex; flex-direction: column; }
.site-mobile-nav__link { padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 500; color: var(--text); }
.site-mobile-nav__link:hover { color: var(--accent); text-decoration: none; }
.site-mobile-nav__title { padding: 16px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #7A7D82; }
.site-mobile-nav__sub { font-size: 16px; color: var(--muted); }
.site-mobile-nav .site-header__demo { margin-top: 16px; }
.sidebar-site-nav { display: none; }
.sidebar-site-nav .site-mobile-nav__link { padding: 12px 8px; border-radius: 0; font-size: 16px; color: var(--text); }
.sidebar-site-nav .site-mobile-nav__sub { color: var(--muted); }
.sidebar-site-nav .site-header__demo { display: flex; padding: 12px 20px; border-radius: 12px; color: #fff; }

/* Поиск — поле ввода как в веб-WMS */
.site-search { flex: 1 1 auto; min-width: 200px; max-width: 480px; }
.site-search > button { display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--faint); font-size: 16px; text-align: left; cursor: pointer; transition: border-color .15s; }
.site-search > button:hover { border-color: var(--divider); }
.site-search > button > svg { width: 20px; height: 20px; }
.site-search > button > span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.site-search > button > kbd { display: flex; gap: 2px; }
.site-search kbd kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; font: 12px/1 var(--font-body); color: var(--faint); }
.site-search dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100% - 96px); margin: 72px auto auto; padding: 0; border: 0; border-radius: 16px;
  background: #fff; box-shadow: 0 24px 56px rgba(16, 17, 21, .14); }
.site-search dialog:not([open]) { display: none; }
.site-search dialog::backdrop { background: rgba(16, 17, 21, .42); backdrop-filter: blur(3px); }
.site-search .dialog-frame { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.site-search [data-close-modal] { display: none; align-self: flex-end; border: 0; background: none; color: var(--accent); cursor: pointer; }
[data-search-modal-open] { overflow: hidden; }
#starlight__search { --pagefind-ui-scale: .85; --pagefind-ui-primary: var(--accent); --pagefind-ui-text: var(--text); --pagefind-ui-border: var(--line); --pagefind-ui-border-width: 1.5px;
  --pagefind-ui-border-radius: 8px; --pagefind-ui-font: var(--font-body); }
#starlight__search .pagefind-ui__search-input { font-weight: 400; }
#starlight__search .pagefind-ui__result-link { color: var(--accent); }
#starlight__search .pagefind-ui__result-title { font-family: var(--font-display); }
#starlight__search mark { background: var(--accent-low); color: inherit; }

/* Боковое меню */
.sidebar-pane { position: fixed; top: var(--head); bottom: 0; left: 0; width: var(--side); overflow-y: auto; padding: 16px 12px 40px 20px; border-right: 1px solid var(--line); background: var(--bg); font-size: 14px; }
.sidebar-pane ul { list-style: none; margin: 0; padding: 0; }
.sidebar-pane ul ul { padding-left: 12px; border-left: 1px solid var(--line); margin: 4px 0 8px 4px; }
.sidebar-pane li { margin: 0; }
.sidebar-pane a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--text); }
.sidebar-pane a[aria-current="page"] { background: #eef2fe; color: var(--accent); font-weight: 600; }
.sidebar-pane summary { cursor: pointer; padding: 6px 8px; font-weight: 600; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.sidebar-pane summary::-webkit-details-marker { display: none; }
.sidebar-pane .caret { transition: transform .15s; }
.sidebar-pane details[open] > summary .caret { transform: rotate(90deg); }
.sidebar-pane .large { font-size: 15px; }

/* Контент — типографика основного сайта */
.main-frame { padding-top: var(--head); padding-left: var(--side); }
.content-panel { padding: 40px 48px 0; }
.content-panel + .content-panel { padding-top: 24px; padding-bottom: 48px; }
.sl-container { max-width: 760px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); }
h1 { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.sl-markdown-content { font-size: 16px; line-height: 1.65; }
.sl-markdown-content > :first-child { margin-top: 0; }
.sl-markdown-content p, .sl-markdown-content ul, .sl-markdown-content ol { margin: 0 0 16px; }
.sl-markdown-content li { margin: 4px 0; }
.sl-markdown-content h2 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: 40px 0 14px; }
.sl-markdown-content h3 { font-size: 22px; line-height: 1.25; font-weight: 700; margin: 32px 0 12px; }
.sl-markdown-content h4 { font-size: 18px; line-height: 1.3; font-weight: 600; margin: 24px 0 10px; }
.sl-markdown-content strong { font-weight: 600; }
.sl-markdown-content img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }
.sl-markdown-content table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 15px; }
.sl-markdown-content th, .sl-markdown-content td { border: 1px solid #d7dee8; padding: 10px 12px; text-align: left; vertical-align: top; }
.sl-markdown-content th { background: #f6f8fb; font-weight: 600; }
.sl-markdown-content code { background: var(--page); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.sl-markdown-content pre { background: var(--page); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.sl-markdown-content pre code { padding: 0; background: none; }
.sl-markdown-content blockquote { margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--accent-low); border-radius: 0 12px 12px 0; }
.sl-markdown-content h2 a, .sl-markdown-content h3 a { color: inherit; }
.section-overview-link { display: inline-block; margin: 4px 0; }
footer { color: var(--muted); font-size: 14px; }

/* Выноски и раскрывающиеся блоки */
.starlight-aside { --aside: var(--accent); --aside-bg: #EAF1FB; margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--aside); background: var(--aside-bg); border-radius: 0 12px 12px 0; }
.starlight-aside--tip { --aside: #287037; --aside-bg: #E6F8EA; }
.starlight-aside--caution { --aside: #854F0B; --aside-bg: #FFEDD6; }
.starlight-aside--danger { --aside: #7A140D; --aside-bg: #FFEAE9; }
.starlight-aside__title { margin: 0 0 4px !important; font-weight: 600; color: var(--aside); }
.starlight-aside__content > :first-child { margin-top: 0; }
.starlight-aside__content > :last-child { margin-bottom: 0; }
.sl-markdown-content details { margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.sl-markdown-content details[open] { padding-bottom: 8px; }
.sl-markdown-content summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.sl-markdown-content li > p { margin: 4px 0; }

/* Оглавление справа — как «Содержание» в блоге */
.help-toc { font-size: 14px; }
.help-toc h2 { margin: 0 0 10px; font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.help-toc ul { list-style: none; margin: 0; padding: 0; }
.help-toc li { padding-left: calc(var(--depth) * 12px); }
.help-toc a { display: block; padding: 4px 0; color: var(--muted); }
.help-toc a:hover { color: var(--accent); text-decoration: none; }
@media (min-width: 1280px) {
  .right-sidebar-container { display: block !important; position: fixed; top: var(--head); right: 0; bottom: 0; width: 260px; overflow-y: auto; padding: 40px 24px; border-left: 1px solid var(--line); background: var(--bg); }
  .main-frame { padding-right: 260px; }
}

/* Средняя ширина: меню сайта уходит под кнопку */
@media (max-width: 1239px) {
  .site-header__nav { display: none; }
  .site-header__burger { display: flex; margin-left: 0; }
  [data-mobile-menu-expanded] .site-header__mobile { display: block; }
}

/* Телефон: кнопка открывает разделы справки поверх страницы, внизу — меню сайта */
@media (max-width: 900px) {
  :root { --head: 64px; }
  .site-header { gap: 12px; padding: 0 16px; }
  .site-header > .site-header__demo { display: none; }
  .site-search { flex: 0 0 auto; min-width: 0; margin-left: auto; }
  .site-search > button { width: 40px; padding: 0; justify-content: center; color: var(--text); }
  .site-search > button > span, .site-search > button > kbd { display: none !important; }
  .site-search dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; border-radius: 0; }
  .site-search [data-close-modal] { display: block; }
  [data-mobile-menu-expanded] .site-header__mobile { display: none; }
  .sidebar-pane { display: none; }
  .sidebar-site-nav { display: block; margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
  [data-mobile-menu-expanded] .sidebar-pane { display: block; width: 100%; z-index: 20; border-right: 0; }
  [data-mobile-menu-expanded] { overflow: hidden; }
  .main-frame { padding-left: 0; }
  .content-panel { padding: 24px 16px 0; }
  .content-panel + .content-panel { padding: 16px 16px 40px; }
  h1 { font-size: 30px; }
  .sl-markdown-content h2 { font-size: 24px; }
  .sl-markdown-content h3 { font-size: 20px; }
}
