/*
 * Публичные страницы SerpJet (блог, документы, changelog, 404) в стиле Lumen.
 * Палитра совпадает с frontend/panel_v2/src/index.css и static/knowledge_base/kb.css —
 * это проверяет app/test_public_lumen.py. Подключается после static/css/main.css.
 */
:root {
  --brand: #ff2400;
  --brand-strong: #e02000;
  --brand-stronger: #c41c00;
  --brand-ink: #c41c00;
  --brand-soft: #ffe9e5;
  --brand-line: #ffb8a8;
  --brand-tint: #fff4f1;
  --ink: #141722;
  --ink-secondary: #2b303c;
  --ink-muted: #545b6b;
  --ink-subtle: #6b7280;
  --ink-faint: #8f96a3;
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --surface-muted: #eef0f4;
  --line-soft: #eef0f4;
  --line: #e3e6ec;
  --line-strong: #d5d9e1;
  --success-soft: #e8f6ec;
  --success-ink: #15803d;
  --danger-soft: #fce8ee;
  --danger-ink: #a3123a;
  --warning-soft: #fdf6d8;
  --warning-ink: #8a6100;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --header-height: 72px;
}

html { scroll-padding-top: calc(var(--header-height) + 16px); -webkit-text-size-adjust: 100%; }

body.lp-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Onest, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.lp-body > main { flex: 1 0 auto; width: 100%; }
.lp-body [hidden] { display: none !important; }
.lp-body :focus-visible { outline: 3px solid var(--brand-line); outline-offset: 3px; border-radius: 8px; }

.lp-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.lp-wrap--narrow { max-width: 880px; }
.lp-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.lp-skip { position: absolute; left: 16px; top: -100px; z-index: 60; background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); }
.lp-skip:focus { top: 12px; }

