/* Справочники happ-sub.at и incy.at. Подключается после site.css: цвета и кнопки — оттуда. */

/* шапка: метка «справочник», полоса разделов на телефоне */
.brand em { font-style: normal; font-weight: 600; font-size: 13px; color: var(--muted); padding: 4px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.top .top-cta { display: inline-flex; }
.top nav a.on, .subnav a.on { color: var(--text); font-weight: 600; }
.subnav { border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.subnav::-webkit-scrollbar { display: none; }
.subnav .wrap { display: flex; gap: 24px; min-height: 44px; align-items: center; white-space: nowrap; font-size: 15px; color: var(--muted); width: max-content; max-width: none; margin: 0; }
.subnav a { text-decoration: none; padding: 12px 0; }

/* путь */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { text-decoration: none; padding: 12px 0; }
.crumbs a:hover { color: var(--text); }
.crumbs i { font-style: normal; opacity: .5; }
.crumbs span { color: var(--text); }

/* статья */
.doc-wrap { padding: 24px 0 64px; }
.doc { min-width: 0; }
.doc h1 { font-size: clamp(32px, 8.4vw, 50px); }
.doc .meta { margin-top: 16px; font-size: 14px; color: var(--muted); }
.doc .lead { margin-top: 20px; font-size: 19px; line-height: 1.55; color: var(--text); max-width: 40em; }
.doc h2 { font-size: clamp(24px, 6vw, 31px); margin-top: 48px; letter-spacing: -0.01em; line-height: 1.15; }
.doc h3 { margin-top: 28px; }
.doc p { margin-top: 16px; line-height: 1.65; max-width: 44em; }
.doc ul, .doc ol { margin: 16px 0 0; padding-left: 1.3em; max-width: 44em; }
.doc li { margin-top: 8px; line-height: 1.6; }
.doc li::marker { color: var(--link); font-weight: 600; }
.doc li ul { margin-top: 4px; }
.doc a { color: var(--link); text-underline-offset: 3px; }
.doc a.btn { color: var(--accent-ink); }
.doc a.card, .doc .related a, .doc .install a { text-decoration: none; }
.doc code { font: 600 .88em ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace; padding: 2px 8px; border-radius: 6px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); overflow-wrap: anywhere; }
.doc pre.code { margin: 16px 0 0; padding: 16px 16px; border-radius: 12px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; }
.doc pre.code code { padding: 0; background: none; box-shadow: none; font-weight: 500; white-space: pre; overflow-wrap: normal; }
.note { margin-top: 20px; padding: 16px 16px; border-radius: 12px; background: var(--accent-soft); max-width: 44em; }
.note p { margin: 0; }
.note p + p { margin-top: 8px; }
.tbl { margin-top: 20px; overflow-x: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; }
.tbl th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; min-width: 9em; }
.tbl tbody tr:first-child td { border-top: 0; }
/* Таблица от трёх колонок на телефоне не умещается и обрезалась справа. Разворачиваем строки в блоки:
   первая ячейка — заголовок блока, остальные — значение с подписью колонки. */
@media (max-width: 699px) {
  .tbl-wide { overflow: visible; background: none; box-shadow: none; border-radius: 0; }
  .tbl-wide table, .tbl-wide tbody, .tbl-wide tr, .tbl-wide td { display: block; }
  .tbl-wide thead { display: none; }
  .tbl-wide tr { padding: 16px 0; border-top: 1px solid var(--line); }
  .tbl-wide tr:last-child { border-bottom: 1px solid var(--line); }
  .tbl-wide td { padding: 0; border: 0; min-width: 0; }
  .tbl-wide td:first-child { font-weight: 600; font-size: 17px; }
  .tbl-wide td + td { margin-top: 12px; }
  .tbl-wide td + td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 13px; color: var(--muted); font-weight: 600; }
  .tbl-wide td:empty { display: none; }
}
.doc .faq { margin-top: 16px; }
.doc .faq details p { margin-top: 0; }
.doc .install { max-width: 820px; }
.doc-plain > :first-child { margin-top: 0; }
.doc-plain h2:first-child { margin-top: 0; }

/* предложение подписки в тексте */
.cta-inline { margin-top: 24px; padding: 16px 20px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--card-shadow); display: grid; gap: 12px; max-width: 44em; }
.cta-inline b { display: block; font-size: 17px; letter-spacing: 0; }
.cta-inline span { display: block; margin-top: 4px; font-size: 15px; color: var(--muted); }
.cta-inline .btn { justify-self: start; }
.ticks-row { border-top: 0; padding-top: 0; margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.final .wrap > .ticks-row { max-width: none; }

/* блок загрузки */
.dl { margin-top: 24px; padding: 20px; border-radius: 16px; background: var(--accent-soft); max-width: 44em; }
.dl-h { margin: 0 !important; font-weight: 600; font-size: 17px; }
.dl-links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 12px; }
.dl-note { margin-top: 12px !important; font-size: 14px; color: var(--muted); }

