:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #111823;
  --line: #2a3342;
  --txt: #e6edf3;
  --muted: #9aa7b8;
  --acc: #2ea043;
  --acc2: #58a6ff;
  --warn: #d29922;
  --bad: #f85149;
  --r: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.locked { overflow: hidden; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ═══════ Шапка и гамбургер ═══════ */
header.top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(13, 17, 23, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
}

.burger {
  width: 42px; height: 42px; flex: 0 0 42px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.burger:hover { border-color: var(--acc2); }
.burger span {
  display: block; width: 19px; height: 2px; border-radius: 2px;
  background: var(--txt); transition: transform .22s ease, opacity .22s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.brand {
  font-weight: 700; font-size: 17px; color: var(--txt);
  text-decoration: none; letter-spacing: -.2px; margin-right: auto;
}
.brand span { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 8px; }

/* ═══════ Выдвижное меню ═══════ */
.backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s;
}
.backdrop.show { opacity: 1; visibility: visible; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 80;
  width: min(320px, 84vw);
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 24px 22px;
  transform: translateX(-100%);
  transition: transform .24s ease;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer .d-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin-bottom: 12px;
}
.drawer .d-group {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin: 20px 0 8px; opacity: .7;
}
.drawer .d-group:first-of-type { margin-top: 0; }
.drawer nav { display: flex; flex-direction: column; gap: 2px; }
.drawer nav a {
  color: var(--txt); text-decoration: none; font-size: 16px;
  padding: 11px 12px; border-radius: 10px; border: 1px solid transparent;
}
.drawer nav a:hover { background: var(--panel2); border-color: var(--line); }
.drawer nav a.active { color: var(--acc2); background: rgba(88, 166, 255, .08); border-color: rgba(88, 166, 255, .25); }
.drawer .spacer { margin-top: auto; }
.drawer .d-foot { font-size: 12px; color: var(--muted); margin-top: 20px; }

/* ═══════ Экран первый ═══════ */
.hero {
  background:
    radial-gradient(900px 380px at 15% -10%, rgba(46, 160, 67, .16), transparent 60%),
    radial-gradient(700px 320px at 85% 0%, rgba(88, 166, 255, .14), transparent 60%);
  padding: 58px 0 52px;
  border-bottom: 1px solid var(--line);
}
.kicker { color: var(--acc); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px; }
h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.15; letter-spacing: -1px; margin-bottom: 18px; font-weight: 700; }
h1 em { font-style: normal; color: var(--acc2); }
.lead { font-size: clamp(16px, 2.2vw, 19px); color: var(--txt); max-width: 760px; margin-bottom: 14px; }
.sub { color: var(--muted); max-width: 720px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0; }
.chip {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 12px; padding: 10px 14px; font-size: 13px;
}
.chip b { display: block; font-size: 16px; color: var(--acc2); }
.chip.warn b { color: var(--warn); }
.chip.bad b { color: var(--bad); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-block; padding: 13px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; text-align: center;
}
.btn-primary { background: var(--acc); color: #06110a; }
.btn-primary:hover { background: #3fb950; }
.btn-ghost { border-color: var(--line); color: var(--txt); background: var(--panel); }
.btn-ghost:hover { border-color: var(--acc2); }

/* Быстрые переходы между разделами */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0; }
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px; transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--acc2); transform: translateY(-2px); }
.card h3 { color: var(--txt); margin: 0 0 8px; font-size: 17px; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }
.card .arrow { color: var(--acc); margin-top: 12px; font-size: 14px; }

/* ═══════ Секции ═══════ */
section { padding: 56px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }
h2 { font-size: clamp(22px, 3.2vw, 30px); letter-spacing: -.5px; margin-bottom: 8px; }
h2 .n { color: var(--acc); font-size: .55em; vertical-align: super; margin-right: 8px; font-weight: 600; }
h3 { font-size: 17px; color: var(--acc2); margin: 28px 0 12px; }
h3:first-child { margin-top: 0; }
.section-sub { color: var(--muted); margin-bottom: 24px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; margin: 18px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 980px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr; } }

