/* B-Pass — журнал PassTicket. Общий лист для ленты, страниц тем и всех статей. */

:root {
  --blue: #0068ff;
  --blue-strong: #0054d6;
  --blue-deep: #003ea3;
  --accent: #ff5a3c;
  /* Заливке контраст не нужен, тексту нужен: фирменные тона на светлом фоне дают 2.9:1 и 4.4:1. */
  --blue-ink: #0057db;
  --accent-ink: #cc3a11;

  --ink: #07111f;
  --ink-soft: #22354f;
  --muted: #5d6c80;
  --line: #dde5ee;
  --line-strong: #c6d3e1;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --tint: #e9f1ff;

  --bar-bg: rgb(255 255 255 / 88%);
  --shadow-soft: 0 8px 24px rgb(20 43 75 / 8%);

  --radius: 18px;
  --radius-sm: 12px;
  --measure: 660px;
  --rail: 236px;
  --page: 980px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  /* Моноширинный — «служебный» голос издания: рубрика, время чтения, счётчики, шапки таблиц. */
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --blue-ink: #4d94ff;
    --accent-ink: #ff7a52;
    --ink: #e9edf2;
    --ink-soft: #c1cad6;
    --muted: #94a0b0;
    --line: #262b34;
    --line-strong: #39404b;
    --bg: #0c0f14;
    --surface: #171b21;
    --surface-soft: #1d222a;
    --tint: #16253c;
    --bar-bg: rgb(12 15 20 / 86%);
    --shadow-soft: 0 8px 24px rgb(0 0 0 / 40%);
  }
}
:root[data-theme='dark'] {
  --blue-ink: #4d94ff;
  --accent-ink: #ff7a52;
  --ink: #e9edf2;
  --ink-soft: #c1cad6;
  --muted: #94a0b0;
  --line: #262b34;
  --line-strong: #39404b;
  --bg: #0c0f14;
  --surface: #171b21;
  --surface-soft: #1d222a;
  --tint: #16253c;
  --bar-bg: rgb(12 15 20 / 86%);
  --shadow-soft: 0 8px 24px rgb(0 0 0 / 40%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
::selection { background: rgb(0 104 255 / 20%); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--accent);
  z-index: 60;
  will-change: transform;
}

/* ── Шапка издания ───────────────────────────────────────────────────────── */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 11px;
  padding-inline: max(24px, (100% - 1346px) / 2);
  --head-ink: #2b1a02;
  background: linear-gradient(150deg, #ffc814 0%, #ff9605 100%);
  color: var(--head-ink);
  box-shadow: 0 2px 14px -6px rgb(120 70 0 / 45%);
}
/* Обе половины шапки не переносятся, поэтому ужиматься обязана именно эта — иначе они наезжают. */
.masthead {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}
.blog-logo { height: 26px; width: auto; align-self: center; }
.blog-header .blog-logo { filter: brightness(0); opacity: .9; }

.blog-header .nav { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.blog-header .nav a {
  color: rgb(43 26 2 / 78%);
  font-weight: 650;
  font-size: 14.5px;
  padding: 8px 12px;
  border-radius: 9px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease;
}
.blog-header .nav a:hover { color: var(--head-ink); background: rgb(255 255 255 / 42%); }

.theme-toggle {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 9px;
  border: 0;
  background: none;
  color: inherit;
  transition: background .16s ease;
}
.theme-toggle:hover { background: rgb(255 255 255 / 42%); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }

/* ── Крошки: одни и те же на статье, ленте и теме ────────────────────────── */
.crumbs {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 18px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue-ink); }

/* ── Заголовок статьи ────────────────────────────────────────────────────── */
/* Класс `hero` на .art-head правил не несёт, но его требует _a.js: заголовок для шеринга он берёт из `.hero h1`. */
.art-head {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 46px) 20px clamp(20px, 3vw, 30px);
  text-align: center;
}
/* Рубрика ссылкой: из статьи должен быть вход в раздел, а не только выход домой. */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  text-decoration: none;
}
.kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--accent-ink);
}
.kicker:hover { color: var(--ink); }
.kicker:hover::before { background: var(--ink); }