/* сбоку на широком экране */
.side { display: none; }
.toc { display: grid; gap: 2px; }
.toc-h { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.toc a { text-decoration: none; font-size: 15px; color: var(--muted); padding: 4px 0 4px 12px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.side-cta { margin-top: 24px; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 8px; }
.side-cta span { font-size: 15px; color: var(--muted); }
.side-cta .btn { justify-self: start; margin-top: 4px; }

/* смотрите также */
.related { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 2px; max-width: 44em; }
.related .mini { margin: 0 0 8px; }
.related a { padding: 8px 0; font-weight: 600; color: var(--text); }
.related a::after { content: " →"; color: var(--link); }
.related a:hover { color: var(--link); }

/* карточки страниц */
/* Страницы раздела — строками с линией, а не плитками: так это читается как оглавление справочника. */
.cards { margin-top: 20px; display: grid; gap: 0 40px; }
.card { display: block; padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.card:hover b { color: var(--link); }
.card b { display: block; font-size: 17px; letter-spacing: 0; }
.card b::after { content: " →"; color: var(--link); font-weight: 600; }
.card span { display: block; margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.hub-h { margin-top: 48px; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.sec-head .sub { margin-top: 8px; }
.more { flex: none; font-size: 15px; font-weight: 600; color: var(--link); text-decoration: none; white-space: nowrap; }
.more::after { content: " →"; }

/* главная справочника */
.home-cta { justify-items: stretch; }
.hero-note { margin-top: 16px; font-size: 14px; color: var(--muted); }
.hero-home h1 { font-size: clamp(34px, 9.6vw, 68px); }
/* оглавление справочника на главной: раздел и ссылки строками */
.index { margin-top: 24px; display: grid; gap: 32px 48px; }
.index h3 { font-size: 20px; }
.index h3 a { text-decoration: none; }
.index ul { list-style: none; margin: 12px 0 0; padding: 0; }
.index li a { display: block; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; font-size: 16px; line-height: 1.35; }
.index li a:hover, .index h3 a:hover { color: var(--link); }
.index .more { display: block; padding-top: 12px; border-top: 1px solid var(--line); }
/* страница подписки: заголовок в одну строку, картинка приложения на телефоне не нужна */
.hero-buy h1 { font-size: clamp(30px, 8.6vw, 60px); }
.hero-sub { margin-top: 12px; font-size: 16px; line-height: 1.4; color: var(--muted); max-width: 30em; }
.hero-buy .buy { margin-top: 20px; }
.hero-buy .app { display: none; }
.steps a { color: inherit; text-decoration-color: var(--line); }
.steps a:hover { color: var(--link); }

.lead-after { margin-top: 24px; font-size: 16px; }

@media (min-width: 560px) {
  .cta-inline { grid-template-columns: 1fr auto; align-items: center; }
  .cards { grid-template-columns: 1fr 1fr; }
  .index { grid-template-columns: 1fr 1fr; }
  .ticks-row { justify-content: start; }
}
@media (min-width: 900px) {
  .subnav { display: none; }
  .brand em { font-size: 12px; }
  .doc-wrap { padding: 40px 0 96px; }
  .doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 64px; align-items: start; }
  .side { display: block; position: sticky; top: 24px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .index { grid-template-columns: repeat(3, 1fr); }
  /* рядом в боковой колонке уже стоит такой же блок; в тексте оставляем только блоки по делу страницы */
  .doc-grid .cta-inline:not(.ctx) { display: none; }
  .hero-buy .app { display: block; margin-top: 48px; }
  .hero-buy .wrap { align-items: start; }
  .foot4 { grid-template-columns: repeat(4, 1fr); }
  .hero .crumbs { margin-bottom: 24px; }
}

/* Снимки экрана приложения: ряд, который на телефоне листается пальцем; нажатие открывает снимок целиком. */
.shots { margin-top: 20px; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding: 2px 2px 8px; max-width: 46em; }
.shot { margin: 0; flex: 0 0 min(62%, 232px); scroll-snap-align: start; }
.shots.one .shot { flex-basis: min(70%, 260px); }
/* экран телевизора: во всю ширину колонки */
.shot.wide, .shots.one .shot.wide { flex: 0 0 min(100%, 600px); }
.shot a { display: block; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-strong); background: var(--soft); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 8px; font-size: 14px; line-height: 1.4; color: var(--muted); }
@media (min-width: 700px) {
  /* на широком экране ряд из двух-трёх снимков помещается целиком, без прокрутки */
  .shots { overflow: visible; }
  .shot { flex: 0 1 232px; min-width: 0; }
  .shots.one .shot { flex: 0 1 260px; }
  .shot.wide, .shots.one .shot.wide { flex: 0 1 600px; }
}

/* Тёмная тема набрана Montserrat — он шире системного шрифта, поэтому заголовки чуть мельче,
   чтобы занимали столько же строк. */
[data-theme="incy"] .hero-home h1 { font-size: clamp(30px, 8.6vw, 56px); }
[data-theme="incy"] .hero-buy h1 { font-size: clamp(28px, 8vw, 52px); }
[data-theme="incy"] .doc h1 { font-size: clamp(28px, 7.4vw, 44px); }
[data-theme="incy"] .doc h2 { font-size: clamp(22px, 5.6vw, 28px); }
[data-theme="incy"] h2 { font-size: clamp(26px, 6.6vw, 38px); }
[data-theme="incy"] .btn { font-size: 16px; }
[data-theme="incy"] .trial span, [data-theme="incy"] .seg span { font-size: 15px; }
[data-theme="incy"] .plan-price { font-size: 48px; }

/* инструменты на страницах (блок ставит seo_build.py по полю шапки tool; логика — site.js) */
.tool { margin-top: 32px; padding: 20px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); max-width: 44em; }
.tool-h { font-size: 19px; font-weight: 700; color: var(--text); }
.doc .tool p.tool-sub, .doc .tool p.tool-note { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.doc .tool p.tool-note { margin-top: 16px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.tool-label { flex: 0 0 100%; font-size: 14px; color: var(--muted); }
.tool-select { flex: 1 1 200px; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--bg); color: var(--text); font: inherit; box-shadow: inset 0 0 0 1px var(--field-edge); }
.tool-row .btn { flex: 0 0 auto; }
.tool-out { display: grid; gap: 8px; margin-top: 16px; }
.tool-out:empty { display: none; }
.tool-field { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.tool-key { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.tool-val { font-size: 17px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.tool-copy { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--accent-soft); color: var(--link); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tool-copy:hover { box-shadow: inset 0 0 0 1px var(--link); }

/* инструменты со ссылками и сборщик правил */
.tool { --tool-err: #b3261e; --tool-warn: #8a5a00; }
[data-theme="incy"] .tool { --tool-err: #ff9a90; --tool-warn: #f0c15a; }
.tool-block { display: block; margin-top: 16px; }
.tool-input, .tool-text { display: block; width: 100%; margin-top: 8px; padding: 12px; border: 0; border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-size: 16px; line-height: 1.45; box-shadow: inset 0 0 0 1px var(--field-edge); }
.tool-input { min-height: 112px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; overflow-wrap: anywhere; }
.tool-text { min-height: 48px; padding-top: 0; padding-bottom: 0; }
.tool-input:focus-visible, .tool-text:focus-visible, .tool-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-wide { display: block; width: 100%; margin-top: 8px; }
.tool-group { margin-top: 16px; }
.tool-group-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.tool-group-head .tool-label { flex: 1 1 auto; }
.tool-group .tool-input { min-height: 84px; }
.doc .tool p.tool-verdict { margin-top: 0; font-size: 17px; line-height: 1.4; font-weight: 700; color: var(--text); }
.doc .tool p.tool-verdict.err { color: var(--tool-err); }
.doc .tool p.tool-verdict.warn { color: var(--tool-warn); }
.tool-issue { display: grid; gap: 4px; padding: 12px; border-radius: 12px; background: var(--soft); box-shadow: inset 4px 0 0 var(--tool-warn), inset 0 0 0 1px var(--line); }
.tool-issue.err { box-shadow: inset 4px 0 0 var(--tool-err), inset 0 0 0 1px var(--line); }
.tool-issue b { font-size: 15px; color: var(--text); overflow-wrap: anywhere; }
.tool-issue span { font-size: 14px; line-height: 1.5; color: var(--muted); }
.tool-pre { margin: 0; padding: 12px; border-radius: 12px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); font: 15px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.tool-out .tool-row { margin-top: 0; }
@media (max-width: 420px) {
  .tool { padding: 16px; }
  .tool-row .btn, .tool-row .tool-copy { flex: 1 1 100%; }
}
