/* ===========================
   ПЕРЕМЕННЫЕ
   =========================== */

:root {
  --bg: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.92);
  --bg-footer: #f7f7f5;
  --text: #0d0d0d;
  --text-secondary: #444;
  --text-muted: #888;
  --text-light: #aaa;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --accent: #0066cc;
  --toc-active-border: #0d0d0d;
  --toc-active-text: #0d0d0d;
  --radius: 6px;
  --transition: 0.18s ease;
  --header-h: 60px;
}

/* ===========================
   СБРОС
   =========================== */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ===========================
   ХЕДЕР
   =========================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--bg-header);
  backdrop-filter: blur(12px) saturate(1.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 40px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  background: transparent;
}

.btn-back:hover {
  background: #f5f5f5;
  color: var(--text);
  border-color: #d0d0d0;
}

/* ===========================
   ДВУХКОЛОНОЧНЫЙ LAYOUT
   =========================== */

.page-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 0 0;
  gap: 0;
  align-items: start;
}

/* ===========================
   БОКОВОЕ ОГЛАВЛЕНИЕ
   =========================== */

.toc-sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 48px 16px 48px 16px;
  border-right: 1px solid var(--border);
}

.toc-sidebar::-webkit-scrollbar { width: 0; }

.toc-inner { padding-right: 4px; }

.toc-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 16px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li {
  margin: 0;
  border: none;
  padding: 0;
}

.toc-list li::before { display: none; }

.toc-link {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  padding: 5px 4px 5px 10px;
  border-left: 2px solid transparent;
  line-height: 1.4;
  word-break: break-word;
  transition: color var(--transition), border-color var(--transition), font-weight var(--transition);
}

.toc-link:hover {
  color: var(--text);
  border-left-color: #d0d0d0;
  text-decoration: none;
}

.toc-link.active {
  color: var(--toc-active-text);
  font-weight: 600;
  border-left-color: var(--toc-active-border);
}

/* ===========================
   КОНТЕНТ
   =========================== */

.content {
  padding: 48px 0 80px 56px;
  min-width: 0;
  max-width: 680px;
}

/* ===========================
   ВВОДНАЯ ЧАСТЬ
   =========================== */

.content-intro {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.doc-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
  font-weight: 400;
}

h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 0 0 24px;
  color: var(--text);
}

p.lead {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0 0 14px;
}

/* ===========================
   СЕКЦИИ
   =========================== */

.policy-section {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border-light);
}

.policy-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin: 0 0 20px;
  color: var(--text);
}

p {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin: 0 0 14px;
}

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

strong {
  color: var(--text);
  font-weight: 600;
}

/* ===========================
   СПИСКИ
   =========================== */

ul {
  margin: 4px 0 16px;
  padding-left: 0;
  list-style: none;
}

li {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 6px 0 6px 20px;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

li:first-child { border-top: 1px solid var(--border-light); }

li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 6px;
  color: var(--text-light);
  font-size: 14px;
}

/* ===========================
   ССЫЛКИ
   =========================== */

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition), color var(--transition);
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ===========================
   КОНТАКТЫ
   =========================== */

.contacts-grid {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
}

.contact-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  align-items: baseline;
}

.contact-row:last-child { border-bottom: none; }

.contact-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.contact-value {
  font-size: 14.5px;
  color: var(--text-secondary);
}

.contact-value strong { font-size: 15px; }

/* ===========================
   ФУТЕР
   =========================== */

.site-footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition), opacity var(--transition);
}

.site-footer a:hover { color: var(--text); }

.footer-socials {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-socials img {
  width: 22px;
  height: 22px;
  display: block;
  opacity: 0.55;
  transition: opacity var(--transition), transform var(--transition);
}

.footer-socials a:hover img {
  opacity: 1;
  transform: translateY(-1px);
}

/* ===========================
   СКРОЛЛБАР
   =========================== */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ===========================
   АДАПТИВ — ПЛАНШЕТ
   =========================== */

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 160px 1fr;
    padding: 0;
  }

  .toc-sidebar { padding: 36px 16px 36px 20px; }

  .content {
    padding: 36px 20px 60px 28px;
    max-width: 100%;
  }

  h1 { font-size: 28px; }
}

/* ===========================
   АДАПТИВ — МОБАЙЛ
   =========================== */

@media (max-width: 640px) {
  .site-header { padding: 0 16px; }

  .page-layout {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .toc-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 20px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
  }

  .content {
    padding: 28px 16px 56px;
    max-width: 100%;
  }

  h1 { font-size: 24px; }
  h2 { font-size: 18px; }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 16px;
  }

  .contact-row {
    grid-template-columns: 100px 1fr;
    padding: 12px 14px;
  }
}
