/* Прорвемся! — единственный CSS-файл сайта. */

/* Onest — гротеск с кириллицей, лежит у нас же на сервере.
   Два файла вместо одного: латиница и кириллица разделены, браузер
   скачает только нужный набор. swap — текст виден сразу системным
   шрифтом и переключается, когда файл доедет: пустых заголовков не бывает. */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/assets/fonts/onest-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/assets/fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-card: #ffffff;
  --fg: #16181d;
  --fg-muted: #626a76;
  --fg-faint: #8b93a1;
  --line: #e4e7ec;
  --accent: #d6452b;
  --accent-soft: #fdeeeb;
  /* Заливка кнопок отдельно от акцента: белый текст на светлом акценте
     даёт контраст 2.8 при норме 4.5, и надпись плывёт. */
  --btn-bg: #c23a1f;
  --btn-fg: #ffffff;
  --tg-bg: #14688f;
  --tg-fg: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 20, 28, .05), 0 8px 24px rgba(16, 20, 28, .05);
  --wrap: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Georgia", "Times New Roman", serif;
  /* Шрифт заголовков */
  --font-display: 'Onest', var(--font);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --bg-soft: #161920;
    --bg-card: #171a21;
    --fg: #e8eaed;
    --fg-muted: #9aa3b2;
    --fg-faint: #6f7889;
    --line: #262b35;
    --accent: #ff6a4d;
    --accent-soft: #2a1a16;
    /* В тёмной теме акцент яркий — на нём читается тёмный текст,
       а не белый. Контраст вырастает с 2.8 до 7. */
    --btn-bg: #ff6a4d;
    --btn-fg: #1a0f0b;
    --tg-bg: #4bb6e8;
    --tg-fg: #06212f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* Атрибут hidden обязан скрывать. Браузерное правило [hidden]{display:none}
   слабее любого авторского display, поэтому блок с display:flex оставался
   виден, хотя в разметке стояло hidden. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.muted { color: var(--fg-faint); font-weight: 400; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }

/* Видно поиску и экранным читалкам, не видно глазу. */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- шапка ---------------------------------------------------------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
}

.head-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 68px; flex-wrap: wrap;
}

.brand { display: flex; flex-direction: column; line-height: 1.15; margin-right: auto; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-size: 21px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.brand:hover .brand-name { color: var(--accent); }
.brand-tag {
  font-size: 11.5px; color: var(--fg-faint); max-width: 42ch;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav { display: flex; gap: 16px; font-size: 14.5px; min-width: 0; }
.nav a { color: var(--fg-muted); white-space: nowrap; }
.nav a:hover { color: var(--accent); }
.nav-more { font-weight: 600; }
.nav-only-mobile { display: none; }   /* на десктопе эти пункты есть в шапке справа */

.search { display: flex; align-items: center; gap: 4px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 6px 4px 14px; }
.search input {
  border: 0; background: transparent; color: var(--fg);
  font: inherit; font-size: 14px; width: 130px; outline: none; padding: 4px 0;
}
.search button {
  border: 0; background: transparent; color: var(--fg-muted);
  cursor: pointer; display: flex; padding: 4px; border-radius: 999px;
}
.search button:hover { color: var(--accent); }

.nav-toggle { display: none; }

/* --- общее для страниц ---------------------------------------------- */

main { padding: 36px 20px 64px; }

.page-head { margin: 0 0 28px; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); margin: 0 0 6px; letter-spacing: -.03em; }
.page-sub { margin: 0; color: var(--fg-muted); font-size: 15px; }

.section-title {
  font-family: var(--font-display); font-size: 21px; margin: 44px 0 18px; letter-spacing: -.02em;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}

.kicker {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); margin-bottom: 8px;
}

.meta { font-size: 13px; color: var(--fg-faint); }
.meta .dot { margin: 0 6px; }

/* --- ведущий пост --------------------------------------------------- */

.lead {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px;
  align-items: center; margin-bottom: 44px;
  padding-bottom: 40px; border-bottom: 1px solid var(--line);
}
.lead-img img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: var(--radius); background: var(--bg-soft);
}
.lead-body h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2;
  margin: 0 0 12px; letter-spacing: -.035em;
}
.lead-excerpt { color: var(--fg-muted); margin: 0 0 14px; font-size: 16.5px; }

/* --- знакомство: что это за место ------------------------------------ */