.art-head h1 {
  max-width: 15em;
  margin: 14px auto 0;
  font-size: clamp(29px, 4.4vw, 48px);
  line-height: 1.06;
  letter-spacing: -.03em;
  font-weight: 850;
  color: var(--ink);
  overflow-wrap: break-word;
}
.art-head .lead {
  max-width: 34em;
  margin: 18px auto 0;
  font-size: clamp(17.5px, 1.6vw, 21px);
  line-height: 1.52;
  font-weight: 400;
  color: var(--ink-soft);
}
.art-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
}
.art-author-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--surface-soft);
}
.art-author-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.art-author-name { font-size: 15.5px; font-weight: 750; color: var(--ink); }
.art-author-bio { font-size: 13.5px; font-weight: 500; line-height: 1.4; color: var(--muted); }
.art-author-bio a { color: var(--blue-ink); text-decoration: none; }
.art-author-bio a:hover { text-decoration: underline; }
.art-read {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .02em;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.art-cover {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 20px;
}
/* height:auto обязателен: атрибут height у <img> — презентационная подсказка, и без него она бьёт aspect-ratio. */
.art-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 420;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

/* ── Текст и оглавление ──────────────────────────────────────────────────── */
/* Колонки тянутся на всю высоту ряда: у липкого оглавления иначе нет запаса хода и оно не липнет. */
.art-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: clamp(28px, 4vw, 52px);
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) 20px 64px;
}
/* min-width:0 обязателен: иначе широкая таблица растягивает страницу вместо прокрутки внутри .tbl. */
.article {
  max-width: var(--measure);
  min-width: 0;
  overflow-wrap: anywhere;
}
.article > h2:first-child,
.article > p:first-child { margin-top: 0; }

.article h2 {
  font-size: clamp(22px, 2.5vw, 27px);
  line-height: 1.22;
  font-weight: 800;
  margin: 54px 0 14px;
  letter-spacing: -.02em;
  color: var(--ink);
  text-align: center;
  scroll-margin-top: 88px;
}
.article h3 {
  font-size: clamp(17.5px, 2vw, 20px);
  line-height: 1.32;
  font-weight: 750;
  margin: 32px 0 8px;
  letter-spacing: -.012em;
  color: var(--ink);
}
.article p, .article li {
  font-size: 18px;
  line-height: 1.78;
  color: var(--ink-soft);
}
.article p { margin: 0 0 20px; }
.article a {
  color: var(--blue-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(0 104 255 / 32%);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color .16s ease;
}
.article a:hover { text-decoration-color: var(--blue-ink); }
.article strong { color: var(--ink); font-weight: 700; }
.article em { font-style: italic; }

.article ul { list-style: none; padding: 0; margin: 20px 0; }
.article ul > li { position: relative; padding-left: 22px; margin: 10px 0; }
.article ul > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .78em;
  width: 6px;
  height: 6px;
  background: var(--line-strong);
}
.article ol { list-style: none; counter-reset: steps; padding: 0; margin: 20px 0; }
.article ol > li {
  counter-increment: steps;
  position: relative;
  padding-left: 38px;
  margin: 14px 0;
}
.article ol > li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: .18em;
  width: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
}

/* Тени по краям показывают, что таблица прокручивается: слои `local` уезжают вместе с содержимым. */
.article .tbl {
  overflow-x: auto;
  margin: 24px 0;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--bg) 40%, transparent) left center / 36px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 40%, transparent) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(10 20 40 / 14%), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(10 20 40 / 14%), transparent) right center / 12px 100% no-repeat scroll;
}
.article table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: 16px; }
.article th, .article td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  line-height: 1.5;
}
.article th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.article thead th { border-bottom: 1px solid var(--line-strong); }
.article td { color: var(--ink-soft); }
.article tbody tr:last-child td { border-bottom: 0; }
.article td:first-child { color: var(--ink); font-weight: 650; white-space: nowrap; }

.article blockquote {
  margin: 32px 0;
  padding: 2px 0 2px 24px;
  border-left: 3px solid var(--accent);
  font-size: clamp(19px, 2.4vw, 22px);
  line-height: 1.48;
  font-weight: 500;
  color: var(--ink);
}
.article blockquote p { font-size: inherit; line-height: inherit; color: inherit; margin: 0 0 8px; }
.article blockquote p:last-child { margin: 0; }

.blog-photo { margin: 32px 0; }
.blog-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.blog-photo figcaption {
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: .04em;
  color: var(--muted);
}


/* ── Оглавление ──────────────────────────────────────────────────────────── */
.toc-inner { position: sticky; top: 96px; }
.toc-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.toc nav {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--line);
}
.toc nav a {
  position: relative;
  overflow-wrap: break-word;
  padding: 8px 0 8px 16px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.4;
  font-weight: 550;
  text-decoration: none;
  transition: color .15s ease;
}
.toc nav a::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: transparent;
  transition: background .15s ease;
}
.toc nav a:hover { color: var(--blue-ink); }
.toc nav a:hover::before { background: var(--blue); }

