/* Юридичні сторінки OM CRM. Палітра — TailAdmin Пульта (brand 500 #465fff,
   gray-шкала), темна тема — синьо-сіра, як у Пульті. Шрифти системні. */
:root {
  --bg: #f9fafb; --surface: #ffffff; --text: #101828; --muted: #475467; --subtle: #667085;
  --border: #e4e7ec; --accent: #465fff; --accent-soft: #ecf3ff; --code: #f2f4f7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101828; --surface: #1a2231; --text: #f2f4f7; --muted: #d0d5dd; --subtle: #98a2b3;
    --border: rgba(255,255,255,.1); --accent: #7592ff; --accent-soft: rgba(70,95,255,.18); --code: rgba(255,255,255,.06);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.brand img { border-radius: 6px; display: block; }
.langs { display: flex; gap: 4px; }
.langs a, .tabs a {
  text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 14px; white-space: nowrap;
}
.langs a[aria-current], .tabs a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 10px; }

main { padding-top: 36px; padding-bottom: 24px; }
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 6px; }
h2 { font-size: 20px; line-height: 1.35; margin: 36px 0 10px; scroll-margin-top: 110px; }
.meta { color: var(--subtle); font-size: 14px; margin: 0 0 16px; }
.lead { font-size: 17px; color: var(--muted); }
p, li { overflow-wrap: anywhere; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.note { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 20px 0 8px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.tbl { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--subtle); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.foot { color: var(--subtle); font-size: 14px; border-top: 1px solid var(--border); padding-top: 16px; padding-bottom: 32px; }
.idx li { margin: 10px 0; }

@media (max-width: 640px) {
  /* Дві лінії вкладок на телефоні — липка шапка з'їла б третину екрана. */
  .top { position: static; }
  h2 { scroll-margin-top: 16px; }
  h1 { font-size: 24px; }
  .toc ol { columns: 1; }
  /* Таблиці на телефоні — картками: рядок = блок, підпис колонки з data-label. */
  .tbl { border: 0; background: none; overflow: visible; }
  .tbl thead { display: none; }
  .tbl table, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px 0; margin-bottom: 10px; }
  .tbl td { border: 0; padding: 6px 14px; }
  .tbl td::before { content: attr(data-label); display: block; color: var(--subtle); font-size: 12px; font-weight: 600; }
}
