/* Документация SCARRYSOFT (общие стили): палитра и характер сайта scarp.cc */
:root {
  --bg: #0a0a0a; --surface: #111; --surface-2: #161616; --line: #1e1e1e; --line-2: #2a2a2a;
  --text: #d4d4d4; --strong: #f5f5f5; --muted: #a3a3a3; --dim: #737373; --white: #fff; --black: #000;
  --ok: #4ade80; --warn: #fbbf24; --err: #f87171;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --top: 56px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 20px); }
html { overflow-x: hidden; }
/* Тонкий тёмный скроллбар везде, включая основной справа */
* { scrollbar-width: thin; scrollbar-color: #2e2e2e transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
a { color: var(--strong); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #444; }
a:hover { text-decoration-color: var(--strong); }
h1, h2, h3, h4 { color: var(--strong); margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 5px 0; }
code { font-family: var(--mono); font-size: .88em; background: #1a1a1a; border: 1px solid var(--line-2); border-radius: 3px; padding: 1px 5px; color: var(--strong); }
pre { margin: 10px 0 16px; padding: 14px 16px; background: #0e0e0e; border: 1px solid var(--line-2); border-radius: 6px; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.6; white-space: pre; }
kbd { font-family: var(--mono); font-size: .8em; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 3px; background: #161616; color: var(--muted); }
mark { background: rgba(251, 191, 36, .25); color: var(--strong); padding: 0 1px; border-radius: 2px; }
table { width: 100%; border-collapse: collapse; margin: 10px 0 18px; font-size: 14.5px; }
.doc { min-width: 0; }
code { overflow-wrap: anywhere; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
td:first-child { white-space: nowrap; }

/* шапка */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); background: rgba(10,10,10,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1320px; margin: 0 auto; height: 100%; display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: center; gap: 0; padding: 0 20px; }
.top-left { display: flex; align-items: center; gap: 8px; min-width: 0; padding-right: 14px; }
.mark svg { width: 14px; height: 14px; }
.mark { flex: none; width: 26px; height: 26px; border-radius: 4px; background: var(--white); color: var(--black); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.top-title { font-weight: 600; letter-spacing: .04em; color: var(--strong); font-size: 13px; white-space: nowrap; }
.top-ver { color: var(--dim); font-size: 13px; }
.search-trigger { width: 100%; max-width: 900px; margin: 0; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px; color: var(--dim); font: inherit; font-size: 13px; cursor: text; text-align: left; }
.search-trigger:hover { border-color: #444; color: var(--muted); }
.search-trigger svg { width: 15px; height: 15px; flex: none; }
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav-toggle { display: none; justify-self: end; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 4px; background: transparent; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav-toggle span { width: 16px; height: 1.5px; background: var(--text); display: block; }

/* сетка */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 24px 12px 40px 20px; border-right: 1px solid var(--line); }
.side::-webkit-scrollbar { width: 4px; }
.side::-webkit-scrollbar-thumb { background: #262626; border-radius: 2px; }
.side-group { margin-bottom: 18px; }
.side-group h4 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: 0 0 6px 10px; }
.side a { display: block; padding: 6px 10px 6px 12px; border-radius: 4px; color: var(--muted); text-decoration: none; font-size: 14px; position: relative; transition: color .2s ease, background .2s ease, padding-left .2s ease; }
.side a::before { content: ""; position: absolute; left: 0; top: 50%; width: 2px; height: 0; background: var(--white); border-radius: 1px; transform: translateY(-50%); transition: height .25s ease; }
.side a.active::before { height: 60%; }
.side a.active { padding-left: 16px; }
.side a:hover { color: var(--strong); background: var(--surface); }
.side a.active { color: var(--strong); background: var(--surface-2); }
.doc { padding: 36px 48px 96px; max-width: 900px; }
section { margin-bottom: 56px; scroll-margin-top: calc(var(--top) + 20px); }
section h2 { font-size: 26px; margin: 0 0 14px; padding-top: 8px; }
section h3 { font-size: 17px; margin: 26px 0 8px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
h1 { font-size: 40px; letter-spacing: .04em; margin-bottom: 12px; }
.lead { font-size: 18px; color: var(--muted); max-width: 62ch; margin-bottom: 28px; }
.flash { animation: flash 1.6s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 100% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } }

.steps { list-style: none; padding: 0; counter-reset: s; margin: 6px 0 16px; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin: 10px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 4px; background: var(--white); color: var(--black); font-weight: 600; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.steps li b { color: var(--strong); }
.note { margin: 14px 0 18px; padding: 12px 16px; background: #0e0e0e; border-left: 2px solid var(--strong); color: var(--muted); font-size: 14.5px; }
.note b { color: var(--strong); }
.note.warn { border-left-color: var(--warn); }
.req { display: grid; gap: 10px; }
.req-item { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.req-item b { display: block; color: var(--strong); margin-bottom: 2px; }
.req-item span { color: var(--muted); font-size: 14.5px; }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 12px 0; font-weight: 500; color: var(--strong); list-style: none; user-select: none; position: relative; padding-right: 30px; transition: color .2s ease; }
summary:hover { color: var(--white); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 10px; color: var(--dim); font-size: 20px; transition: transform .3s ease, color .2s ease; }
details[open] summary::after { transform: rotate(45deg); color: var(--strong); }
.acc-body { overflow: hidden; height: 0; transition: height .35s cubic-bezier(.4, 0, .2, 1); }
details[open] .acc-body { height: auto; }
.acc-body > * { opacity: 0; transform: translateY(-4px); transition: opacity .3s ease .08s, transform .3s ease .08s; }
details[open] .acc-body > * { opacity: 1; transform: none; }
details p { color: var(--muted); padding-bottom: 12px; margin: 0; }

/* справочник ошибок */
.err-tools { position: sticky; top: var(--top); z-index: 5; background: var(--bg); padding: 10px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.err-search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px; }
.err-search:focus-within { border-color: #555; }
.err-search svg { width: 16px; height: 16px; color: var(--dim); flex: none; }
.err-search input { flex: 1; background: none; border: 0; outline: 0; color: var(--strong); font: inherit; font-size: 15px; }
.err-search input::placeholder { color: var(--dim); }
.err-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font: inherit; font-size: 12.5px; padding: 5px 10px; border-radius: 3px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease; }
.chip:active { transform: scale(.96); }
.chip:hover { color: var(--strong); border-color: #444; }
.chip.on { background: var(--white); color: var(--black); border-color: var(--white); }
.err-count { margin-top: 8px; font-size: 12.5px; color: var(--dim); }
.err-list { display: flex; flex-direction: column; gap: 10px; }
.err { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; scroll-margin-top: calc(var(--top) + 150px); animation: rise .38s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 28ms); transition: border-color .2s ease; }
.err:hover { border-color: #333; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.err-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.err-cat { flex: none; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line-2); border-radius: 3px; padding: 3px 7px; margin-top: 3px; }
.err-msg { flex: 1; min-width: 200px; white-space: pre-wrap; word-break: break-word; background: #0d0d0d; font-size: 13px; padding: 6px 10px; color: var(--strong); }
.err-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.err-label { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.err-body p { margin: 0; font-size: 14.5px; color: var(--text); }

/* поиск */
.search-overlay { position: fixed; inset: 0; z-index: 100; animation: fade .15s ease; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; }
.search-box { animation: pop .2s cubic-bezier(.2,.8,.2,1);
  width: min(720px, 100%); background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 30px 80px rgba(0,0,0,.7); overflow: hidden; }
.search-row { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 54px; border-bottom: 1px solid var(--line); }
.search-row svg { width: 18px; height: 18px; color: var(--dim); flex: none; }
.search-row input { flex: 1; background: none; border: 0; outline: 0; color: var(--strong); font: inherit; font-size: 16px; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.result { display: block; padding: 10px 12px; border-radius: 4px; text-decoration: none; cursor: pointer; }
.result.sel { background: var(--surface-2); }
.r-crumb { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.r-title { color: var(--strong); font-weight: 500; margin: 2px 0; }
.r-title.mono { font-family: var(--mono); font-size: 13px; font-weight: 400; }
.r-snip { font-size: 13px; color: var(--muted); }
.empty { padding: 20px 12px; color: var(--dim); font-size: 14px; }
.search-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

@media (max-width: 980px) {
  .top-inner { grid-template-columns: 1fr auto auto; gap: 10px; }
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: var(--top); width: 280px; height: calc(100vh - var(--top)); background: var(--bg); transform: translateX(-100%); transition: transform .2s; z-index: 20; border-right: 1px solid var(--line-2); }
  .side.open { transform: none; }
  .nav-toggle { display: flex; }
  .search-trigger span { display: none; }
  .search-trigger { flex: none; width: 38px; justify-content: center; padding: 0; }
  .search-trigger kbd { display: none; }
  .doc { padding: 24px 18px 80px; }
  h1 { font-size: 30px; }
  .err-body { grid-template-columns: 1fr; }
  td:first-child { white-space: normal; }
  .top-ver { display: none; }
  table { display: block; overflow-x: auto; }
  .top-title { overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
}

/* ---------- Changelog ---------- */
.top-inner-cl { grid-template-columns: auto minmax(0, 1fr); }
.top-link { justify-self: end; font-size: 13px; color: var(--muted); text-decoration: none; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 4px; transition: color .2s ease, border-color .2s ease; }
.top-link:hover { color: var(--strong); border-color: #444; }
.cl { max-width: 860px; margin: 0 auto; padding: 36px 24px 96px; }
.cl .lead { margin-top: 12px; }
.cl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 18px 0 34px; font-size: 13px; color: var(--dim); }
.cl-legend .tag { margin: 0 2px 0 6px; }
.cl-legend .tag:first-child { margin-left: 0; }
.cl-ver { position: relative; padding: 0 0 30px 26px; border-left: 1px solid var(--line-2); }
.cl-ver::before { content: ""; position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid #555; }
.cl-ver:first-of-type::before { background: var(--white); border-color: var(--white); }
.cl-ver:last-of-type { padding-bottom: 8px; }
.cl-ver header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.cl-ver h2 { font-size: 22px; margin: 0; }
.cl-date { color: var(--dim); font-size: 13px; }
.cl-ver ul { list-style: none; margin: 0; padding: 0; }
.cl-ver li { position: relative; padding: 9px 0 9px 0; border-bottom: 1px solid var(--line); color: var(--text); line-height: 1.55; }
.cl-ver li:last-child { border-bottom: 0; }
.cl-ver li .tag { margin-right: 10px; }
.tag { display: inline-block; vertical-align: middle; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; line-height: 1; text-transform: uppercase; padding: 4px 7px; border-radius: 3px; border: 1px solid; position: relative; top: -1px; white-space: nowrap; font-family: var(--mono); }
.tag-new { color: #4ade80; border-color: rgba(74, 222, 128, .45); background: rgba(74, 222, 128, .12); }
.tag-fix { color: #a3a3a3; border-color: rgba(163, 163, 163, .4); background: rgba(163, 163, 163, .1); }
.tag-chg { color: #60a5fa; border-color: rgba(96, 165, 250, .45); background: rgba(96, 165, 250, .12); }
.tag-rm { color: #ef4444; border-color: rgba(220, 38, 38, .45); background: rgba(220, 38, 38, .14); }
.tag-beta { color: #fbbf24; border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .12); }
.side a:has(.tag) { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.side a .tag { font-size: 9px; padding: 3px 5px; margin-left: auto; top: 0; }
.side a .tag + .tag { margin-left: 0; }
.tag-latest { color: var(--black); background: var(--white); border-color: var(--white); }
.cl-foot { margin-top: 30px; color: var(--muted); font-size: 14px; }
@media (max-width: 980px) {
  .top-inner-cl { grid-template-columns: 1fr auto; }
  .cl { padding: 24px 16px 64px; }
  .cl-ver { padding-left: 18px; }
}
