:root {
  --bg: #f1efe2;
  --surface: #faf7ec;
  --surface-strong: #fffdf4;
  --ink: #1c2018;
  --ink-soft: #3e4638;
  --muted: #5f6858;
  --green: #1c5638;
  --green-dark: #123d28;
  --lime: #bce645;
  --lime-bright: #d6f25a;
  --teal: #157a77;
  --amber: #e8b23a;
  --red: #c94b36;
  --line: rgba(28, 32, 24, 0.18);
  --shadow: 8px 8px 0 rgba(28, 86, 56, 0.14);
  --font-body: "Golos Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Golos Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Golos Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.72 var(--font-body);
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:hover { text-decoration-thickness: 2px; }

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

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  transform: translateY(-150%);
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
}

.skip-link:focus { transform: translateY(0); }

.legal-header {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(28, 32, 24, 0.14);
  background: rgba(241, 239, 226, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand__name {
  font: 700 16px/1 var(--font-display);
  letter-spacing: -0.04em;
}

.brand__name span { color: var(--green); }

.legal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-nav a,
.print-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(250, 247, 236, 0.8);
  color: var(--ink);
  font: 650 14px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.legal-nav a:hover,
.print-button:hover,
.legal-nav a[aria-current="page"] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.legal-shell {
  width: calc(100% - 32px);
  max-width: 1320px;
  margin: 0 auto;
  padding: 44px 0 88px;
}

.document-heading {
  min-width: 0;
  max-width: 1030px;
  margin: 0 auto 42px;
  padding: 24px 0 30px;
  border-bottom: 1px solid var(--line);
}

.document-type {
  margin: 0 0 14px;
  color: var(--muted);
  font: 650 13px/1.4 var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-heading h1 {
  max-width: 980px;
  margin: 0;
  color: var(--ink);
  font: 750 clamp(34px, 5vw, 52px)/1.12 var(--font-body);
  letter-spacing: -0.03em;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
  color: var(--muted);
}

.doc-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  font: 550 14px/1.4 var(--font-body);
  overflow-wrap: anywhere;
}

.legal-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 760px);
  gap: clamp(30px, 5vw, 72px);
  align-items: start;
  justify-content: center;
}

.toc {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 118px);
  overflow: auto;
  padding: 6px 20px 6px 0;
  border-right: 1px solid var(--line);
}

.toc__title {
  margin: 0 0 12px;
  color: var(--muted);
  font: 700 12px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li { counter-increment: toc; }

.toc a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.toc a::before {
  content: counter(toc) ".";
  color: var(--teal);
  font: 650 10px/1.8 var(--font-mono);
}

.toc a:hover,
.toc a.is-active {
  background: rgba(28, 86, 56, 0.08);
  color: var(--ink);
}

.legal-article { min-width: 0; }

.legal-section {
  padding: 10px 0 38px;
  border-bottom: 1px solid var(--line);
}

.legal-section + .legal-section { padding-top: 38px; }

.legal-section h2 {
  margin: 0 0 18px;
  color: var(--green-dark);
  font: 730 clamp(24px, 3vw, 30px)/1.25 var(--font-body);
  letter-spacing: -0.025em;
}

.legal-section h3 {
  margin: 28px 0 10px;
  font: 700 19px/1.35 var(--font-body);
}

.legal-section p { margin: 0 0 16px; }

.legal-section code {
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(28, 86, 56, 0.07);
  font: 600 0.92em/1.4 var(--font-body);
  overflow-wrap: anywhere;
}

.legal-section ul,
.legal-section ol {
  display: grid;
  gap: 10px;
  margin: 12px 0 20px;
  padding-left: 24px;
}

.legal-section li { padding-left: 4px; }
.legal-section li::marker { color: var(--green); font-weight: 800; }

.data-table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: rgba(28, 86, 56, 0.08);
  color: var(--green-dark);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.data-table tr:last-child td { border-bottom: 0; }

.legal-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 44px;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.legal-footer p { max-width: 720px; margin: 7px 0 0; color: var(--muted); }
.legal-footer__links { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.legal-footer a { color: var(--green); }

.back-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--green-dark);
  font: 750 18px/1 var(--font-body);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(28, 32, 24, 0.12);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

@media (max-width: 1050px) {
  .legal-layout { grid-template-columns: 230px minmax(0, 720px); gap: 28px; }
}

@media (max-width: 820px) {
  .legal-header { position: static; align-items: flex-start; }
  .legal-nav { flex-wrap: wrap; justify-content: flex-end; }
  .print-button { display: none; }
  .legal-shell { width: calc(100% - 24px); max-width: 760px; padding-top: 20px; }
  .document-heading { margin-bottom: 28px; padding-top: 8px; }
  .legal-layout { display: block; }
  .toc { position: static; max-height: none; margin-bottom: 26px; padding: 18px; border: 1px solid var(--line); }
  .toc ol { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  body { font-size: 16px; line-height: 1.65; }
  .legal-header { display: grid; gap: 10px; padding: 10px 14px 14px; }
  .legal-nav { justify-content: flex-start; }
  .legal-nav a { flex: 1; padding: 0 10px; font-size: 13px; }
  .document-heading h1 { max-width: 100%; font-size: clamp(31px, 11vw, 48px); overflow-wrap: anywhere; }
  .doc-meta { display: grid; }
  .doc-meta span { width: fit-content; max-width: 100%; }
  .toc ol { grid-template-columns: 1fr; }
  .legal-section { padding-bottom: 30px; }
  .legal-section + .legal-section { padding-top: 30px; }
  .legal-footer { grid-template-columns: 1fr; padding: 22px; }
  .back-top { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .legal-header, .toc, .back-top, .legal-footer { display: none !important; }
  .legal-shell { width: 100%; margin: 0; padding: 0; }
  .document-heading { padding: 0 0 20px; color: #000; }
  .legal-layout { display: block; }
  .legal-section { break-inside: avoid; }
}