.intro {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 36px; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 34px; margin-bottom: 44px;
}
.intro-title {
  font-family: var(--font-display); font-size: 27px; letter-spacing: -.02em;
  margin: 0 0 10px;
}
.intro-text p { margin: 0 0 10px; color: var(--fg-muted); font-size: 16px; }
.intro-text p:last-child { margin-bottom: 0; }
.intro-cta { color: var(--fg) !important; }

.intro-side { display: flex; flex-direction: column; gap: 18px; }
.intro-nums { display: flex; gap: 26px; flex-wrap: wrap; }
.intro-num { display: flex; flex-direction: column; }
.intro-num-v {
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  letter-spacing: -.03em; line-height: 1;
}
.intro-num-l { font-size: 13px; color: var(--fg-faint); margin-top: 3px; }
.intro-btn { align-self: flex-start; }

/* --- сетка карточек ------------------------------------------------- */

.grid {
  display: grid; gap: 28px 24px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

/* Верхний ряд из двух крупных карточек задаёт ритм: без него
   двенадцать одинаковых прямоугольников читаются как обои. */
.grid-big {
  grid-template-columns: repeat(2, 1fr);
  gap: 32px; margin-bottom: 40px;
}
.card-lg .card-img img { aspect-ratio: 16 / 10; }
.card-lg h3 { font-size: 24px; line-height: 1.22; }
.card-lg .card-excerpt { font-size: 15.5px; }

/* --- приглашение написать прямо в ленте ------------------------------ */

.write-cta {
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius); overflow: hidden;
}
.write-cta-inner {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 26px 24px; height: 100%;
}
.write-cta svg { color: var(--accent); }
.write-cta h3 {
  font-family: var(--font-display); font-size: 21px; margin: 0; letter-spacing: -.02em;
}
.write-cta p { margin: 0; font-size: 14.5px; color: var(--fg-muted); }
.write-cta .btn { margin-top: auto; }

.card { display: flex; flex-direction: column; min-width: 0; }
.card-img img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius); background: var(--bg-soft); margin-bottom: 14px;
}
.card h3 { font-family: var(--font-display); font-size: 18.5px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -.025em; }
.card-excerpt { color: var(--fg-muted); font-size: 14.5px; margin: 0 0 10px; }
.card .meta { margin-top: auto; }

.ad-card { justify-content: center; align-items: center;
  background: var(--bg-soft); border-radius: var(--radius); min-height: 240px; overflow: hidden; }

/* --- статья --------------------------------------------------------- */

.post { max-width: 720px; margin: 0 auto; }
.post-head { text-align: center; margin-bottom: 28px; }
.post-head h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 46px); line-height: 1.15;
  margin: 0 0 14px; letter-spacing: -.035em;
}
.post-meta { justify-content: center; }

.post-author {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  margin-top: 18px;
}
.post-author-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.post-author-name { font-weight: 600; font-size: 15px; }
.post-author .meta { font-size: 13px; }

.card-author { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-author-name { font-size: 13.5px; font-weight: 600; color: var(--fg-muted); }
.card-author .meta { margin-left: auto; white-space: nowrap; }
.lead-author { margin: 4px 0 16px; }
.lead-author .card-author-name { font-size: 15px; color: var(--fg); }

.post-cover { margin: 0 0 32px; }
.post-cover img { width: 100%; border-radius: var(--radius); background: var(--bg-soft); }

.prose { font-size: 18.5px; line-height: 1.72; }
.prose > * + * { margin-top: 1.15em; }
.prose p { margin: 0; }
.prose h2 { font-family: var(--font-display); font-size: 27px; margin-top: 1.8em; letter-spacing: -.025em; line-height: 1.25; }
.prose h3 { font-size: 22px; margin-top: 1.6em; letter-spacing: -.015em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { padding-left: 1.3em; margin-top: 1em; }
.prose li + li { margin-top: .45em; }
.prose strong { font-weight: 700; }
.prose figure { margin: 2em 0; }
.prose figure img { width: 100%; border-radius: var(--radius); background: var(--bg-soft); }
.prose figcaption {
  font-size: 14px; color: var(--fg-faint); text-align: center;
  margin-top: 10px; font-style: italic;
}
.prose blockquote {
  margin: 1.8em 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif); font-size: 20px; color: var(--fg-muted);
}
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: .8em; }
.prose code {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px; font-size: .88em;
}
.prose pre {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose iframe, .prose video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }

.ad-post { margin: 2.6em 0; text-align: center; }

/* --- видео с YouTube -------------------------------------------------- */

