/* Юридические документы сервиса — общий стиль.
   Без внешних шрифтов и ресурсов: только системные шрифты. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1b1d21;
  --muted: #5d636e;
  --border: #e3e5ea;
  --surface: #f5f6f8;
  --accent: #2f5fd0;
  --accent-soft: #e8eefc;
  --link: #2450b8;
  --ph-bg: #fff2a8;
  --ph-fg: #4d3b00;
  --ph-line: #c9a200;
  --note-bg: #f2f7ff;
  --note-line: #9bb7f0;
  --measure: 46rem;
  --nw: 3.3em;          /* ширина колонки номера пункта */
  --nw2: 4.1em;         /* ширина колонки номера подпункта */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --fg: #e7e9ee;
    --muted: #a2a8b4;
    --border: #2c3038;
    --surface: #1d2026;
    --accent: #8fb0ff;
    --accent-soft: #1f2a44;
    --link: #9dbbff;
    --ph-bg: #4a3c00;
    --ph-fg: #ffe78a;
    --ph-line: #b8930f;
    --note-bg: #18233a;
    --note-line: #3d5a95;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  font-size: 17px;
  line-height: 1.62;
  font-kerning: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 20px 16px 72px;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* Навигация между документами */
.docnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 28px;
  padding: 0;
  font-size: 14px;
}
.docnav a {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  background: var(--bg);
}
.docnav a:hover { color: var(--fg); border-color: var(--muted); }
.docnav a[aria-current="page"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* Шапка документа */
.doc-head { margin: 0 0 28px; }
.doc-head .eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.doc-head h1 {
  margin: 0;
  font-size: clamp(26px, 5.2vw, 34px);
  line-height: 1.18;
  letter-spacing: -.01em;
  hyphens: manual;
}
.doc-head .subtitle {
  margin: 8px 0 0;
  font-size: 18px;
  color: var(--muted);
  line-height: 1.4;
}
.doc-head .edition {
  display: inline-block;
  margin: 16px 0 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
}
.doc-head .where {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Оглавление */
.toc {
  margin: 0 0 36px;
  padding: 16px 18px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.toc h2 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc ol {
  margin: 0;
  padding-left: 1.7em;
  font-size: 15px;
  line-height: 1.5;
}
.toc li { margin: 3px 0; padding-left: .2em; }
.toc li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (min-width: 760px) {
  .toc ol { columns: 2; column-gap: 2.2em; }
  .toc li { break-inside: avoid; }
}

/* Разделы и нумерация */
main section { margin: 0 0 34px; scroll-margin-top: 16px; }
main h2 {
  margin: 0 0 12px;
  padding-top: 6px;
  font-size: 21px;
  line-height: 1.3;
  hyphens: manual;
}
main h2 .num {
  display: inline-block;
  min-width: 1.9em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
main h3 { margin: 22px 0 8px; font-size: 17px; }

p { margin: .55em 0; }

.cl {
  position: relative;
  margin: .6em 0;
  padding-left: var(--nw);
  scroll-margin-top: 16px;
}
.cl > .n {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--nw);
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cl.l2 { margin-left: var(--nw); padding-left: var(--nw2); }
.cl.l2 > .n { width: var(--nw2); }
.cl > p:first-of-type { margin-top: 0; }

ul.dash, ul.plain { margin: .35em 0 .5em; padding-left: 1.4em; list-style: none; }
ul.dash > li, ul.plain > li { position: relative; margin: .2em 0; }
ul.dash > li::before {
  content: "—";
  position: absolute;
  left: -1.4em;
  color: var(--muted);
}
/* Перечни с буквами, указанными в тексте: «а) …», «б) …» */
ul.plain > li { padding-left: 1.5em; text-indent: -1.5em; }
ul.plain { padding-left: .2em; }

/* Плейсхолдеры, которые нужно заполнить до публикации */
mark.ph {
  background: var(--ph-bg);
  color: var(--ph-fg);
  border-bottom: 1px dashed var(--ph-line);
  border-radius: 3px;
  padding: 0 .22em;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .86em;
  white-space: nowrap;
  hyphens: none;
}

/* Цитаты отметок / кнопок интерфейса */
.ui {
  font-weight: 600;
}
blockquote.check {
  margin: .5em 0;
  padding: .45em .8em;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 6px 6px 0;
}

.note {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--note-bg);
  border: 1px solid var(--note-line);
  border-radius: 8px;
  font-size: 15.5px;
}
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }

/* Таблицы */
.table-wrap {
  margin: 12px 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 8px;
}
table.data {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.45;
  hyphens: auto;
}
table.data th, table.data td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}
table.data thead th {
  background: var(--surface);
  font-size: 13px;
  letter-spacing: .02em;
  color: var(--muted);
  font-weight: 600;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td:first-child { font-weight: 600; }

/* Реквизиты */
dl.reqs {
  display: grid;
  grid-template-columns: minmax(9em, max-content) 1fr;
  gap: 6px 18px;
  margin: 12px 0 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
dl.reqs dt { color: var(--muted); font-size: 15px; }
dl.reqs dd { margin: 0; }

.doc-foot {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}
.doc-foot p { margin: .3em 0; }

.to-top {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  :root { --nw: 2.9em; --nw2: 3.7em; }
  .cl.l2 { margin-left: .9em; }
  dl.reqs { grid-template-columns: 1fr; gap: 2px; }
  dl.reqs dd { margin-bottom: 8px; }
  main h2 { font-size: 19px; }
}

/* Печать: без фона и цветных плашек */
@media print {
  @page { margin: 16mm 15mm 18mm; }
  :root {
    --bg: #fff; --fg: #000; --muted: #333; --border: #999;
    --surface: transparent; --accent: #000; --accent-soft: transparent;
    --link: #000; --ph-bg: transparent; --ph-fg: #000; --ph-line: #000;
    --note-bg: transparent; --note-line: #666;
  }
  html, body { background: #fff !important; color: #000 !important; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .page { max-width: none; padding: 0; }
  .docnav, .to-top { display: none !important; }
  .toc { background: none; border: 1px solid #999; break-inside: avoid; }
  .toc ol { columns: 2; }
  a { color: #000; text-decoration: none; }
  mark.ph { background: none !important; border: 1px dashed #000; }
  .doc-head .edition, dl.reqs, .note, blockquote.check { background: none !important; }
  table.data { min-width: 0; font-size: 9pt; }
  table.data thead th { background: none; color: #000; }
  .table-wrap { overflow: visible; border-color: #999; }
  main h2 { break-after: avoid; page-break-after: avoid; }
  .cl, tr, dl.reqs { break-inside: avoid; page-break-inside: avoid; }
}