/* ═══════ Таблицы ═══════ */
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--acc); border-bottom: none; }
tr.subtle td { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  table { font-size: 14px; }
  th, td { padding: 8px 6px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ═══════ Списки ═══════ */
ul.list { list-style: none; margin: 12px 0; }
ul.list li { padding: 7px 0 7px 26px; position: relative; font-size: 15px; }
ul.list li::before { position: absolute; left: 0; font-weight: 700; }
ul.list.yes li::before { content: "✓"; color: var(--acc); }
ul.list.no li::before { content: "✕"; color: var(--bad); }
ul.list.q li::before { content: "?"; color: var(--warn); }

/* ═══════ Цепочка ═══════ */
.chain { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; margin: 20px 0; }
.chain span { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; font-size: 14px; }
.chain i { font-style: normal; color: var(--acc); align-self: center; }

/* ═══════ Ветки плана ═══════ */
.branch {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 24px; margin: 18px 0;
}
.branch > .head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.branch .tagline {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--acc); border: 1px solid rgba(46, 160, 67, .35);
  background: rgba(46, 160, 67, .08); padding: 3px 9px; border-radius: 20px;
}
.branch h3 { color: var(--txt); font-size: 19px; margin: 0; }
.branch .source { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.branch .outcome {
  border-left: 3px solid var(--acc2); background: rgba(88, 166, 255, .06);
  padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 16px 0 0; font-size: 14px;
}
.branch .outcome b { color: var(--acc2); }

/* ═══════ Шаги ═══════ */
.steps { display: grid; gap: 14px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; display: grid; grid-template-columns: 108px 1fr; gap: 18px; }
.step .when { color: var(--acc); font-weight: 700; font-size: 14px; }
.step h4 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.step .kpi { color: var(--acc2); font-size: 14px; }
@media (max-width: 640px) { .step { grid-template-columns: 1fr; gap: 6px; } }

/* ═══════ Метрика-строка ═══════ */
.metric { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.metric:last-child { border-bottom: none; }
.metric span:last-child { color: var(--acc2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric.hi span:last-child { color: var(--acc); font-weight: 700; }
.metric.mine span:last-child { color: var(--txt); }

/* ═══════ Врезки ═══════ */
.note { border-left: 3px solid var(--warn); background: rgba(210, 153, 34, .06); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; font-size: 14px; color: var(--muted); }
.note b { color: var(--txt); }
.verdict { border-left: 3px solid var(--acc); background: rgba(46, 160, 67, .06); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; font-size: 15px; }
.critical { border-left: 3px solid var(--bad); background: rgba(248, 81, 73, .07); padding: 16px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; font-size: 15px; }
.critical b { color: var(--txt); }
.critical .lab { display: block; color: var(--bad); font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 6px; font-weight: 700; }

/* ═══════ Уровни риска ═══════ */
.lvl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.lvl.high { color: var(--bad); }
.lvl.mid { color: var(--warn); }
.lvl.low { color: var(--acc); }
.lvl.open { color: var(--acc2); }

/* ═══════ Статус реализации ═══════ */
.st {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  padding: 2px 7px; border-radius: 4px; margin-right: 6px;
  vertical-align: 1px; white-space: nowrap;
}
.st.on { color: var(--acc); background: rgba(46, 160, 67, .12); border: 1px solid rgba(46, 160, 67, .3); }
.st.part { color: var(--warn); background: rgba(210, 153, 34, .12); border: 1px solid rgba(210, 153, 34, .3); }
.st.plan { color: var(--bad); background: rgba(248, 81, 73, .12); border: 1px solid rgba(248, 81, 73, .3); }

/* ═══════ Юридические врезки ═══════ */
.law { background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--acc2); border-radius: 0 10px 10px 0; padding: 16px 18px; margin: 18px 0; font-size: 14px; }
.law .law-h { color: var(--acc2); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }
.law p { margin-bottom: 8px; color: var(--muted); }
.law p:last-child { margin-bottom: 0; }
.law b { color: var(--txt); }
.law.quote { font-style: italic; border-left-color: var(--muted); }
.law.quote p { color: var(--txt); }

/* ═══════ Вопрос-ответ ═══════ */
details.faq {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 0; margin: 10px 0; overflow: hidden;
}
details.faq summary {
  cursor: pointer; padding: 15px 18px; font-size: 15px; font-weight: 600;
  color: var(--txt); list-style: none; position: relative; padding-right: 44px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  color: var(--acc2); font-size: 20px; font-weight: 400;
}
details.faq[open] summary::after { content: "−"; }
details.faq[open] summary { border-bottom: 1px solid var(--line); }
details.faq .faq-body { padding: 15px 18px; font-size: 14px; color: var(--muted); }
details.faq .faq-body p { margin-bottom: 10px; }
details.faq .faq-body p:last-child { margin-bottom: 0; }
details.faq .faq-body b { color: var(--txt); }

/* ═══════ Слои архитектуры ═══════ */
.layers { display: grid; gap: 8px; margin: 18px 0; }
.layer {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 16px; display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
}
.layer .lname { color: var(--acc2); font-weight: 700; font-size: 14px; min-width: 210px; }
.layer .lwhat { color: var(--muted); font-size: 14px; flex: 1 1 260px; }
@media (max-width: 620px) { .layer .lname { min-width: 0; } }

/* ═══════ Вакансия ═══════ */
.vacancy { border-left: 3px solid var(--warn); }
.vacancy h3:first-child { color: var(--warn); }
.salary { font-size: 15px; color: var(--txt); }
.salary b { color: var(--acc2); font-size: 17px; }

/* ═══════ Чек-лист ═══════ */
ul.checklist { list-style: none; margin: 14px 0; }
ul.checklist li { padding: 9px 0 9px 32px; position: relative; font-size: 15px; border-bottom: 1px solid var(--line); }
ul.checklist li:last-child { border-bottom: none; }
ul.checklist li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 15px; height: 15px; border: 2px solid var(--acc); border-radius: 3px;
}
ul.checklist li.pending::before { border-color: var(--warn); }
ul.checklist li b { color: var(--txt); }
ul.checklist li .sub2 { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }

/* ═══════ Условие и следствие ═══════ */
.tc { display: grid; gap: 10px; margin: 16px 0; }
.tc-row {
  display: grid; grid-template-columns: 1fr 24px 1fr; gap: 14px; align-items: center;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
}
.tc-row .tc-a { font-size: 14px; color: var(--txt); }
.tc-row .tc-i { font-style: normal; color: var(--acc); text-align: center; font-size: 16px; }
.tc-row .tc-b { font-size: 14px; color: var(--muted); }
@media (max-width: 700px) {
  .tc-row { grid-template-columns: 1fr; gap: 6px; }
  .tc-row .tc-i { text-align: left; }
}

/* ═══════ Подвал ═══════ */
footer { padding: 36px 0 56px; color: var(--muted); font-size: 13px; text-align: center; }
footer .btn { margin-bottom: 18px; }
footer a { color: var(--acc2); }

@media (max-width: 640px) {
  .brand span { display: none; }
  .hero { padding: 40px 0 36px; }
  section { padding: 42px 0; }
}

@media print {
  header.top, .drawer, .backdrop, .cta, .burger { display: none; }
  body { background: #fff; color: #000; }
  section { break-inside: avoid; }
}