/* Тот же терминальный вид, что у сайта RTS-NG: тёмный фон, моноширинный шрифт, фосфор. */
:root {
  --bg: #090c0a;
  --bg2: #0d120f;
  --panel: #0f1512;
  --line: #1d3125;
  --line2: #2a4535;
  --fg: #cfe6d4;
  --dim: #6f8a76;
  --green: #4ef08f;
  --green-d: #1f6b3f;
  --amber: #ffc266;
  --red: #ff6f6f;
  --cyan: #74d2ff;
  --sel: #173a26;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --glow: 0 0 12px rgba(78, 240, 143, .28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  font: 15px/1.65 var(--mono);
  background:
    radial-gradient(1200px 520px at 50% -160px, rgba(78, 240, 143, .09), transparent 70%),
    radial-gradient(900px 600px at 100% 0, rgba(116, 210, 255, .04), transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(78, 240, 143, .07) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 75%);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background:
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, .35) 100%),
    repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .07) 2px 3px);
}
::selection { background: var(--green-d); color: #fff; }
a { color: var(--cyan); text-decoration: none; transition: color .15s, text-shadow .15s; }
a:hover { text-decoration: underline; text-decoration-color: rgba(116, 210, 255, .45); text-underline-offset: 3px; }
h1, h2, h3 { font-size: inherit; margin: 0 0 .6em; font-weight: 700; line-height: 1.35; }
p { margin: 0 0 .9em; }
code, kbd { font-family: var(--mono); color: var(--amber); }
hr { border: 0; border-top: 1px dashed var(--line2); margin: 18px 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; position: relative; z-index: 1; padding-top: 8px; padding-bottom: 48px; }
.prose p { max-width: none; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: rgba(13, 18, 15, .82);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  backdrop-filter: blur(8px) saturate(1.2);
}
header.top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green-d) 18%, var(--green) 50%, var(--green-d) 82%, transparent);
  opacity: .7;
}
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding: 10px 16px; }
.logo { color: var(--fg); white-space: nowrap; text-shadow: 0 0 10px rgba(78, 240, 143, .25); }
.logo:hover { text-decoration: none; }
.logo .u { color: var(--green); }
.logo .p { color: var(--cyan); }
nav.cmds { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
nav.cmds a, .linkbtn { color: var(--fg); transition: color .15s, text-shadow .15s; }
nav.cmds a::before, .linkbtn::before { content: "["; color: var(--dim); margin-right: 2px; }
nav.cmds a::after, .linkbtn::after { content: "]"; color: var(--dim); margin-left: 2px; }
nav.cmds a.on { color: var(--amber); text-shadow: 0 0 10px rgba(255, 194, 102, .35); }
nav.cmds a:hover, .linkbtn:hover { color: var(--green); text-decoration: none; text-shadow: var(--glow); }
.linkbtn { font: inherit; font-family: var(--mono); background: none; border: 0; padding: 0; cursor: pointer; }
.linkbtn.danger, .linkbtn.danger:hover { color: var(--red); }
form.inline { display: inline; margin: 0; }

footer.foot { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 16px 0 26px; font-size: .9em; }
footer.foot .legal { margin: 0; }

.cmd { display: flex; align-items: baseline; gap: 0 .6ch; flex-wrap: wrap; color: var(--dim); margin: 28px 0 12px; font-size: 1.02em; }
.cmd::before { content: "$ "; color: var(--green); text-shadow: var(--glow); }
.cmd b { color: var(--fg); font-weight: 700; }
.cmd::after {
  content: "";
  flex: 1 1 40px;
  align-self: center;
  height: 1px;
  min-width: 40px;
  background: linear-gradient(90deg, var(--line2), transparent);
}
h1.cmd { font-size: 1.02em; font-weight: 400; margin: 0; }
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-top: 18px; }
.headrow .cmd { flex: 1 1 240px; margin: 0; }
.dim { color: var(--dim); }
.mt { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

pre.banner {
  margin: 18px 0 8px;
  font-size: 13px;
  line-height: 1.15;
  background: linear-gradient(180deg, #8dffbf, var(--green) 55%, #2fb86a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(78, 240, 143, .35));
}
.cursor {
  display: inline-block;
  width: .62em;
  height: 1.05em;
  margin-left: .35em;
  background: var(--green);
  vertical-align: text-bottom;
  box-shadow: var(--glow);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
ul.ls { list-style: none; padding: 0; margin: 0 0 1em; }
ul.ls li { position: relative; padding: 3px 0 3px 1.6em; }
ul.ls li::before { content: ">"; position: absolute; left: .2em; color: var(--green); }

.btn {
  display: inline-block;
  font: inherit;
  font-family: var(--mono);
  color: var(--green);
  background: transparent;
  border: 1px solid var(--green);
  font-size: .92em;
  padding: 8px 16px;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s, transform .08s;
}
.btn:hover, .btn:focus-visible { background: var(--green); color: var(--bg); text-decoration: none; outline: none; box-shadow: 0 0 14px rgba(78, 240, 143, .45); }
.btn.amber { color: var(--amber); border-color: var(--amber); }
.btn.amber:hover, .btn.amber:focus-visible { background: var(--amber); color: var(--bg); box-shadow: 0 0 14px rgba(255, 194, 102, .45); }
.btn.red { color: var(--red); border-color: var(--red); }
.btn.red:hover, .btn.red:focus-visible { background: var(--red); color: var(--bg); box-shadow: 0 0 14px rgba(255, 111, 111, .4); }
.btn.sm { padding: 5px 10px; font-size: .84em; }
.btn:active { transform: translateY(1px); }
.btn.icon { display: inline-flex; align-items: center; gap: 6px; }
.btn.icon svg { display: block; flex: none; }

form.stack { display: grid; gap: 16px; max-width: 440px; }
form.stack.grow { max-width: 720px; }
form.reject { margin-top: 28px; }
label { display: grid; gap: 6px; color: var(--dim); font-size: .94em; }
label.check { display: flex; gap: 10px; align-items: center; color: var(--fg); }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=search], input[type=datetime-local], textarea, select {
  font: inherit;
  color: var(--fg);
  background: #070a08;
  border: 1px solid var(--line2);
  padding: 9px 11px;
  width: 100%;
  border-radius: 0;
  color-scheme: dark;
}
input[type=search] {
  -webkit-appearance: none;
  appearance: none;
}
input[type=search]::-webkit-search-decoration,
input[type=search]::-webkit-search-cancel-button,
input[type=search]::-webkit-search-results-button { -webkit-appearance: none; appearance: none; }
textarea { min-height: 11em; resize: vertical; }
input.short { max-width: 8em; }
input[type=file] { font: inherit; color: var(--dim); max-width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green-d); }
input[type=checkbox] { accent-color: var(--green); width: 16px; height: 16px; }
fieldset { margin: 0; padding: 12px 12px 14px; border: 1px solid var(--line2); min-width: 0; }
fieldset > legend { padding: 0 6px; color: var(--amber); }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: end; }
.field-row > label { flex: 1 1 160px; }
.link-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.hp { position: absolute !important; left: -10000px !important; top: auto !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.captcha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.captcha img { border: 1px solid var(--line2); background: #070a08; }
.review { margin: 0 0 16px; }
.review-form { margin-top: 18px; }
.sheet-page > h2 { color: var(--amber); font-size: 1.05em; margin: 1.2em 0 .4em; }
.queue-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 8px; }
.versions-title { margin: 22px 0 8px; color: var(--amber); font-size: 1em; }
.version-form { margin-top: 14px; }
.version-form textarea { min-height: 6em; }

.flash { margin: 18px 0 0; padding: 10px 14px; border-left: 3px solid var(--green); background: #0d1a12; color: var(--fg); box-shadow: -6px 0 18px -10px var(--green); }
.flash.warn { border-color: var(--amber); background: #1a160d; box-shadow: -6px 0 18px -10px var(--amber); }
.flash.err { border-color: var(--red); background: #1a0f0f; box-shadow: -6px 0 18px -10px var(--red); }
.flash::before { content: "# "; color: var(--dim); }

section.block { scroll-margin-top: 72px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 4px; }
.pager .here,
.pager .here:hover { background: var(--amber); color: var(--bg); border-color: var(--amber); box-shadow: none; cursor: default; }
.item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px 28px; margin-bottom: 8px; }
.item-main { flex: 1; min-width: 0; }
.sheet-page .ico,
.sheet-page .ico img,
.sheet-page .ico .ph { width: 64px; height: 64px; flex: none; }
.sheet-page .item-main .row { align-items: flex-start; flex-wrap: nowrap; }
.sheet-page .item-main .row > div {
  flex: 1;
  min-width: 0;
}
.sheet-page .item-main h1,
.sheet-page .summary,
.sheet-page .item-main .dim {
  margin: 0;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
}
.item-main h1 { margin-bottom: .3em; }
.summary { margin: 0 0 .35em; }
.item-side { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-left: auto; }
.item-side .links { justify-content: flex-end; }
label[hidden] { display: none !important; }
.acts-in { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.rate { display: inline-flex; align-items: center; gap: 4px; }
.rate .score { min-width: 1.6em; text-align: center; color: var(--amber); }
.ico.ph {
  color: var(--green);
  align-items: center;
  justify-content: center;
  background: #070a08;
  border: 1px solid var(--line2);
}
.ico.ph svg { width: 18px; height: 18px; }
.ico.ph.lg svg { width: 32px; height: 32px; }
.sec-ico { width: 36px; height: 36px; object-fit: cover; border: 1px solid var(--line2); margin-left: 8px; flex: none; }
h1.cmd { align-items: center; }
.ai {
  display: inline-block;
  position: relative;
  margin-left: 8px;
  padding: 0 6px;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: .75em;
  vertical-align: 1px;
  cursor: help;
}
.ai-tip {
  display: none;
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  background: #0d120f;
  border: 1px solid var(--line2);
  color: var(--fg);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.ai:hover .ai-tip, .ai:focus .ai-tip { display: block; }
.search { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 28px 0 8px; }
.search label { flex: 1 1 280px; }
.search input[type=search],
.search .btn {
  height: 40px;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 38px;
}
.search .btn { padding-left: 16px; padding-right: 16px; font-size: inherit; }
.wrap.wide { max-width: 1680px; }
.guide { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 32px; align-items: start; }
.toc-side { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; border: 1px solid var(--line2); background: var(--panel); padding: 10px 6px 12px; }
.toc > summary { color: var(--amber); padding: 0 6px 6px; list-style: none; pointer-events: none; }
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::before { content: "$ tree "; color: var(--green); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin: 0 0 4px 1.1ch; padding-left: 1.2ch; border-left: 1px dashed var(--line2); }
.tree a { display: block; color: var(--fg); padding: 1px 6px; border-left: 2px solid transparent; line-height: 1.45; }
.tree a:hover { text-decoration: none; color: var(--cyan); }
.tree ul a { color: var(--dim); font-size: .92em; }
.tree a.on { color: var(--green); border-left-color: var(--green); background: #0d1a12; text-decoration: none; }
.tree a.folder { color: var(--amber); }
.tree a.folder.on { color: var(--green); }
.guide-body { min-width: 0; }
.guide-body .md { max-width: none; }
.guide-body h1 { color: var(--green); font-size: 1.25em; }
.toc-search { padding: 0 6px 8px; }
.toc-search input { width: 100%; }
.toc-empty { margin: 0; padding: 0 8px 8px; }
.toc-add { margin: 10px 6px 0; }
ul.tree { list-style: none; margin: 0 0 .4em; padding-left: 1.2em; }
ul.tree ul { margin-top: .2em; }
.versions { margin: 0 0 1em; padding-left: 1.2em; }
.versions li { margin: 0 0 1em; }
.table-wrap { overflow-x: auto; margin: 8px 0 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
th { color: var(--dim); font-weight: 400; font-size: .88em; white-space: nowrap; border-bottom: 1px solid var(--line2); }
td.n { text-align: right; white-space: nowrap; }
td.nw { white-space: nowrap; }
th.mark, td.mark { width: 1%; white-space: nowrap; padding-right: 4px; }
td.name { min-width: 10em; padding-left: 4px; }
td.desc { min-width: 14em; max-width: 34em; }
tr:hover td { background: rgba(78, 240, 143, .03); }
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.ico, .ico img, .ico .ph { width: 36px; height: 36px; }
.ico { display: inline-flex; vertical-align: middle; }
.ico img, .ico .ph {
  object-fit: cover;
  background: #070a08;
  border: 1px solid var(--line2);
}
.ico .ph { display: inline-flex; align-items: center; justify-content: center; color: var(--green); }

.box {
  position: relative;
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(20, 29, 24, .92), rgba(13, 18, 15, .92));
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  margin: 22px 0 8px;
  padding: 22px 20px 16px;
}
.box > .t {
  position: absolute;
  top: -.85em;
  left: 12px;
  padding: 1px 10px;
  border: 1px solid var(--line2);
  background: var(--bg2);
  color: var(--amber);
}
article h1, .sheet-page h1, dialog h2, .box h2 { color: var(--green); font-size: 1.25em; }

.md { max-width: 90ch; }
.md h1, .md h2 { color: var(--green); margin: 1em 0 .4em; }
.md h1 { font-size: 1.25em; }
.md h2 { font-size: 1.08em; }
.md h3 { color: var(--amber); margin: .9em 0 .35em; }
.md p { margin: 0 0 .8em; }
.md ul, .md ol { margin: 0 0 .8em; padding-left: 1.4em; }
.md li { margin: .15em 0; }
.codebox { position: relative; margin: 0 0 .9em; }
.codebox pre { margin: 0; padding: 12px 48px 12px 14px; background: #060907; border: 1px solid var(--line); overflow-x: auto; }
.codebox .copy {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  line-height: 0;
}
.codebox .copy:hover, .codebox .copy:focus-visible { color: #8dffbf; outline: none; }
.codebox .copy.ok { color: var(--amber); }
.codewrap { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.codewrap .copy {
  border: 0;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0 2px;
}
.codewrap .copy::before { content: "⧉"; }
.codewrap .copy.ok { color: var(--green); border-color: var(--green); }
.md code { color: var(--amber); }
.md pre code { color: var(--fg); }
.md blockquote { margin: 0 0 .9em; padding: 2px 0 2px 12px; border-left: 3px solid var(--green-d); color: var(--dim); }
.md hr { margin: 16px 0; }
.md img { max-width: 100%; height: auto; border: 1px solid var(--line2); }
.md a { color: var(--cyan); }

dialog {
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line2);
  padding: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
dialog:not([open]) { display: none; }
dialog::backdrop { background: rgba(0, 0, 0, .78); }
dialog.read {
  width: 80vw;
  height: 80vh;
  max-width: none;
  max-height: none;
  overflow: hidden;
}
dialog.sheet {
  width: min(880px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}
dialog .dialog-in { padding: 8px 26px 28px; }
dialog.read .dialog-in { height: 100%; overflow: auto; box-sizing: border-box; }
dialog .stack.grow { max-width: none; }
.modal-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 0 12px;
  background: var(--bg);
}
.modal-bar h2 { margin: 0; }
.meta:empty { display: none; }

@media (max-width: 720px) {
  pre.banner { font-size: 8px; }
  .bar { padding: 10px 0; }
  dialog.read { width: 100vw; height: 100vh; }
  dialog .dialog-in { padding-left: 16px; padding-right: 16px; }
  .guide { grid-template-columns: 1fr; gap: 12px; }
  .toc-side { position: static; max-height: none; }
  .toc > summary { pointer-events: auto; cursor: pointer; }
  .toc > summary::after { content: " [+]"; color: var(--dim); }
  .toc[open] > summary::after { content: " [-]"; }
  .item-top { flex-direction: column; }
  .item-side { margin-left: 0; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor, pre.banner { animation: none; }
  .btn, a, .linkbtn { transition: none; }
}