/* ── Призыв ──────────────────────────────────────────────────────────────── */
/* Небо с самолётиками — то же, что в блоке ленты и на баннере сайта. */
.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin: 44px 0 8px;
  padding: clamp(26px, 3vw, 36px) clamp(28px, 19%, 160px);
  border-radius: var(--radius);
  background: #0068ff url('/blog/cta-sky.svg?v=3') center / 100% 100% no-repeat;
  color: #fff;
  text-decoration: none;
}
.cta b, .cta > span:not(.go) { position: relative; text-shadow: 0 2px 10px rgb(8 40 100 / 35%); }
.cta b { color: #fff; font-size: clamp(20px, 2vw, 24px); font-weight: 850; letter-spacing: -.02em; text-wrap: balance; }
.cta > span:not(.go) { color: #fff; opacity: .94; font-size: 15px; line-height: 1.5; }
.cta .go {
  margin-top: 6px;
  display: inline-block;
  background: #fff;
  color: #0068ff;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 20px -12px rgb(0 20 60 / 65%);
}
.article a.cta { text-decoration: none; }
.cta:hover .go { background: var(--tint); }

/* ── Частые вопросы ──────────────────────────────────────────────────────── */
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 2px 0;
}
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 15px 28px 15px 0;
  list-style: none;
  font-size: 16.5px;
  line-height: 1.4;
  color: var(--ink);
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .18s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq summary:hover { color: var(--blue-ink); }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); font-size: 16px; line-height: 1.65; }

/* ── Поделиться ──────────────────────────────────────────────────────────── */
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 44px 0 4px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.share .share-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 2px;
}
.share a, .share button {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color .16s ease, border-color .16s ease;
}
.share a:hover, .share button:hover { color: var(--blue-ink); border-color: var(--line-strong); }
.share svg { width: 16px; height: 16px; }
.share .copied { color: var(--blue-ink); border-color: var(--blue-ink); }

/* ── Читайте также ───────────────────────────────────────────────────────── */
.related { margin: 46px 0 4px; }
.related h2 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.related h2::before { display: none; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.related-card {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease;
}
.related-card:hover { border-color: var(--blue-ink); }
/* Миниатюру прячет сам _a.js, если файла нет: обложка есть у всех 146, но правило пусть переживёт новую статью. */
.related-card { flex-direction: column; overflow: hidden; }
/* min-height у флекс-элемента auto: без нуля картинка распирала миниатюру и ломала сетку. */
.related-card .thumb { aspect-ratio: 1200 / 630; flex: none; min-height: 0; overflow: hidden; background: var(--surface-soft); }
.related-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-card .rt {
  padding: 14px 16px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: break-word;
}
.article a.related-card, .article a.related-card .rt { text-decoration: none; }

/* ── Подвал статьи ───────────────────────────────────────────────────────── */
.blog-foot {
  border-top: 1px solid var(--line);
  margin-top: 36px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}
.blog-foot a { color: var(--blue-ink); text-decoration: none; font-weight: 600; }
.blog-foot a:hover { text-decoration: underline; }
.blog-foot.is-enhanced { display: none; }
.related .blog-foot { margin-top: 22px; text-align: center; }

.site-foot {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}
.site-foot-inner {
  width: min(1346px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 40px;
  display: grid;
  grid-template-columns: 1.05fr .9fr 1.5fr 1.5fr;
  gap: 40px;
  align-items: start;
}
.foot-brand { display: inline-flex; }
.foot-brand img { height: 48px; width: auto; display: block; }
:root[data-theme='dark'] .foot-brand img { content: url("/blog/foot-logo-dark.png"); filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .foot-brand img { content: url("/blog/foot-logo-dark.png"); filter: brightness(0) invert(1); }
}
.foot-socials { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.foot-social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}
.foot-social:hover { color: #fff; background: var(--blue); border-color: transparent; transform: translateY(-2px); }
.foot-nav-col { display: flex; flex-direction: column; gap: 2px; }
.foot-nav-col a {
  padding: 6px 0; color: var(--muted); text-decoration: none;
  font-size: 15px; font-weight: 600; transition: color .15s ease;
}
.foot-nav-col a:hover { color: var(--blue-ink); }
.foot-products-col { display: flex; flex-direction: column; gap: 4px; }
.foot-product {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px; margin: 0 -10px; border-radius: var(--radius-sm);
  text-decoration: none; color: inherit; transition: background .15s ease;
}
.foot-product:hover { background: var(--surface-soft); }
.foot-product-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none; border-radius: 12px;
  background: rgb(0 104 255 / 12%); color: var(--blue-ink);
}
.foot-product-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.foot-product-text strong { font-size: 15px; font-weight: 750; color: var(--ink); }
.foot-product-text span { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.foot-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  padding: 16px 18px; border-radius: 16px;
  border: 1px solid var(--line); background: transparent;
  text-align: center;
  transition: border-color .15s ease, transform .15s ease;
}
.foot-card:hover { transform: translateY(-1px); }
.foot-card strong { display: block; margin-bottom: 2px; font-size: 15px; font-weight: 700; color: var(--ink); }
.foot-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.foot-contact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; width: 100%; }
.foot-contact-btn {
  -webkit-appearance: none; appearance: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-width: 0; min-height: 34px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.foot-contact-btn:hover { border-color: var(--line-strong); }
.foot-contact-btn.is-copied { background: var(--tint); border-color: var(--blue-ink); color: var(--blue-ink); }
.foot-contact-btn.is-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.foot-contact-btn.is-primary:hover { background: var(--blue-strong); border-color: var(--blue-strong); }

@media (max-width: 900px) {
  .site-foot-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 620px) {
  .site-foot-inner { width: calc(100% - 36px); grid-template-columns: 1fr; gap: 24px; padding: 30px 0 24px; text-align: center; justify-items: center; }
  .foot-brand, .foot-socials { justify-content: center; }
  .foot-nav-col, .foot-products-col { align-items: center; }
  .foot-product { flex-direction: column; gap: 8px; margin: 0; width: 100%; max-width: 320px; text-align: center; }
  .foot-product-text { align-items: center; }
  .foot-cta-col { width: 100%; }
  .foot-contact-btn { flex: 1 1 auto; }
}

.cookie-notice {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px;
  width: min(520px, calc(100vw - 24px));
  padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-soft);
}
.cookie-notice p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.cookie-notice a { color: var(--blue-ink); text-decoration: none; font-weight: 600; }
.cookie-notice a:hover { text-decoration: underline; }
.cookie-notice-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.cookie-notice button {
  -webkit-appearance: none; appearance: none; cursor: pointer; font-family: inherit;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 700;
  transition: background .15s ease, border-color .15s ease;
}
.cookie-notice .cookie-accept { background: var(--blue); border-color: var(--blue); color: #fff; }
.cookie-notice .cookie-accept:hover { background: var(--blue-strong); border-color: var(--blue-strong); }
.cookie-notice .cookie-decline:hover { border-color: var(--line-strong); }

@media (max-width: 620px) {
  .cookie-notice { flex-direction: column; align-items: stretch; gap: 10px; bottom: 10px; }
  .cookie-notice-actions { margin-left: 0; }
  .cookie-notice button { flex: 1 1 auto; }
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--blue-ink);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--tint); }
.to-top svg { width: 19px; height: 19px; }

