/* go-bpm-site: один файл стилей на все страницы. Цвета - токены на :root, тёмная тема - системная или выбранная. */

:root {
  --bg: #fbfbf9;
  --bg-alt: #f2f3ef;
  --surface: #ffffff;
  --ink: #15212b;
  --ink-2: #44515c;
  --ink-3: #6b7680;
  --line: #e1e3dd;
  --line-2: #cfd3cb;
  --accent: #0b7896;
  --accent-ink: #ffffff;
  --accent-soft: #e2f2f6;
  --token: #e0912f;
  --ok: #2f8a4c;
  --ok-soft: #e3f3e7;
  --warn: #a8650b;
  --warn-soft: #fbefd9;
  --bad: #c0392b;
  --bad-soft: #fbe5e2;
  --code-bg: #f4f5f1;
  --code-ink: #24303a;
  --tok-keyword: #a3236e;
  --tok-string: #2f7d32;
  --tok-number: #b35c00;
  --tok-comment: #7b858d;
  --tok-func: #0b6a8a;
  --tok-builtin: #6a3fb3;
  --tok-tag: #0b6a8a;
  --tok-attr: #a3236e;
  --shadow: 0 1px 2px rgb(20 30 40 / 6%), 0 8px 24px rgb(20 30 40 / 6%);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --topbar: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1519;
    --bg-alt: #131b20;
    --surface: #172127;
    --ink: #e6ebee;
    --ink-2: #b4bfc6;
    --ink-3: #8794a0;
    --line: #26323a;
    --line-2: #34424b;
    --accent: #4cc3e0;
    --accent-ink: #06222b;
    --accent-soft: #11313a;
    --token: #f0a84e;
    --ok: #5cc77d;
    --ok-soft: #143222;
    --warn: #f0b259;
    --warn-soft: #3a2a12;
    --bad: #f07a6c;
    --bad-soft: #3d1c19;
    --code-bg: #121a1f;
    --code-ink: #d7dee3;
    --tok-keyword: #f28fc4;
    --tok-string: #8fd694;
    --tok-number: #f5b26b;
    --tok-comment: #74828c;
    --tok-func: #79d0ea;
    --tok-builtin: #c3a6f7;
    --tok-tag: #79d0ea;
    --tok-attr: #f28fc4;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1519;
  --bg-alt: #131b20;
  --surface: #172127;
  --ink: #e6ebee;
  --ink-2: #b4bfc6;
  --ink-3: #8794a0;
  --line: #26323a;
  --line-2: #34424b;
  --accent: #4cc3e0;
  --accent-ink: #06222b;
  --accent-soft: #11313a;
  --token: #f0a84e;
  --ok: #5cc77d;
  --ok-soft: #143222;
  --warn: #f0b259;
  --warn-soft: #3a2a12;
  --bad: #f07a6c;
  --bad-soft: #3d1c19;
  --code-bg: #121a1f;
  --code-ink: #d7dee3;
  --tok-keyword: #f28fc4;
  --tok-string: #8fd694;
  --tok-number: #f5b26b;
  --tok-comment: #74828c;
  --tok-func: #79d0ea;
  --tok-builtin: #c3a6f7;
  --tok-tag: #79d0ea;
  --tok-attr: #f28fc4;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--topbar) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

code, kbd, pre { font-family: var(--mono); font-size: 0.875em; }

img { max-width: 100%; height: auto; }

/* hidden сильнее любых display из классов: иначе скрытые картинки галереи и блоки демо остаются видны */
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.muted { color: var(--ink-2); }
.center { text-align: center; }

/* --- шапка ------------------------------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.brand-mark circle { fill: var(--token); stroke: var(--token); }

.mainnav { display: flex; gap: 4px; margin-right: auto; }
.mainnav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 8px;
}
.mainnav a:hover { color: var(--ink); background: var(--bg-alt); }
.mainnav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.search-open, .theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.search-open { padding: 0 8px 0 10px; min-width: 180px; }
.search-open span { margin-right: auto; }
.search-open kbd {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
  color: var(--ink-3);
}
.theme-toggle { width: 36px; justify-content: center; }
.search-open svg, .theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.search-open:hover, .theme-toggle:hover { border-color: var(--line-2); color: var(--ink); }

.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* --- поиск ------------------------------------------------------------------------------------------ */

.search {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(10 16 20 / 45%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10vh 16px 16px;
}
.search[hidden] { display: none; }
.search-box {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgb(0 0 0 / 30%);
  overflow: hidden;
}
.search-box input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  padding: 16px 18px;
  outline: none;
}
.search-results { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--accent-soft); }
.search-results .sr-page { font-size: 12px; color: var(--ink-3); }
.search-results .sr-title { font-weight: 600; }
.search-results .sr-text { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: color-mix(in srgb, var(--token) 35%, transparent); color: inherit; border-radius: 2px; }
.search-results .sr-none { padding: 14px; color: var(--ink-3); }
.search-hint { margin: 0; padding: 8px 18px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }

/* --- кнопки ----------------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); border-color: transparent; }
.btn-ghost { background: transparent; }

.more { font-weight: 600; text-decoration: none; }
.more::after { content: " →"; }

/* --- главная ---------------------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 64px;
  background:
    radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(600px 300px at -10% 110%, color-mix(in srgb, var(--token) 12%, transparent), transparent 70%);
}
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.accent { color: var(--accent); }
.lead { font-size: 18px; color: var(--ink-2); margin: 20px 0 0; max-width: 60ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta .btn { min-height: 46px; padding: 0 22px; font-size: 16px; }

.install {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  max-width: 460px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.install code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; color: var(--ink); }
.prompt { color: var(--ink-3); user-select: none; }
.copy {
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--ink-2);
  border-radius: 7px;
  font: inherit;
  font-size: 13px;
  padding: 4px 10px;
  cursor: pointer;
}
.copy:hover { color: var(--ink); }

.hero-flow { margin: 0; display: grid; gap: 0; justify-items: stretch; }
.flow-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.flow-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font: 12.5px var(--mono);
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--token); }
.dot-go { background: var(--accent); }
.flow-bpmn img { display: block; width: 100%; background: #fff; padding: 10px 8px; }
.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  color: var(--ink-3);
  font: 13px var(--mono);
}
.flow-arrow svg { width: 18px; height: 36px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flow-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; background: var(--code-bg); color: var(--code-ink); tab-size: 4; }

.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-title {
  margin: 0 0 12px;
  text-align: center;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.02em;
}
.section-title + .muted { margin: 0 auto 36px; max-width: 64ch; }
.section-title + :not(p) { margin-top: 36px; }

.steps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 40px;
  right: -25px;
  width: 26px;
  border-top: 2px dashed var(--line-2);
}
.step-n {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.steps h3 { margin: 14px 0 6px; font-size: 19px; }
.steps p { margin: 0; color: var(--ink-2); }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feature {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feature h3 { margin: 0 0 8px; font-size: 18px; }
.feature h3::before {
  content: "";
  display: block;
  width: 28px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 2px;
  background: var(--accent);
}
.feature p { margin: 0; color: var(--ink-2); }

.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.split .section-title { text-align: left; }
.checks { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 30px; }
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ok-soft);
  box-shadow: inset 0 0 0 1.5px var(--ok);
}
.checks li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 6px;
  height: 9px;
  border: solid var(--ok);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.split-code { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; }
.section-title code { font-size: 0.85em; white-space: nowrap; line-height: 1; }
.split-code .code { margin: 0; }
.split-code .code pre { font-size: 13px; }
.checks strong { color: var(--ink); }
.eyebrow.center { text-align: center; }

.shot { margin: 0; }
.shot img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  box-shadow: var(--shadow);
}

.embed { display: grid; gap: 16px; max-width: 860px; margin: 0 auto 24px; }

.gallery { max-width: 1000px; margin: 0 auto; }
.gallery-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 18px; }
.gallery-tabs button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 16px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.gallery-tabs button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.gallery-frame { margin: 0; }
.gallery-frame img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 40px 44px;
  border-radius: 18px;
  color: #eaf6f9;
  background:
    radial-gradient(500px 220px at 100% 0%, rgb(224 145 47 / 30%), transparent 70%),
    linear-gradient(135deg, #0a5c74, #0b3a4a);
}
.banner h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -0.02em; }
.banner p { margin: 0; max-width: 60ch; color: #c5e2ea; }
.banner-cta { display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.banner .btn-primary { background: #fff; color: #0b3a4a; border-color: #fff; }
.banner .btn-ghost { color: #fff; border-color: rgb(255 255 255 / 40%); }

/* --- документация ----------------------------------------------------------------------------------- */

