/* xHunter · юридические документы: страница документа (/{язык}/terms …) и хаб (/{язык}/legal).
   Собирает tools/build_legal.py. Токены, кнопки, шапка, подвал и шторки — из article.css; здесь только своё. */

/* ================= шапка документа ================= */
.lg { margin-top: 16px; }
.lg-hd { background: var(--surface); border-radius: var(--r-xl); padding: 36px var(--pad-x) 32px; }
.lg-hd .crumbs { margin-bottom: 40px; }
.lg-note { margin: 0 0 14px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.lg-hd h1 { margin: 0; max-width: 16em; font-size: clamp(38px, 4.6vw, 64px); line-height: 1; letter-spacing: -.036em; text-wrap: balance; }
.lg-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); }
.lg-ver { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 15px; color: var(--muted); }
.lg-ver time { color: var(--ink); font-weight: 500; }
.lg-dot { color: var(--line-2); }
/* версия — единственная лаймовая плашка на странице: по ней видно, какая редакция открыта */
.lg-tag { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 8px; background: var(--lime); color: var(--on-lime); font-size: 13.5px; font-weight: 700; font-variation-settings: "SHRP" 100; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.lg-dl { height: 44px; padding: 0 18px 0 16px; font-size: 15px; }
.lg-dl .ico { font-size: 19px; }

/* ================= раскладка: оглавление слева, текст справа ================= */
.lg-grid { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: var(--gap) 32px; align-items: start; margin-top: var(--gap); }
.lg-toc { position: sticky; top: calc(var(--hdr) + 16px); max-height: calc(100dvh - var(--hdr) - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; background: var(--surface); border-radius: var(--r-lg); padding: 22px 14px 14px; }
.lg-toc-t { margin: 0 0 10px 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.lg-toc ol, .lg-sheet ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.lg-toc a, .lg-sheet ol a { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: baseline; padding: 8px 10px; border-radius: 12px; text-decoration: none; font-size: 14.5px; line-height: 1.3; color: var(--muted); transition: background-color .15s ease, color .15s ease; }
.lg-toc a .k, .lg-sheet ol a .k { font-weight: 700; font-variation-settings: "SHRP" 100; font-variant-numeric: tabular-nums; font-size: 13px; text-align: center; border-radius: 6px; }
@media (hover: hover) and (pointer: fine) { .lg-toc a:hover, .lg-sheet ol a:hover { color: var(--ink); background: var(--surface-2); } }
.lg-toc a[aria-current="true"], .lg-sheet ol a[aria-current="true"] { color: var(--ink); background: var(--surface-2); }
.lg-toc a[aria-current="true"] .k, .lg-sheet ol a[aria-current="true"] .k { color: #000000; background: var(--lime); }

/* ================= текст документа ================= */
.lg-body { min-width: 0; background: var(--surface); border-radius: var(--r-lg); padding: 52px 56px 56px; }
/* номер раздела висит в левом поле: текст начинается с одной линии, номера читаются столбиком */
.lg-sec { position: relative; padding-left: 64px; }
.lg-sec + .lg-sec, .lg-intro + .lg-sec { margin-top: 44px; padding-top: 40px; border-top: 1px solid var(--line); }
.lg-sh { position: relative; display: flex; align-items: flex-start; gap: 8px; margin: 0 0 18px; }
.lg-sec h2 { margin: 0; max-width: 24em; font-size: clamp(24px, 2.1vw, 30px); line-height: 1.14; letter-spacing: -.028em; text-wrap: balance; }
.lg-no { position: absolute; left: -64px; top: 0; width: 52px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-a { flex: none; position: relative; top: -3px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity .15s ease, background-color .15s ease, color .15s ease; }
.lg-a .ico { font-size: 18px; }
.lg-sh:hover .lg-a, .lg-a:focus-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .lg-a:hover { background: var(--surface-2); color: var(--ink); } }
@media (hover: none) { .lg-a { opacity: .7; } }

.lg-txt { font-size: 17.5px; line-height: 1.6; }
.lg-txt > p, .lg-txt > ul, .lg-txt > ol, .lg-txt > blockquote, .lg-txt > pre { max-width: 36em; }  /* около 68 знаков в строке */
.lg-txt p { margin: 0 0 16px; }
.lg-txt > :last-child { margin-bottom: 0; }
.lg-intro { padding-bottom: 4px; }
.lg-intro p { font-size: 19px; line-height: 1.55; }
.lg-txt h3 { margin: 28px 0 12px; font-size: 19px; line-height: 1.3; letter-spacing: -.015em; }
.lg-txt ul, .lg-txt ol { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 10px; }
.lg-txt li { position: relative; padding-left: 26px; }
.lg-txt ul > li::before { content: ""; position: absolute; left: 3px; top: .6em; width: 8px; height: 8px; border-radius: 2px; background: var(--lime); box-shadow: inset 0 0 0 1px var(--lime-deep); }
.lg-txt ol { counter-reset: n; }
.lg-txt ol > li { counter-increment: n; padding-left: 34px; }
.lg-txt ol > li::before { content: counter(n) "."; position: absolute; left: 0; top: 0; min-width: 24px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.lg-txt a:not(.btn) { text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: var(--line-2); transition: text-decoration-color .15s ease; }
@media (hover: hover) and (pointer: fine) { .lg-txt a:not(.btn):hover { text-decoration-color: var(--ink); } }
.lg-txt code { font-family: var(--mono); font-size: .84em; font-weight: 500; padding: .1em .38em; border-radius: 6px; background: var(--surface-2); overflow-wrap: anywhere; }
.lg-txt strong { font-weight: 650; }
.lg-txt blockquote { margin: 0 0 16px; padding: 14px 18px; border-radius: 16px; background: var(--surface-2); }
.lg-txt hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.lg-txt pre { margin: 0 0 16px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); overflow-x: auto; font-size: 14px; }

/* таблицы (тарифы, сети, уровни): своя рамка, на телефоне листаются внутри неё, страница не едет вбок */
.lg-tw { margin: 6px 0 20px; border: 1px solid var(--line); border-radius: 20px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.lg-tw:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.lg-tw table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.lg-tw th, .lg-tw td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.lg-tw thead th { padding-top: 12px; padding-bottom: 12px; background: var(--surface-2); font-size: 13.5px; font-weight: 500; color: var(--muted); }
.lg-tw tbody tr:last-child td { border-bottom: 0; }
.lg-tw tbody td:first-child { font-weight: 600; }
.lg-tw td.nw { white-space: nowrap; }
.lg-tw code { font-size: .86em; }

/* ================= другие документы ================= */
.lg-more { margin-top: var(--gap); }
.lg-more-c { background: var(--bg); color: var(--ink); border-radius: var(--r-xl); padding: 40px var(--pad-x) 36px; }
.lg-more-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin-bottom: 18px; }
.lg-more-h h2 { margin: 0; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.1; letter-spacing: -.03em; }
.lg-more ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; }
.lg-more li { border-top: 1px solid var(--line); }
.lg-more li a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; text-decoration: none; font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.lg-more li a .ico { flex: none; color: var(--muted); transition: transform .2s var(--ease-out), color .2s ease; }
@media (hover: hover) and (pointer: fine) { .lg-more li a:hover .ico { color: var(--ink); transform: translate(2px, -2px); } }

/* ================= телефон и планшет: оглавление — кнопка со шторкой ================= */
.lg-bar { display: none; }
.lg-sheet { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.lg-sheet-t { margin: 6px 56px 14px 4px; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.lg-sheet ol a { font-size: 16px; padding: 11px 10px; }
.lg-toast { position: fixed; z-index: 95; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14.5px; font-weight: 600; transition: opacity .2s ease, transform .35s var(--ease-expo); }
.lg-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  html { scroll-padding-top: calc(var(--hdr) + 84px); }
  .lg-grid { grid-template-columns: minmax(0, 1fr); }
  .lg-toc { display: none; }
  .lg-bar { position: sticky; z-index: 50; top: calc(var(--hdr) + 8px); display: flex; align-items: center; gap: 10px; width: 100%; height: 54px; margin-top: var(--gap); padding: 0 16px 0 18px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 15px; text-align: left; box-shadow: 0 -9px 0 0 var(--bg); }  /* тень цвета фона закрывает щель под шапкой: текст не просвечивает над кнопкой */
  .lg-bar b { flex: none; font-weight: 600; }
  .lg-bar-t { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lg-bar-t:not(:empty)::before { content: "·"; margin-right: 8px; color: var(--line-2); }
  .lg-bar .ico { flex: none; font-size: 18px; color: var(--muted); }
  .lg-more ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lg-hd { padding: 22px var(--pad-x) 24px; border-radius: 32px; }
  .lg-hd .crumbs { margin-bottom: 26px; }
  .lg-hd h1 { font-size: clamp(32px, 9vw, 44px); }
  .lg-meta { margin-top: 22px; padding-top: 18px; }
  .lg-dl { width: 100%; }
  .lg-body { padding: 30px 20px 32px; border-radius: 28px; }
  .lg-sec { padding-left: 0; }
  .lg-sec + .lg-sec, .lg-intro + .lg-sec { margin-top: 32px; padding-top: 28px; }
  .lg-no { position: static; width: auto; }
  .lg-sec h2 { font-size: 23px; }
  .lg-txt { font-size: 16.5px; line-height: 1.6; }
  .lg-intro p { font-size: 17.5px; }
  .lg-tw { margin-left: -4px; margin-right: -4px; border-radius: 16px; }
  .lg-tw table { min-width: 560px; font-size: 14.5px; }
  .lg-tw th, .lg-tw td { padding: 12px 14px; }
  .lg-more-c { padding: 28px var(--pad-x) 22px; border-radius: 32px; }
  .lg-more ul { grid-template-columns: minmax(0, 1fr); }
}

/* ================= хаб документов ================= */
.lgh-hd { display: grid; grid-template-columns: minmax(0, 1fr); }
.lgh-lead { margin: 18px 0 0; max-width: 34em; font-size: 19px; line-height: 1.55; color: var(--muted); }
.lgh-list { list-style: none; margin: var(--gap) 0 0; padding: 8px var(--pad-x); background: var(--surface); border-radius: var(--r-xl); }
.lgh-list li + li { border-top: 1px solid var(--line); }
.lgh-i { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr) 40px; gap: 6px 40px; align-items: center; padding: 26px 0; text-decoration: none; color: var(--ink); }
.lgh-i h2 { margin: 0; font-size: clamp(22px, 1.9vw, 27px); line-height: 1.15; letter-spacing: -.026em; text-wrap: balance; }
.lgh-d { margin: 0; font-size: 16px; line-height: 1.55; color: var(--muted); }
.lgh-d code { font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere; }
.lgh-i .lg-ver { grid-column: 2; font-size: 14px; }
.lgh-go { grid-column: 3; grid-row: 1 / span 2; justify-self: end; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); transition: background-color .2s ease, transform .2s var(--ease-out); }
.lgh-go .ico { font-size: 18px; }
@media (hover: hover) and (pointer: fine) {
  .lgh-i:hover .lgh-go { background: var(--lime); color: #000000; transform: translate(2px, -2px); }
}
@media (max-width: 860px) {
  .lgh-i { grid-template-columns: minmax(0, 1fr) 36px; gap: 8px 16px; padding: 22px 0; }
  .lgh-i h2 { grid-column: 1; }
  .lgh-d, .lgh-i .lg-ver { grid-column: 1; }
  .lgh-go { grid-column: 2; grid-row: 1; width: 36px; height: 36px; }
  .lgh-list { padding: 4px 20px; border-radius: 32px; }
  .lgh-lead { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-toast, .lg-a, .lgh-go, .lg-more li a .ico { transition: none; }
}
:lang(zh) .lg-hd h1, :lang(zh) .lg-sec h2, :lang(zh) .lgh-i h2 { letter-spacing: 0; }