/* ── Узкие экраны ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .art-cols { grid-template-columns: 1fr; gap: 26px; }
  /* Оглавление уезжает НАД текстом: липкой колонке на телефоне жить негде. */
  .toc { order: -1; }
  .toc-inner {
    position: static;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .toc nav { border-left: 0; }
  .toc nav a { padding: 7px 0; }
  .toc nav a::before { display: none; }
  .article { max-width: none; }
}

@media (max-width: 640px) {
  /* Те же 44 px в шапке статьи: «Все статьи» и переключатель темы — основные цели на телефоне. */
  .blog-header .nav a { min-height: 44px; display: inline-flex; align-items: center; }
  .theme-toggle { width: 44px; height: 44px; }
  .blog-header { padding: 10px 14px; }
  .blog-header .nav a { padding: 8px 10px; font-size: 14px; }
  .art-head { padding: 22px 18px 16px; }
  .art-cover { padding: 0 18px; }
  .art-cover img { aspect-ratio: 16 / 9; }
  .art-meta { display: grid; grid-template-columns: 56px minmax(0, max-content); justify-content: center; column-gap: 12px; row-gap: 10px; }
  .art-author-text { justify-self: start; }
  .art-read { grid-column: 1 / -1; justify-self: center; padding-left: 0; border-left: 0; }
  .art-cols { padding: 24px 18px 52px; }
  .article p, .article li { font-size: 17px; line-height: 1.72; }
  .article h2 { margin: 42px 0 12px; }
  .cta { padding: 22px 20px; background-image: none; }
  /* white-space обязателен: длинная надпись кнопки не переносится и распирает страницу вбок. */
  .cta .go { width: 100%; white-space: normal; }
  /* Таблица на телефоне переносит строки вместо горизонтальной прокрутки. */
  .article table { min-width: 0; font-size: 15px; }
  .article th, .article td { padding: 10px 10px; white-space: normal; }
  .article td:first-child { white-space: normal; }
  .to-top { right: 14px; bottom: 14px; }
}

