:root {
  --ink: #1a1919;
  --muted: #77746f;
  --line: #eceae6;
  --paper: #ffffff;
  --accent: #1d57e9;
  --fill: #fff3bf;
  --content: 680px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.sitebar {
  height: 58px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.sitebar__inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--ink);
}

.back {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.back:hover { color: var(--ink); }

.doc {
  width: min(var(--content), calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

.doc__meta {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 13px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 32px);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  margin: 34px 0 12px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h3 {
  margin: 22px 0 8px;
  font-size: 16px;
  font-weight: 750;
}

.lead {
  margin: 0 0 22px;
  color: #383632;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 600;
}

p { margin: 0 0 13px; }

ul, ol { margin: 0 0 16px; padding-left: 24px; }

li { margin: 6px 0; }

strong { font-weight: 750; }

hr { height: 1px; margin: 30px 0; border: 0; background: var(--line); }

dl { margin: 0 0 16px; }
dt { margin-top: 14px; font-weight: 750; }
dd { margin: 4px 0 0; }

/* Подсветка плейсхолдеров — заменить на реальные данные и убрать класс */
.fill {
  background: var(--fill);
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 600;
}

.note {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: #f6f8ff;
  font-size: 15px;
}

.note p:last-child { margin-bottom: 0; }

.toc {
  margin: 24px 0;
  padding: 16px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}

.toc__title { font-weight: 750; }

.toc ol { margin: 8px 0 0; }

.footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.footer p { margin: 0 0 5px; }

@media (max-width: 620px) {
  .doc { width: min(100% - 28px, var(--content)); padding-top: 28px; }
  .sitebar__note { display: none; }
}

@media print {
  .sitebar { display: none; }
  .doc { width: 100%; padding: 0; }
  .fill { background: transparent; border-bottom: 1px solid #999; }
  .note { background: transparent; }
}
