/* К-247 — «Условия использования API» (public/api-terms.html). Поверх styles.css лендинга: те же токены, без внешних
   шрифтов. Страница открывается и отдельно, и в окне кабинета (iframe .ig-terms), поэтому колонка узкая, без фиксированных
   элементов; в окне (класс terms--framed ставит api-terms.js) оглавление и ссылка в кабинет скрыты.
   Всё кликабельное — не меньше 44 px по высоте, промежутки между ссылками 8 px. */
.terms { background: #fff; }
.terms [hidden] { display: none !important; }
.terms :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.terms__wrap { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; }
.terms h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.04; margin: 8px 0 12px; }
.terms h2 { font-size: clamp(1.2rem, 2vw, 1.4rem); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 12px; }
.terms p, .terms li { font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.terms .lead { font-size: 16px; max-width: 60ch; margin-bottom: 24px; }
.terms code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; font-size: 0.88em;
  padding: 0 4px; border-radius: 4px; background: rgba(46, 45, 43, 0.06); overflow-wrap: anywhere;
}

/* пометка о редакции — мелким текстом под заголовком */
.terms__meta { font-size: 13px; line-height: 1.45; opacity: 0.72; margin-bottom: 16px; }

/* оглавление */
.terms__toc { margin-bottom: 8px; }
.terms__toc ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.terms__toc a {
  min-height: 44px; display: flex; align-items: center; padding: 6px 12px; font-size: 14px; line-height: 1.3;
  box-shadow: inset 0 0 0 1px rgba(46, 45, 43, 0.16);
  transition: background-color 200ms var(--e), box-shadow 200ms var(--e);
}
.terms__toc a:hover { background: var(--brand); box-shadow: inset 0 0 0 1px var(--ink); }

/* разделы и нумерованные пункты: номер пункта отдельной колонкой */
.terms__sec { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(46, 45, 43, 0.16); scroll-margin-top: 16px; }
.terms__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.terms__list + .terms__list, .terms__tablewrap + .terms__list { margin-top: 10px; }
.terms__list > li { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); column-gap: 8px; }
.terms__n { font-weight: 500; font-variant-numeric: tabular-nums; opacity: 0.55; }
.terms__list > li > ul { grid-column: 2; margin: 6px 0 0; padding-left: 20px; display: grid; gap: 6px; }

/* лимиты */
.terms__tablewrap { overflow-x: auto; margin-top: 12px; }
.terms__table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.terms__table caption { text-align: left; padding: 0 12px 4px; }
.terms__table th, .terms__table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid rgba(46, 45, 43, 0.16); }
.terms__table thead th { font-weight: 500; font-size: 13px; opacity: 0.72; }
.terms__table th:last-child, .terms__table td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* реквизиты оператора (из /api/public-settings) или ссылка на оферту */
.terms__req { margin-top: 20px; padding: 16px; border-radius: 12px; background: var(--paper); }
.terms__req-list { display: grid; gap: 4px; margin-top: 8px; }
.terms__req-row { display: grid; grid-template-columns: 11em minmax(0, 1fr); column-gap: 12px; align-items: baseline; font-size: 14.5px; line-height: 1.5; }
.terms__req-row dt { opacity: 0.65; }
.terms__req-row dd { margin: 0; overflow-wrap: anywhere; }
.terms__req-none { margin-top: 20px; font-size: 14px; opacity: 0.75; }

/* ссылки на документацию и в кабинет */
.terms__links { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.terms__links a {
  min-height: 44px; display: inline-flex; align-items: center; padding: 8px 18px; border-radius: 999px;
  font-size: 14.5px; line-height: 1.3; box-shadow: inset 0 0 0 1px rgba(46, 45, 43, 0.3);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: background-color 200ms var(--e), color 200ms var(--e), text-decoration-color 200ms var(--e);
}
.terms__links a:hover { background: var(--ink); color: var(--paper); text-decoration-color: currentColor; }

/* окно «Условия API» в кабинете */
.terms--framed .terms__toc, .terms--framed .terms__back, .terms--framed .terms__wrap > .label:first-child { display: none; }
.terms--framed .terms__wrap { padding: 16px 16px 24px; }
.terms--framed h1 { font-size: 1.6rem; }

@media (max-width: 480px) {
  .terms__wrap { padding: 20px 16px 48px; }
  .terms__list > li { grid-template-columns: 2.8em minmax(0, 1fr); }
  .terms__req-row { grid-template-columns: minmax(0, 1fr); }
  .terms__links li { flex: 1 1 100%; }
  .terms__links a { width: 100%; }
}