.docs {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 230px;
  gap: 48px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
}

.sidebar, .toc {
  position: sticky;
  top: var(--topbar);
  max-height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 32px 0;
}
.sidebar-toggle { display: none; }
.sidebar-title, .toc-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.sidebar ul, .toc ul { list-style: none; margin: 0 0 24px; padding: 0; }
.sidebar a {
  display: block;
  padding: 6px 12px;
  margin-left: -12px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 15px;
}
.sidebar a:hover { background: var(--bg-alt); color: var(--ink); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.toc ul { border-left: 1px solid var(--line); }
.toc a {
  display: block;
  padding: 4px 0 4px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.4;
}
.toc .sub a { padding-left: 26px; font-size: 13px; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }

.doc { min-width: 0; padding: 40px 0 64px; }

.prose { max-width: 820px; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 20px; }
.prose h2 {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 52px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.prose h3 { font-size: 20px; line-height: 1.3; margin: 34px 0 10px; }
.prose h4 { font-size: 17px; margin: 26px 0 8px; }
.prose h2 code, .prose h3 code { font-size: 0.85em; }
.prose .anchor {
  margin-left: 8px;
  color: var(--ink-3);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
}
.prose :is(h2, h3, h4):hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose p, .prose li { color: var(--ink); }
.prose p { margin: 14px 0; }
.prose ul, .prose ol { padding-left: 24px; margin: 14px 0; }
.prose li { margin: 6px 0; }
.prose li > p { margin: 8px 0; }
.prose li::marker { color: var(--ink-3); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.prose hr + h2 { border-top: 0; padding-top: 0; }
.prose :not(pre) > code {
  padding: 0.12em 0.38em;
  border-radius: 5px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  color: var(--code-ink);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
.prose a code { color: var(--accent); }
.prose blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--token);
  background: var(--warn-soft);
  border-radius: 0 10px 10px 0;
}
.prose blockquote p { margin: 6px 0; }
.prose figure { margin: 24px 0; }
.prose figure img {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.prose img[src$=".svg"] { background: #fff; padding: 10px; }
.prose details {
  margin: 18px 0;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.prose summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.prose details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }

.table { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: 10px; }
.table table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.table th, .table td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { background: var(--bg-alt); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td code { white-space: nowrap; }
.table td:first-child { min-width: 120px; }

.code {
  position: relative;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
}
.code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  color: var(--code-ink);
  font-size: 13.5px;
  line-height: 1.6;
  tab-size: 4;
}
.code[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 6px;
  right: 10px;
  font: 11px var(--mono);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: opacity 0.15s;
}
.code .copy {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.code:hover .copy, .code .copy:focus { opacity: 1; }
.code:hover[data-lang]::before { opacity: 0; }

.tok-keyword { color: var(--tok-keyword); }
.tok-string { color: var(--tok-string); }
.tok-number { color: var(--tok-number); }
.tok-comment { color: var(--tok-comment); font-style: italic; }
.tok-func { color: var(--tok-func); }
.tok-builtin { color: var(--tok-builtin); }
.tok-key { color: var(--tok-func); }
.tok-flag { color: var(--tok-number); }
.tok-tag { color: var(--tok-tag); }
.tok-attr { color: var(--tok-attr); }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 820px;
  margin-top: 56px;
}
.pager a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.pager a:hover { border-color: var(--accent); }
.pager span { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.pager-next { text-align: right; grid-column: 2; }
.edit { max-width: 820px; margin: 24px 0 0; font-size: 14px; }
.edit a { color: var(--ink-3); }

/* --- демо ------------------------------------------------------------------------------------------- */

.demo-head { padding: 56px 0 32px; }
.demo-head h1 { margin: 0; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.12; letter-spacing: -0.02em; max-width: 22ch; }
.demo-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  color: var(--ink-2);
}
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.demo-status.up .pulse { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2s infinite; }
.demo-status.down .pulse { background: var(--bad); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .demo-status.up .pulse { animation: none; } }

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 28px;
  align-items: start;
  padding-bottom: 72px;
}
.processes { display: grid; gap: 18px; }
.proc {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.proc header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.proc h2 { margin: 0; font-size: 20px; }
.proc-id { color: var(--ink-3); font-size: 13px; }
.count { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.proc img {
  display: block;
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  margin: 14px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.proc p { margin: 0 0 14px; color: var(--ink-2); }
.runs { display: flex; flex-wrap: wrap; gap: 8px; }
.runs .btn { font-family: var(--mono); font-size: 13.5px; font-weight: 500; }
.runs .btn-primary { font-family: var(--font); font-size: 15px; font-weight: 600; }
.proc-more { display: inline-block; margin-top: 14px; font-size: 14px; }

.run { position: sticky; top: calc(var(--topbar) + 20px); }
.run-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.run-card h2 { margin: 0 0 6px; font-size: 20px; }
.run-empty p { margin: 0 0 14px; color: var(--ink-2); }
.run-curl .code pre { font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.run-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.run-proc { margin: 0; font-weight: 700; font-size: 18px; }
.run-id { font-size: 12px; color: var(--ink-3); word-break: break-all; }
.badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--ink-2);
}
.badge.running { background: var(--warn-soft); color: var(--warn); }
.badge.completed { background: var(--ok-soft); color: var(--ok); }
.badge.failed { background: var(--bad-soft); color: var(--bad); }

.run-tasks {
  margin: 16px 0 0;
  padding: 14px;
  border: 1px dashed var(--token);
  border-radius: 10px;
  background: var(--warn-soft);
}
.run-tasks p { margin: 0 0 10px; font-size: 14px; }
.run-tasks .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.run-tasks .btn { min-height: 34px; font-size: 14px; }

.timeline { list-style: none; margin: 18px 0 0; padding: 0; max-height: 360px; overflow-y: auto; }
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 6px 0 6px 22px;
  font-size: 14px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 24px;
  bottom: -8px;
  border-left: 1px solid var(--line-2);
}
.timeline li:last-child::after { display: none; }
.timeline li.activated::before { background: var(--token); }
.timeline li.terminated::before { background: var(--bad); }
.timeline li.child { padding-left: 38px; }
.timeline li.child::before { left: 20px; }
.timeline .el { font-weight: 600; }
.timeline .ev { color: var(--ink-3); font-size: 12.5px; }
.timeline .ts { color: var(--ink-3); font: 12px var(--mono); white-space: nowrap; }
.timeline .sub { grid-column: 1 / -1; color: var(--ink-3); font-size: 12.5px; }

.run-label { margin: 18px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.run-vars pre {
  margin: 0;
  padding: 10px 12px;
  max-height: 180px;
  overflow: auto;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 12.5px;
}
.run-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.run-error { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.demo-note { margin: 12px 4px 0; font-size: 13px; color: var(--ink-3); }

.console-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 28px; }
.console-shots a { display: block; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.console-shots img {
  display: block;
  margin-bottom: 8px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.console-shots a:hover img { transform: translateY(-3px); }

.notfound { max-width: 640px; margin: 0 auto; padding: 120px 24px; text-align: center; }
.notfound h1 { font-size: 38px; margin: 0 0 12px; }

/* --- подвал ----------------------------------------------------------------------------------------- */

.footer { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; }
.footer-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px;
}
.footer strong { color: var(--ink); }
.footer a { color: var(--ink-2); }

/* --- адаптивность ----------------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  .docs { grid-template-columns: 230px minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 1020px) {
  .mainnav .nav-extra { display: none; }
}

@media (max-width: 960px) {
  .hero-in, .split, .split-code { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-grid { grid-template-columns: minmax(0, 1fr); }
  .run { position: static; order: -1; }
  .banner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar { position: static; max-height: none; padding: 16px 0 0; }
  .sidebar-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }
  .sidebar-toggle::after { content: "▾"; color: var(--ink-3); }
  .sidebar-nav { display: none; padding: 16px 4px 0; }
  .sidebar-nav.open { display: block; }
  .doc { padding-top: 24px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li:not(:last-child)::after { display: none; }
  .console-shots { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .wrap, .topbar-in, .docs, .footer-in { padding-left: 16px; padding-right: 16px; }
  .topbar-in { gap: 10px; }
  .mainnav a[href^="http"], .mainnav a[href="/ui/"], .mainnav .nav-extra { display: none; }
  .mainnav a { padding: 6px 8px; }
  .search-open { min-width: 0; padding: 0; width: 36px; justify-content: center; }
  .search-open span, .search-open kbd { display: none; }
  .hero { padding: 44px 0 40px; }
  .lead { font-size: 17px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 56px 0; }
  .banner { padding: 28px 22px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-next { grid-column: 1; }
  .prose h2 { font-size: 23px; }
  .proc { padding: 18px; }
}

@media (max-width: 420px) {
  .brand span { display: none; }
}

/* --- производительность: горизонтальные столбцы ----------------------------------------------------- */

.perf-chart {
  margin: 20px 0 28px;
  padding: 18px 20px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  --perf-name: 290px;
}
.perf-axis {
  position: relative;
  height: 18px;
  margin-left: var(--perf-name);
  margin-right: 56px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.perf-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.perf-axis span:first-child { transform: none; }
.perf-chart .perf-bars { list-style: none; margin: 0; padding: 0; }
.perf-row {
  display: grid;
  grid-template-columns: var(--perf-name) minmax(0, 1fr);
  align-items: center;
  min-height: 34px;
  margin: 0 !important;
  padding: 3px 0;
  cursor: default;
}
.perf-name { padding-right: 14px; font-size: 14px; line-height: 1.3; color: var(--ink-2); }
.perf-gobpm .perf-name { color: var(--ink); font-weight: 600; }
.perf-track {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
  margin-right: 56px;
  /* сетка: тонкие линии на каждой тысяче, как подписи оси */
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc(100% / var(--perf-steps, 5)) 100%;
}
.perf-bar {
  height: 18px;
  min-width: 2px;
  border-radius: 0 4px 4px 0;
  background: var(--ink-3);
  opacity: 0.55;
}
.perf-gobpm .perf-bar { background: var(--accent); opacity: 1; }
.perf-value {
  margin-left: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  white-space: nowrap;
}
.perf-gobpm .perf-value { color: var(--ink); font-weight: 600; }
.perf-row:hover .perf-bar, .perf-row:focus-visible .perf-bar { opacity: 1; }
.perf-row:hover .perf-name { color: var(--ink); }

.perf-table td, .perf-table th { font-variant-numeric: tabular-nums; white-space: nowrap; }
.perf-table tr.perf-group td {
  background: var(--bg-alt);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.perf-table tr.perf-gobpm td { font-weight: 600; }
.perf-table tr.perf-gobpm td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.tip {
  position: fixed;
  z-index: 60;
  max-width: 320px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
}

@media (max-width: 720px) {
  .perf-chart { padding: 14px 12px 10px; --perf-name: 100%; }
  .perf-axis { margin-left: 0; }
  .perf-row { grid-template-columns: minmax(0, 1fr); padding: 6px 0; }
  .perf-name { padding: 0 0 2px; font-size: 13px; }
  .perf-track { height: 22px; }
}