.yt {
  position: relative; margin: 2em 0; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden; cursor: pointer;
}
.yt-poster {
  width: 100%; height: 100%; object-fit: cover; display: block;
  /* обложка YouTube приходит с полями сверху и снизу — подрезаем */
  transform: scale(1.35);
}
.yt-play {
  position: absolute; inset: 0; margin: auto;
  width: 68px; height: 48px; padding: 0;
  background: none; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.yt-play-bg { fill: #212121; opacity: .82; transition: opacity .15s, fill .15s; }
.yt:hover .yt-play-bg { fill: #f00; opacity: 1; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt.playing { cursor: default; }
.yt.playing .yt-poster, .yt.playing .yt-play { display: none; }

/* --- теги, шеринг --------------------------------------------------- */

.tag-row, .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tag {
  font-size: 13.5px; color: var(--fg-muted);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 13px;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

.share {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.share-label { color: var(--fg-faint); }
.share a, .copy-link {
  color: var(--fg-muted); border: 1px solid var(--line);
  background: transparent; border-radius: 999px; padding: 6px 15px;
  font: inherit; font-size: 14px; cursor: pointer;
}
.share a:hover, .copy-link:hover { color: var(--accent); border-color: var(--accent); }

/* --- навигация между постами ---------------------------------------- */

.post-nav {
  max-width: 720px; margin: 48px auto 0; padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.post-nav-item { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.post-nav-item.right { text-align: right; }
.post-nav-dir { font-size: 12.5px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .06em; }
.post-nav-title { font-weight: 600; font-size: 15.5px; line-height: 1.35; }

.related { max-width: var(--wrap); margin: 56px auto 0; }
.related h2 { font-size: 21px; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* --- рубрики -------------------------------------------------------- */

.cat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cat-tile {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.cat-tile:hover { border-color: var(--accent); background: var(--accent-soft); }
.cat-name { font-weight: 700; font-size: 17px; }
.cat-count { font-size: 13px; color: var(--fg-faint); }

/* --- пагинация ------------------------------------------------------ */

.pager {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap; margin-top: 52px; padding-top: 28px; border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.pager-num, .pager-arrow {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; color: var(--fg-muted); min-width: 40px; text-align: center;
}
.pager-num.current { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); font-weight: 600; }
.pager-num:hover, .pager-arrow:hover { border-color: var(--accent); color: var(--accent); }
.pager-gap { color: var(--fg-faint); }

/* --- пусто / 404 ---------------------------------------------------- */

.empty { text-align: center; padding: 56px 0; color: var(--fg-muted); }
.empty.big { padding: 72px 0 48px; }
.four-oh-four { font-size: 90px; font-weight: 800; color: var(--line); line-height: 1; letter-spacing: -.05em; }
.empty h1 { font-size: 28px; margin: 12px 0 8px; color: var(--fg); }
.empty-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.btn {
  background: var(--btn-bg); color: var(--btn-fg); border-radius: 999px;
  padding: 10px 22px; font-weight: 600; font-size: 15px;
}
.btn:hover { color: var(--btn-fg); opacity: .9; }
.btn.ghost { background: transparent; color: var(--fg-muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }

/* --- подвал --------------------------------------------------------- */

.site-foot { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 48px 0 0; margin-top: 48px; }

/* Четыре колонки примерно равной высоты: раньше первая была из двух строк,
   и подвал выглядел наполовину пустым. */
.foot-inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 36px; }
.foot-brand { font-family: var(--font-display); font-weight: 800; font-size: 20px; margin-bottom: 8px; letter-spacing: -.02em; }
.foot-tag { color: var(--fg-muted); font-size: 14.5px; margin: 0 0 16px; max-width: 40ch; line-height: 1.55; }

.foot-tg {
  display: inline-flex; align-items: center; gap: 8px;
  color: #229ED9; font-size: 14.5px; font-weight: 600;
}
.foot-tg:hover { color: #229ED9; opacity: .8; }

.foot-write p { color: var(--fg-muted); font-size: 14.5px; margin: 0 0 14px; line-height: 1.55; }
.foot-write .btn { font-size: 14.5px; padding: 9px 18px; }
.foot-mail { margin-top: 16px !important; font-size: 13.5px; }
.foot-mail a { color: var(--fg-muted); border-bottom: 1px solid var(--line); }
.foot-mail a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.foot-col h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-faint); margin: 0 0 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: 8px; }
.foot-col a { color: var(--fg-muted); font-size: 14.5px; }
.foot-col a:hover { color: var(--accent); }

/* Кнопка внутри подвала: правило для ссылок колонки специфичнее .btn
   и перекрашивало белый текст на красной заливке в серый. */
.foot-col a.btn { color: var(--btn-fg); }
.foot-col a.btn:hover { color: var(--btn-fg); }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px 20px;
  border-top: 1px solid var(--line); margin-top: 36px; padding-top: 20px; padding-bottom: 24px;
  font-size: 13.5px; color: var(--fg-faint);
}
.foot-years { font-variant-numeric: tabular-nums; }
.foot-dev a {
  color: var(--fg-muted); font-weight: 600;
  border-bottom: 1px solid var(--line); padding-bottom: 1px;
}
.foot-dev a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* --- мобильные ------------------------------------------------------ */

@media (max-width: 860px) {
  .lead { grid-template-columns: 1fr; gap: 20px; }
  .lead-img { order: -1; }
  .foot-inner { grid-template-columns: 1fr 1fr; gap: 30px; }
  .foot-about, .foot-write { grid-column: 1 / -1; }

  /* на узком экране знакомство и крупный ряд идут в один столбец */
  .intro { grid-template-columns: 1fr; gap: 22px; padding: 24px; }
  .intro-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .grid-big { grid-template-columns: 1fr; gap: 28px; }
  .card-lg h3 { font-size: 21px; }
}

@media (max-width: 560px) {
  .intro-side { flex-direction: column; align-items: flex-start; gap: 16px; }
  .intro-btn { width: 100%; text-align: center; }
  .intro-nums { gap: 20px; }
  .intro-num-v { font-size: 26px; }
}

@media (max-width: 900px) {
  body { font-size: 16px; }
  /* Сетка вместо флекса: логотип тянется, остальное по содержимому,
     меню занимает всю вторую строку. Перенос тут невозможен в принципе. */
  .head-inner {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center; gap: 8px; min-height: 60px;
  }
  .brand { margin-right: 0; min-width: 0; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; }
  .brand-tag { display: none; }
  .nav { grid-column: 1 / -1; }
  .user-box { margin-left: 0; }

  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; padding: 0 9px;
    background: transparent; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: var(--fg); border-radius: 2px; }

  .nav {
    display: none; width: 100%;
    flex-direction: column; gap: 0; padding: 6px 0 12px;
    border-top: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav a:last-child { border-bottom: 0; }
  .nav-only-mobile { display: block; font-weight: 600; color: var(--fg); }
  .nav .nav-only-mobile:first-of-type { margin-top: 4px; }

  /* на телефоне в строку должны влезть логотип, бургер, поиск и вход */
  .search { padding: 3px 3px 3px 9px; }
  .search input { width: 46px; font-size: 13.5px; }
  /* места на подпись нет, а обрезанное «Поис» выглядит как ошибка;
     лупы рядом достаточно, чтобы понять назначение поля */
  .search input::placeholder { opacity: 0; }
  .login-link { font-size: 14px; }

  main { padding: 26px 20px 48px; }
  .grid { gap: 26px 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .prose { font-size: 17.5px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.right { text-align: left; }
  .foot-inner { grid-template-columns: 1fr; gap: 26px; }
}

/* --- пометка платной публикации -------------------------------------- */

.ad-mark {
  display: inline-block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--fg-muted); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 8px; margin-bottom: 8px;
}
.ad-mark:hover { color: var(--accent); border-color: var(--accent); }

.ad-notice {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 8px 14px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; font-size: 13.5px; color: var(--fg-faint);
}
.ad-notice .ad-mark { margin-bottom: 0; }
.ad-notice:hover { color: var(--fg-muted); border-color: var(--fg-faint); }

.ad-price-card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 26px; text-align: center;
  margin: 1.6em 0;
}
.ad-price-num { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.ad-price-note { color: var(--fg-muted); font-size: 15px; margin-top: 4px; }

/* блок цены и реквизитов в форме отправки */
.ad-toggle { padding-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.ad-block {
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.ad-price {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.ad-price .ad-price-num { font-size: 25px; }
.ad-price-note { color: var(--fg-muted); font-size: 14px; margin: 0; }

/* --- приглашение в Telegram ----------------------------------------- */

.tg-cta {
  display: flex; align-items: center; gap: 18px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 44px;
}
.tg-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 999px;
  background: #229ED9; color: #fff;
}
.tg-text { min-width: 0; flex: 1; }
.tg-title { font-weight: 700; font-size: 17px; letter-spacing: -.015em; }
.tg-text p { margin: 3px 0 0; color: var(--fg-muted); font-size: 14.5px; }
.tg-btn { flex-shrink: 0; background: var(--tg-bg); color: var(--tg-fg); }
.tg-btn:hover { background: var(--tg-bg); color: var(--tg-fg); opacity: .9; }

.lead-btn { margin: 4px 0 14px; }

.card-foot { margin-top: auto; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.read-more { font-size: 14px; font-weight: 600; color: var(--accent); }
.read-more:hover span { margin-left: 3px; }
.read-more span { display: inline-block; transition: margin-left .15s; }
.card-foot .meta { margin-left: auto; }

/* --- закреплённая панель на телефонах -------------------------------- */

.mobile-bar { display: none; }

@media (max-width: 900px) {
  /* Плавающая панель: не приклеена к краю, со скруглением и размытием —
     так она читается как отдельный элемент, а не как обрезанный низ страницы. */
  /* Две самостоятельные плашки с промежутком, а не одна панель с половинами.
     «Написать пост» залито цветом: это главное, что мы предлагаем сделать. */
  .mobile-bar {
    display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px;
    position: fixed; z-index: 60;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    background: none; border: 0; padding: 0;
    pointer-events: none;          /* промежуток между кнопками кликам не мешает */
  }
  .mobile-bar.one { grid-template-columns: 1fr; }

  .mobile-bar-btn {
    pointer-events: auto;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 10px; min-width: 0;
    border-radius: 16px;
    border: 1px solid transparent;
    box-shadow: 0 4px 20px rgba(16, 20, 28, .16), 0 1px 3px rgba(16, 20, 28, .1);
  }
  .mobile-bar-btn svg { flex-shrink: 0; }
  .mb-label { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }

  .mobile-bar-btn.primary { background: var(--btn-bg); color: var(--btn-fg); }
  .mobile-bar-btn.primary:active { opacity: .85; }

  .mobile-bar-btn.tg {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border-color: var(--line); color: #229ED9;
  }
  .mobile-bar-btn.tg .mb-label { color: var(--fg); }
  .mobile-bar-btn.tg:active { background: var(--bg-soft); }

  /* чтобы плавающие кнопки не перекрывали конец страницы */
  .site-foot { margin-bottom: 84px; }

  .tg-cta { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px; }
  .tg-btn { width: 100%; }
}

/* --- пользователь в шапке ------------------------------------------- */

.user-box { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.write-link, .login-link { font-size: 14.5px; color: var(--fg-muted); white-space: nowrap; }
.write-link { font-weight: 600; }
.write-link:hover, .login-link:hover { color: var(--accent); }
.user-chip { display: flex; border-radius: 999px; }
.user-chip:hover { outline: 2px solid var(--accent); outline-offset: 2px; }

.avatar {
  border-radius: 999px; object-fit: cover; flex-shrink: 0;
  background: var(--bg-soft); display: block;
}
.avatar-letter {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; line-height: 1; user-select: none;
}

/* --- формы ----------------------------------------------------------- */

.form-page { max-width: 720px; margin: 0 auto; }

.form { display: flex; flex-direction: column; gap: 22px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-weight: 600; font-size: 15px; }
.field-hint { font-size: 13px; color: var(--fg-faint); }

.form input[type="text"], .form input[type="url"], .form select,
.form textarea, .comment-form textarea, .admin-form input, .admin-form select,
.admin-form textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; outline: none;
}
.form textarea, .comment-form textarea, .admin-form textarea {
  resize: vertical; line-height: 1.6; min-height: 90px;
}
.form input:focus, .form select:focus, .form textarea:focus,
.comment-form textarea:focus, .admin-form input:focus,
.admin-form select:focus, .admin-form textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form input[type="file"] { font-size: 14px; color: var(--fg-muted); }

.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form button.btn, .comment-form button.btn { border: 0; cursor: pointer; font-family: inherit; }

/* поле-ловушка для ботов */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert {
  border: 1px solid var(--line); background: var(--bg-soft);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; font-size: 15px;
}
.alert.error { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }

/* --- хлебные крошки --------------------------------------------------- */

.crumbs {
  max-width: 720px; margin: 0 auto 18px; font-size: 13.5px; color: var(--fg-faint);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.crumbs a { color: var(--fg-muted); }
.crumbs a:hover { color: var(--accent); }

/* --- профиль --------------------------------------------------------- */

.profile-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 0; }

.profile-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin: 26px 0 8px; padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
.profile-tabs a {
  padding: 9px 14px; font-size: 14.5px; color: var(--fg-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.profile-tabs a:hover { color: var(--fg); }
.profile-tabs a.on { color: var(--fg); font-weight: 600; border-bottom-color: var(--accent); }
.tab-count {
  font-size: 12px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px; color: var(--fg-faint);
}

.activity { list-style: none; padding: 0; margin: 20px 0 0; }
.activity-item {
  display: flex; gap: 13px; padding: 16px 0; border-top: 1px solid var(--line);
}
.activity-body { flex: 1; min-width: 0; }
.activity-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.activity-who { font-weight: 600; font-size: 15px; }
.activity-text { font-size: 15.5px; color: var(--fg-muted); overflow-wrap: anywhere; }
.activity-link { display: inline-block; margin-top: 8px; font-size: 13.5px; color: var(--accent); }

.mine-item .badge { margin-left: 6px; }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.profile-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.profile-head .page-sub { margin: 2px 0 0; }
.logout-form { margin-left: auto; }
.logout-form button { cursor: pointer; font-family: inherit; }

.mine { list-style: none; padding: 0; margin: 28px 0 0; }
.mine-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.mine-main { min-width: 0; flex: 1; }
.mine-title { font-weight: 600; font-size: 16.5px; margin-bottom: 4px; }
.mine-reason { font-size: 14px; color: var(--accent); margin-top: 6px; }

.status, .badge {
  font-size: 12px; font-weight: 600; border-radius: 999px;
  padding: 3px 11px; white-space: nowrap;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--fg-muted);
}
.status.ok   { color: #1a7f45; border-color: #9ad9b4; background: #eaf7ef; }
.status.wait { color: #9a6400; border-color: #e5c07a; background: #fdf6e6; }
.status.no   { color: #b3261e; border-color: #eba9a4; background: #fdecea; }

@media (prefers-color-scheme: dark) {
  .status.ok   { color: #6ede9e; border-color: #205339; background: #12291d; }
  .status.wait { color: #f0c674; border-color: #574526; background: #2a2214; }
  .status.no   { color: #ff9d94; border-color: #5c2b28; background: #2c1715; }
}

/* --- комментарии ----------------------------------------------------- */

.comments { max-width: 720px; margin: 56px auto 0; padding-top: 30px; border-top: 1px solid var(--line); }
.comments > h2 { font-size: 21px; margin: 0 0 22px; letter-spacing: -.02em; }

.comment-login {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; text-align: center;
}
.comment-login p { margin: 0 0 16px; color: var(--fg-muted); }
.btn.google {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--bg-card); color: var(--fg);
  border: 1px solid var(--line); font-weight: 600;
}
.btn.google:hover { color: var(--fg); border-color: var(--accent); opacity: 1; }

.comment-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 34px; }
.comment-form-head { display: flex; align-items: center; gap: 10px; font-size: 14.5px; flex-wrap: wrap; }
.comment-as { font-weight: 600; }
.reply-hint { color: var(--fg-faint); font-size: 13.5px; }
.comment-form-actions { display: flex; justify-content: flex-end; }

.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--fg-faint); text-decoration: underline;
}
.linklike:hover { color: var(--accent); }
.linklike.danger:hover { color: #b3261e; }
.inline-form { display: inline; }

.comment-list, .comment-replies { list-style: none; padding: 0; margin: 0; }
.comment { display: flex; gap: 13px; padding: 18px 0; border-top: 1px solid var(--line); }
.comment-body { min-width: 0; flex: 1; }
.comment-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.comment-author { font-weight: 600; font-size: 15px; }
.badge.wait { color: #9a6400; border-color: #e5c07a; background: #fdf6e6; }
.comment-text { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: 14px; margin-top: 8px; }
.comment-replies { margin-top: 8px; padding-left: 4px; border-left: 2px solid var(--line); }
.comment-replies .comment { padding: 14px 0 4px 14px; border-top: 0; }

.byline {
  display: flex; align-items: center; gap: 13px;
  margin-top: 30px; padding: 16px 18px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
}
.byline-name { font-weight: 600; }

@media (max-width: 900px) {
  .user-box { order: 5; margin-left: auto; }
  .write-link { display: none; }
  .comments, .form-page { max-width: none; }
}

@media (prefers-reduced-motion: no-preference) {
  a, .btn, .tag, .pager-num, .pager-arrow, .cat-tile { transition: color .15s, border-color .15s, background .15s, opacity .15s; }
}