/* Кнопки */
.lp-btn {
  height: 44px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; font: 600 15px/1 Onest, Inter, ui-sans-serif, system-ui, sans-serif; text-decoration: none;
  white-space: nowrap; cursor: pointer; transition: background 180ms, border-color 180ms, color 180ms;
}
.lp-btn--lg { height: 52px; padding: 0 24px; font-size: 16px; }
.lp-btn--primary { background: var(--brand-strong); color: #fff; border: 0; }
.lp-btn--primary:hover { background: var(--brand-stronger); color: #fff; }
.lp-btn--ghost { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.lp-btn--ghost:hover { border-color: #b9bfcb; color: var(--ink); }
.lp-btn--plain { background: transparent; border: 0; color: var(--ink); padding: 0 14px; }
.lp-btn--plain:hover { color: var(--brand-ink); }

/* Шапка */
.lp-header { position: sticky; top: 0; z-index: 40; background: rgba(245, 246, 248, .94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.lp-header__inner { height: var(--header-height); display: flex; align-items: center; gap: 28px; }
.lp-logo { display: inline-flex; flex: none; border-radius: 10px; }
.lp-logo img { width: 36px; height: 36px; display: block; }
.lp-nav { display: flex; gap: 2px; flex: 1; align-items: center; min-width: 0; }
.lp-nav a { color: var(--ink-secondary); text-decoration: none; font-weight: 500; padding: 9px 12px; border-radius: 10px; transition: background 180ms, color 180ms; white-space: nowrap; }
.lp-nav a:hover { background: var(--surface-muted); color: var(--ink); }
.lp-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.lp-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lp-actions form { margin: 0; }
.lp-burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.lp-mobile-nav { display: none; border-top: 1px solid var(--line); padding: 8px 16px 16px; background: var(--canvas); }
.lp-mobile-nav[data-open="true"] { display: block; }
.lp-mobile-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--ink-secondary); text-decoration: none; font-weight: 500; border-radius: 10px; }
.lp-mobile-nav a:hover, .lp-mobile-nav a[aria-current="page"] { background: var(--surface-muted); color: var(--ink); }

/* Подвал */
.lp-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: auto; }
.lp-footer__inner { padding-top: 40px; padding-bottom: 32px; display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.lp-footer__brand { display: flex; flex-direction: column; gap: 14px; max-width: 320px; }
.lp-footer__brand img { width: 32px; height: 32px; }
.lp-footer__brand p { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.lp-footer__title { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-subtle); }
.lp-footer ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lp-footer a { color: var(--ink-secondary); text-decoration: none; font-size: 14px; }
.lp-footer a:hover { color: var(--brand-ink); }
.lp-footer__legal { border-top: 1px solid var(--line-soft); }
.lp-footer__legal .lp-wrap { padding-top: 18px; padding-bottom: 22px; font-size: 13px; line-height: 18px; color: var(--ink-subtle); }

/* Сообщения */
.lp-messages { padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.lp-message { border-radius: 12px; padding: 12px 16px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.lp-message--success { background: var(--success-soft); border-color: #bfe5cb; color: var(--success-ink); }
.lp-message--error { background: var(--danger-soft); border-color: #f4c3d1; color: var(--danger-ink); }

/* Общие элементы страниц */
.lp-page { padding-top: 48px; padding-bottom: 72px; }
.lp-kicker { margin: 0; font-size: 13px; font-weight: 600; color: var(--brand-ink); letter-spacing: .04em; text-transform: uppercase; }
.lp-h1 { margin: 0; font-size: 44px; line-height: 50px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.lp-h2 { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.lp-lead { margin: 0; font-size: 18px; line-height: 28px; color: var(--ink-muted); max-width: 720px; }
.lp-muted { color: var(--ink-muted); }
.lp-page-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.lp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.lp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 20px; font-size: 14px; color: var(--ink-subtle); }
.lp-crumbs a { color: var(--ink-muted); text-decoration: none; }
.lp-crumbs a:hover { color: var(--brand-ink); }
.lp-crumbs [aria-current] { color: var(--ink-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Чипы рубрик */
.lp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-secondary); font-size: 14px; font-weight: 500; text-decoration: none; transition: border-color 180ms, color 180ms, background 180ms; }
.lp-chip:hover { border-color: var(--brand-line); color: var(--brand-ink); }
.lp-chip[aria-current="page"] { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); font-weight: 600; }
.lp-chip--sm { min-height: 26px; padding: 0 10px; font-size: 12px; }
.lp-chips-more { margin-top: 10px; background: none; border: 0; padding: 4px 0; font: 500 14px Onest, Inter, sans-serif; color: var(--ink-muted); cursor: pointer; }
.lp-chips-more:hover { color: var(--brand-ink); }
.lp-chips[hidden] { display: none; }

/* Карточки статей блога */
.lp-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lp-post {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  color: var(--ink); text-decoration: none; transition: border-color 220ms var(--ease), transform 220ms var(--ease), box-shadow 220ms var(--ease);
}
.lp-post:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 18px 40px -28px rgba(20, 23, 34, .35); color: var(--ink); }
.lp-post--featured { grid-column: span 2; padding: 32px; background: linear-gradient(180deg, var(--brand-tint), var(--surface) 60%); border-color: #ffd3ca; }
.lp-post__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-subtle); font-variant-numeric: tabular-nums; }
.lp-post__cat { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); }
.lp-post__title { margin: 0; flex: 1; font-size: 18px; line-height: 25px; font-weight: 700; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color 180ms; }
.lp-post--featured .lp-post__title { font-size: 28px; line-height: 34px; letter-spacing: -.02em; flex: none; }
.lp-post:hover .lp-post__title { color: var(--brand-ink); }
.lp-post__desc { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-post--featured .lp-post__desc { font-size: 16px; line-height: 25px; -webkit-line-clamp: 3; }
.lp-post__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-subtle); }
.lp-post__more { font-size: 14px; font-weight: 600; color: var(--brand-ink); transition: transform 180ms var(--ease); }
.lp-post:hover .lp-post__more { transform: translateX(3px); }
.lp-post__tags { display: flex; flex-wrap: wrap; gap: 6px; }

.lp-pager { margin-top: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.lp-pager span { padding: 0 12px; font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.lp-empty { padding: 40px; text-align: center; color: var(--ink-muted); }

/* Статья блога */
.lp-progress { position: fixed; top: 0; left: 0; z-index: 60; height: 3px; width: 0; background: var(--brand); transition: width 80ms linear; }
.lp-article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
.lp-article { min-width: 0; }
.lp-article__head { margin-bottom: 32px; display: flex; flex-direction: column; gap: 16px; }
.lp-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; color: var(--ink-subtle); }
.lp-article__meta .lp-dot { color: var(--line-strong); }
.lp-article__updated { color: var(--success-ink); font-weight: 500; }
.lp-article__title { margin: 0; font-size: 40px; line-height: 46px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.lp-author { display: flex; align-items: center; gap: 12px; }
.lp-author__avatar { width: 40px; height: 40px; border-radius: 9999px; background: var(--brand-strong); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.lp-author__name { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 20px; }
.lp-author__role { margin: 0; font-size: 13px; color: var(--ink-subtle); line-height: 18px; }
.lp-article__body { padding: 40px; }
.lp-article__back { margin-top: 24px; }
.lp-article__back a { font-weight: 600; color: var(--brand-ink); text-decoration: none; }
.lp-article__back a:hover { text-decoration: underline; text-underline-offset: 3px; }
.lp-editorial { margin-bottom: 16px; padding: 20px 24px; border-radius: 16px; background: var(--brand-tint); border: 1px solid #ffd3ca; }

.lp-aside { position: sticky; top: calc(var(--header-height) + 24px); display: flex; flex-direction: column; gap: 16px; }
.lp-toc { overflow: hidden; }
.lp-toc__head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.lp-toc__body { max-height: 44vh; overflow-y: auto; padding: 8px 10px 12px; }
.lp-toc ol { list-style: none; margin: 0; padding: 0; }
.lp-toc a { display: block; padding: 6px 10px; border-left: 2px solid transparent; border-radius: 0 8px 8px 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); text-decoration: none; transition: color 150ms, border-color 150ms, background 150ms; }
.lp-toc a.is-sub { padding-left: 22px; font-size: 13px; }
.lp-toc a:hover { color: var(--ink); background: var(--surface-subtle); }
.lp-toc a.is-active { color: var(--brand-ink); border-left-color: var(--brand); background: var(--brand-tint); font-weight: 600; }
.lp-toc-mobile { display: none; margin-bottom: 16px; }
.lp-toc-mobile summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 15px; }
.lp-toc-mobile summary::-webkit-details-marker { display: none; }
.lp-toc-mobile[open] summary svg { transform: rotate(180deg); }
.lp-toc-mobile summary svg { transition: transform 200ms var(--ease); color: var(--ink-subtle); }
.lp-toc-mobile .lp-toc__body { max-height: none; border-top: 1px solid var(--line-soft); }

.lp-cta { padding: 22px; display: flex; flex-direction: column; gap: 12px; background: var(--brand-tint); border: 1px solid #ffd3ca; border-radius: 20px; }
.lp-cta__title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; color: var(--ink); }
.lp-cta__text { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-secondary); }
.lp-cta__bonus { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9999px; background: var(--surface); border: 1px solid #ffd3ca; font-size: 13px; font-weight: 600; color: var(--brand-ink); }
.lp-cta .lp-btn { width: 100%; }
.lp-cta--inline { display: none; margin-top: 24px; }

.lp-related { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.lp-related .lp-h2 { margin-bottom: 20px; }

/* Текст статьи */
.lp-prose { font-size: 17px; line-height: 1.75; color: var(--ink-secondary); overflow-wrap: break-word; }
.lp-prose > :first-child { margin-top: 0; }
.lp-prose > :last-child { margin-bottom: 0; }
.lp-prose p { margin: 0 0 1.1em; }
.lp-prose h2, .lp-prose h3, .lp-prose h4 { color: var(--ink); font-weight: 700; letter-spacing: -.015em; scroll-margin-top: calc(var(--header-height) + 20px); }
.lp-prose h2 { margin: 1.9em 0 .7em; font-size: 26px; line-height: 1.3; }
.lp-prose h3 { margin: 1.6em 0 .6em; font-size: 20px; line-height: 1.35; }
.lp-prose h4 { margin: 1.4em 0 .5em; font-size: 17px; line-height: 1.4; }
.lp-prose a { color: var(--brand-ink); text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 3px; }
.lp-prose a:hover { text-decoration-color: currentColor; }
.lp-prose strong { color: var(--ink); font-weight: 600; }
.lp-prose ul, .lp-prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.lp-prose ul { list-style: disc; }
.lp-prose ol { list-style: decimal; }
.lp-prose ul ul { list-style: circle; }
.lp-prose li { margin: .35em 0; }
.lp-prose li::marker { color: var(--brand); }
.lp-prose blockquote { margin: 1.5em 0; padding: 14px 20px; border-left: 3px solid var(--brand); background: var(--surface-subtle); border-radius: 0 12px 12px 0; color: var(--ink-muted); }
.lp-prose blockquote p:last-child { margin-bottom: 0; }
.lp-prose img, .lp-prose video { max-width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line-soft); }
.lp-prose figure { margin: 1.6em 0; }
.lp-prose figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-subtle); text-align: center; }
.lp-prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--surface-muted); color: var(--ink); padding: .12em .4em; border-radius: 6px; }
.lp-prose pre { margin: 1.4em 0; padding: 16px 18px; overflow-x: auto; background: var(--ink); color: #f5f6f8; border-radius: 14px; font-size: 14px; line-height: 1.6; }
.lp-prose pre code { background: none; color: inherit; padding: 0; }
.lp-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.lp-prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15px; line-height: 1.5; display: block; overflow-x: auto; }
.lp-prose th, .lp-prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lp-prose th { background: var(--surface-subtle); color: var(--ink); font-weight: 600; }

/* 404 */
.lp-error { min-height: 60vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 64px 0; }
.lp-error__code { margin: 0; font-size: 120px; line-height: 1; font-weight: 800; letter-spacing: -.05em; color: var(--brand); user-select: none; }
.lp-error__actions { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/*
 * Слой совместимости для страниц со старыми Tailwind-классами (оферта, политика,
 * whitepaper, плагин WordPress, changelog): оранжевый акцент старого сайта
 * заменяется на красный Lumen, тёмно-синий — на чернила Lumen.
 */
.lp-body .text-\[\#1C1917\], .lp-body .text-\[\#0f172a\] { color: var(--ink); }
.lp-body .bg-\[\#0f172a\], .lp-body .bg-\[\#0f1e2e\] { background-color: var(--ink); }
.lp-body .text-\[\#EA580C\], .lp-body .text-primary-600, .lp-body .text-orange-500, .lp-body .text-orange-600, .lp-body .text-orange-700 { color: var(--brand-ink); }
.lp-body .text-orange-400, .lp-body .text-orange-300 { color: #ff8a73; }
.lp-body .text-orange-100 { color: var(--brand-soft); }
.lp-body .text-orange-950 { color: #5c1206; }
.lp-body .text-orange-950\/75 { color: rgba(92, 18, 6, .75); }
.lp-body .hover\:text-orange-700:hover, .lp-body .hover\:text-orange-800:hover, .lp-body .hover\:text-\[\#C2410C\]:hover { color: var(--brand-stronger); }
.lp-body .bg-\[\#EA580C\], .lp-body .bg-primary-600, .lp-body .bg-orange-500, .lp-body .bg-orange-600 { background-color: var(--brand-strong); }
.lp-body .bg-orange-400 { background-color: var(--brand); }
.lp-body .hover\:bg-\[\#C2410C\]:hover, .lp-body .hover\:bg-primary-700:hover, .lp-body .hover\:bg-primary-500:hover, .lp-body .hover\:bg-orange-600:hover { background-color: var(--brand-stronger); }
.lp-body .bg-orange-50, .lp-body .from-orange-50 { background-color: var(--brand-tint); }
.lp-body .bg-orange-50\/40, .lp-body .bg-orange-50\/60, .lp-body .bg-orange-50\/90 { background-color: rgba(255, 244, 241, .8); }
.lp-body .bg-orange-100, .lp-body .hover\:bg-orange-100:hover, .lp-body .hover\:bg-orange-50:hover { background-color: var(--brand-soft); }
.lp-body .bg-orange-500\/10, .lp-body .bg-orange-500\/15, .lp-body .bg-orange-500\/20, .lp-body .bg-orange-900\/10 { background-color: rgba(255, 36, 0, .14); }
.lp-body .border-orange-100, .lp-body .border-orange-200, .lp-body .hover\:border-orange-200:hover { border-color: #ffd3ca; }
.lp-body .hover\:border-orange-400:hover { border-color: var(--brand-line); }
.lp-body .border-orange-500\/30, .lp-body .border-orange-500\/40 { border-color: rgba(255, 36, 0, .35); }
.lp-body .decoration-orange-300 { text-decoration-color: var(--brand-line); }
.lp-body .focus\:border-primary-500:focus { border-color: var(--brand); }
.lp-body .focus\:ring-primary-500:focus { --tw-ring-color: var(--brand); }
.lp-body .shadow-\[\#EA580C\]\/30, .lp-body .shadow-\[\#C2410C\]\/30, .lp-body .hover\:shadow-\[\#EA580C\]\/50:hover, .lp-body .hover\:shadow-\[\#C2410C\]\/50:hover { --tw-shadow-color: rgba(255, 36, 0, .3); }
.lp-body .shadow-\[\#EA580C\]\/20 { --tw-shadow-color: rgba(255, 36, 0, .2); }
.lp-body .focus\:ring-\[\#EA580C\]\/50:focus { --tw-ring-color: rgba(255, 36, 0, .5); }
.lp-body .text-\[\#FB923C\] { color: #ff8a73; }
.lp-body .hover\:text-\[\#FDBA74\]:hover { color: var(--brand-line); }
.lp-body .gradient-text { background: linear-gradient(135deg, var(--brand) 0%, #ff6a4d 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.lp-body .rounded-xl.border-slate-200, .lp-body .rounded-2xl.border-slate-200 { border-color: var(--line); }

@media (max-width: 1080px) {
  .lp-article-layout { grid-template-columns: minmax(0, 1fr); }
  .lp-aside { display: none; }
  .lp-toc-mobile { display: block; }
  .lp-cta--inline { display: flex; }
}
@media (max-width: 1000px) {
  .lp-nav { display: none; }
  .lp-burger { display: inline-flex; }
  .lp-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .lp-wrap { padding-left: 16px; padding-right: 16px; }
  .lp-header__inner { gap: 12px; }
  .lp-actions .lp-btn { padding: 0 12px; font-size: 14px; }
  .lp-actions .lp-btn--plain { display: none; }
  .lp-page { padding-top: 32px; padding-bottom: 56px; }
  .lp-h1 { font-size: 32px; line-height: 38px; }
  .lp-h2 { font-size: 24px; line-height: 30px; }
  .lp-lead { font-size: 16px; line-height: 25px; }
  .lp-posts { grid-template-columns: minmax(0, 1fr); }
  .lp-post--featured { grid-column: auto; padding: 24px; }
  .lp-post--featured .lp-post__title { font-size: 22px; line-height: 28px; }
  .lp-article__title { font-size: 30px; line-height: 36px; }
  .lp-article__body { padding: 22px 18px; }
  .lp-prose { font-size: 16px; }
  .lp-prose h2 { font-size: 22px; }
  .lp-prose h3 { font-size: 18px; }
  .lp-footer__inner { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .lp-error__code { font-size: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lp-body *, .lp-body *::before, .lp-body *::after { transition: none !important; animation: none !important; }
}

/* White Paper «Как работает SerpJet» */
.lw-hero { padding: 40px; display: flex; flex-direction: column; gap: 16px; background: linear-gradient(180deg, var(--brand-tint), var(--surface) 70%); border-color: #ffd3ca; }
.lw-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.lw-facts { margin: 8px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lw-facts li { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.lw-facts strong { font-size: 15px; color: var(--ink); }
.lw-facts span { font-size: 13px; line-height: 19px; color: var(--ink-muted); }
.lw-layout { margin-top: 40px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
.lw-toc { position: sticky; top: calc(var(--header-height) + 24px); }
.lw-toc ol { counter-reset: lw; }
.lw-body { min-width: 0; display: flex; flex-direction: column; gap: 56px; }
.lw-section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: calc(var(--header-height) + 20px); }
.lw-text { margin: 0; font-size: 16px; line-height: 27px; color: var(--ink-secondary); max-width: 760px; }
.lw-text a, .lw-tile a { color: var(--brand-ink); text-underline-offset: 3px; }
.lw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; margin-top: 4px; }
.lw-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.lw-tile { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.lw-tile h3, .lw-principle h3, .lw-steps h3 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); }
.lw-tile p, .lw-principle p, .lw-steps p { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.lw-steps { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.lw-steps li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.lw-step-n { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.lw-callout { padding: 20px 22px; border-radius: 20px; background: var(--brand-tint); border: 1px solid #ffd3ca; display: flex; flex-direction: column; gap: 10px; }
.lw-callout p { margin: 0; font-size: 15px; line-height: 25px; color: var(--ink-secondary); }
.lw-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.lw-list li { position: relative; padding-left: 22px; font-size: 15px; line-height: 25px; color: var(--ink-muted); }
.lw-list li::before { content: ""; position: absolute; left: 4px; top: 10px; width: 7px; height: 7px; border-radius: 9999px; background: var(--brand); }
.lw-list strong { color: var(--ink); font-weight: 600; }
.lw-principle { padding: 18px 20px; border-radius: 16px; background: var(--surface-subtle); border: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.lw-final { padding: 32px; }
.lw-final .lp-btn { width: auto; }
@media (max-width: 1080px) {
  .lw-layout { grid-template-columns: minmax(0, 1fr); }
  .lw-toc { display: none; }
  .lw-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .lw-hero { padding: 24px 20px; }
  .lw-facts { grid-template-columns: minmax(0, 1fr); }
  .lw-body { gap: 44px; }
  .lw-final { padding: 22px; }
}
