/* Блог istorii-bolezni.ru — тёмная тема в стилистике bashdays.ru:
   тёмный фон, панели-карточки, монопространственные номера, тёплый акцент.
   Без внешних шрифтов и библиотек: системный стек = ноль лишних запросов. */

:root {
  --bg: #0b0e14;
  --panel: #171c26;
  --panel-2: #1c2231;
  --text: #e8e6e1;
  --muted: #9298a2;
  --line: #273041;
  --accent: #f0a842;
  --accent-dim: #c9862a;
  --radius: 10px;
  --max: 1020px;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
/* scrollbar-gutter: резервируем место под вертикальный скроллбар на всех
   страницах — иначе контент (и логотип) сдвигается при переходе между
   страницами разной высоты */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  /* Тёмно-синий фон с осветлением к центральной части; fixed — градиент
     не «ездет» при прокрутке */
  background:
    radial-gradient(ellipse 90% 70% at 50% 32%,
      #1d2740 0%, #161e2f 35%, #10141f 65%, #0a0d13 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

/* ---------- Шапка / подвал ---------- */
.site-header {
  background: rgba(11, 14, 20, .90);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding: 14px 20px;
}
.logo {
  font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none;
  font-family: var(--mono); letter-spacing: .3px;
}
.logo::before { content: "▸ "; color: var(--accent); }
.menu { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-left: auto; }
.menu a { color: var(--muted); text-decoration: none; font-size: 14.5px; }
.menu a:hover { color: var(--accent); }

/* ---------- Баннер в шапке ---------- */
.header-banner-wrap { padding: 14px 20px 0; }
.header-banner-link { display: block; border-radius: 10px; overflow: hidden; }
.header-banner-img {
  display: block; width: 100%; height: 100px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
  margin-top: 64px;
  background: var(--panel);
}
.footer-inner { padding: 28px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 0; }
.footer-menu a {
  color: var(--muted); text-decoration: underline;
  text-decoration-color: rgba(146, 152, 162, .5); text-underline-offset: 3px;
}
.footer-menu a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.footer-copy { margin: 0; font-size: 13px; }
.footer-note { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }

main { padding: 34px 20px 8px; }

/* ---------- Типографика ---------- */
h1 { font-size: 32px; line-height: 1.25; margin: 10px 0 16px; font-weight: 800; letter-spacing: -.3px; }
h2 { font-size: 21px; margin: 30px 0 14px; font-weight: 700; }
h3 { font-size: 18px; margin: 24px 0 10px; }
a { color: var(--accent); }
a:hover { color: #ffc46b; }
p { margin: 0 0 14px; }
.muted { color: var(--muted); }

.section-heading {
  font-size: 15px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--muted); font-family: var(--mono);
  margin: 40px 0 16px; font-weight: 600;
}
.section-heading::before { content: "// "; color: var(--accent); }

.article-content h2, .article-content h3 { margin-top: 30px; color: var(--text); }
.article-content ul, .article-content ol { padding-left: 22px; margin: 0 0 14px; }
.article-content li { margin-bottom: 6px; }
.article-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
.article-content blockquote {
  margin: 18px 0; padding: 12px 20px; border-left: 3px solid var(--accent);
  color: var(--muted); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0;
}
.article-content code {
  background: #222a3a; color: #ffcf8b; padding: 2px 7px; border-radius: 5px; font-size: .9em;
  font-family: var(--mono);
}
.article-content pre {
  background: #141926; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; overflow-x: auto;
}
.article-content pre code { background: none; padding: 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15px; }
.article-content th, .article-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.article-content th { background: var(--panel-2); }

/* ---------- Баннер на главной ---------- */
.hero-banner {
  background:
    radial-gradient(1200px 300px at 85% -40%, rgba(240, 168, 66, .13), transparent 60%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px 44px;
  margin-bottom: 8px;
}
.banner-label {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px;
}
.banner-label::before { content: "~/ "; color: var(--muted); }
.banner-body { font-size: 17px; line-height: 1.7; color: var(--text); }
.banner-body p:last-child { margin-bottom: 0; }
.banner-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-banner.has-image {
  min-height: 320px;
  display: flex; flex-direction: column; justify-content: center;
  background-size: cover; background-position: center;
  border: 0;
  position: relative; overflow: hidden;
}
.hero-banner.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  z-index: 0;
}
.hero-banner.has-image > * { position: relative; z-index: 1; }
.hero-banner.has-image .banner-body,
.hero-banner.has-image .banner-label { text-shadow: 0 1px 10px rgba(0,0,0,.7); }

/* ---------- Главная: баннер + свежие статьи ---------- */
.home-top {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px;
  align-items: stretch;
  margin-top: 22px;   /* воздух между шапкой и баннером */
}
.home-top .hero-banner { margin-bottom: 0; height: 100%; }
.fresh-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px;
}
.fresh-label {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 12px;
}
.fresh-label::before { content: "// "; color: var(--accent); }
.fresh-item {
  display: block; text-decoration: none; padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.fresh-item:last-child { border-bottom: 0; }
.fresh-title { display: block; color: var(--text); font-size: 14.5px; line-height: 1.45; font-weight: 600; }
.fresh-item:hover .fresh-title { color: var(--accent); }
.fresh-date { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat-chip {
  font-family: var(--mono); font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2);
  padding: 7px 14px; color: var(--muted);
}
.stat-chip b { color: var(--accent); font-size: 17px; margin-right: 4px; }

/* ---------- Рубрики блоками ---------- */
.topics-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 8px;
}
.topic {
  display: flex; align-items: flex-start; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.topic:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.topic-num {
  font-family: var(--mono); font-size: 26px; font-weight: 700;
  color: var(--accent); line-height: 1.1; min-width: 44px;
}
.topic-body { flex: 1; }
.topic-title { display: block; font-weight: 700; font-size: 17px; color: var(--text); margin-bottom: 4px; }
.topic:hover .topic-title { color: var(--accent); }
.topic-desc { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }
.topic-count {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  white-space: nowrap; padding-top: 4px;
}

/* ---------- Карточки статей ---------- */
.card {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 14px;
  transition: border-color .15s ease;
}
.card:hover { border-color: var(--accent-dim); }
.card-main { flex: 1; min-width: 0; }
.card-thumb-wrap {
  flex-shrink: 0; display: block;
  width: 150px; height: 100px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line);
}
.card-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-meta {
  font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
.tag { color: var(--accent); text-decoration: none; font-weight: 600; }
.tag:hover { color: #ffc46b; }
.hot-badge { color: var(--accent); font-weight: 700; letter-spacing: .5px; }

/* ---------- Большая карточка HOT на главной ---------- */
.featured-block {
  border: 2px solid var(--accent); border-radius: 14px;
  padding: 18px 22px 6px; margin-bottom: 26px;
  background: rgba(240, 168, 66, .04);
}
.featured-block .section-heading { margin-top: 4px; }
.hot-card {
  position: relative; overflow: hidden;
  border-radius: 14px; border: 1px solid var(--line);
  background-color: var(--panel); background-size: cover; background-position: center;
  padding: 26px 30px; margin-bottom: 26px;
}
.hot-card.has-image {
  min-height: 320px; border: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hot-card.has-image::before {
  content: ''; position: absolute; inset: 0;
  background-image: inherit; background-size: cover; background-position: center 70%;
  transform: scale(1.06); z-index: 0;
}
.hot-card > * { position: relative; z-index: 1; }
.hot-title { margin: 8px 0 8px; font-size: 26px; line-height: 1.3; }
.hot-title a { color: var(--text); text-decoration: none; }
.hot-title a:hover { color: var(--accent); }
.hot-teaser { margin: 0; color: var(--muted); max-width: 720px; }
.card-title { margin: 0 0 8px; font-size: 20px; line-height: 1.35; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-teaser { margin: 0; color: var(--muted); }

.rubric-intro { color: var(--muted); margin-bottom: 24px; }
.more-row { margin: 26px 0 6px; text-align: center; }
.more-link {
  display: inline-block; padding: 11px 26px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 15px;
  transition: border-color .15s ease, color .15s ease;
}
.more-link:hover { border-color: var(--accent); color: var(--accent); }
.page-title { margin: 4px 0 22px; font-size: 30px; line-height: 1.25; }
.page-crumbs { margin: 14px 0 0; color: var(--muted); }
.page-crumbs a { color: var(--muted); }
.page-crumbs a:hover { color: var(--accent); }

/* ---------- Hero статьи ---------- */
.article-hero,
.section-hero {
  position: relative;
  margin-top: 14px;                    /* отступ от меню */
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 40px 36px 32px;
  margin-bottom: 26px;
  background-color: var(--panel);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.article-hero.has-image,
.section-hero.has-image {
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 190px 36px 42px;
  min-height: 500px;
  border: 0;
}
/* Фоновый слой увеличен на 8% — края картинки (вместе с любыми светлыми
   полосами от генератора) уходят за границы блока */
.article-hero.has-image::before,
.section-hero.has-image::before,
.hero-banner.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center 70%;   /* при несовпадении пропорций обрезаем сверху */
  transform: scale(1.08);
  z-index: 0;
}
.article-hero > *, .section-hero > * { position: relative; z-index: 1; }
.section-hero { margin-bottom: 22px; }
.section-hero h1 { margin: 0; }
.section-hero .hero-teaser { margin-top: 10px; }
.hero-emoji { margin-right: 6px; }
/* описание рубрики (HTML) на картинке под заголовком */
.hero-content {
  margin-top: 12px; max-width: 780px;
  color: rgba(232, 230, 225, .88); font-size: 15.5px; line-height: 1.65;
}
.hero-content p { margin: 0 0 10px; }
.hero-content p:last-child { margin-bottom: 0; }
.hero-content :is(h2, h3, strong, b) { color: var(--text); }
.hero-content a { color: var(--accent); }
.hero-content ul, .hero-content ol { margin: 0 0 10px; padding-left: 22px; }

/* ---------- Хлебные крошки на hero ---------- */
.crumbs {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .4px;
  color: rgba(255,255,255,.75); margin-bottom: 10px;
}
.crumbs a { color: inherit; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.crumbs a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.crumbs-sep { margin: 0 7px; color: rgba(255,255,255,.45); }

/* Hero статьи с картинкой в естественной пропорции (без обрезки):
   картинка на всю ширину блока, текст — под ней на панели */
.article-hero.no-crop {
  padding: 0;
  display: block;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
}
.article-hero.no-crop::before { content: none; }
.hero-img {
  display: block; width: 100%; height: auto;
  border-radius: 14px 14px 0 0;
}
.article-hero.no-crop .hero-text { padding: 26px 36px 32px; }
.article-hero.no-crop .hero-meta { color: var(--muted); margin-bottom: 8px; }
.article-hero.no-crop h1 { text-shadow: none; margin: 0 0 10px; }
.article-hero.no-crop .hero-teaser { color: var(--muted); text-shadow: none; margin: 0; }
.hero-meta {
  font-family: var(--mono); font-size: 13.5px; margin-bottom: 10px;
  color: #d8d5cf;
}
.hero-meta .tag { text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.article-hero h1 {
  margin: 0 0 10px; max-width: 780px;
  text-shadow: 0 2px 14px rgba(0,0,0,.65);
}
.hero-teaser {
  margin: 0; color: #cfccc6; font-size: 16.5px; max-width: 720px;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}

/* ---------- Статья ---------- */
.single { max-width: 880px; margin: 0 auto; }
.article-content { font-size: 16.5px; }
.backlink { margin-top: 36px; }

/* ---------- Листалка между статьями ---------- */
.views-line {
  margin: 30px 0 0; font-family: var(--mono); font-size: 13.5px;
  color: var(--muted); letter-spacing: .3px;
}
.post-pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 14px;
}
.pager-item {
  display: flex; flex-direction: row; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; text-decoration: none;
  transition: border-color .15s ease;
}
.pager-item.next { flex-direction: row-reverse; text-align: right; }
.pager-cover {
  flex: 0 0 auto; width: 96px; height: 54px; border-radius: 8px;
  background-color: var(--panel-2, #1a1d22); background-size: cover; background-position: center;
  border: 1px solid var(--line);
}
.pager-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pager-item:hover { border-color: var(--accent-dim); }
.pager-item.empty { visibility: hidden; }
.pager-label { font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.pager-title { color: var(--text); font-weight: 600; font-size: 15.5px; line-height: 1.4; }
.pager-item:hover .pager-title { color: var(--accent); }

/* ---------- Пагинация ---------- */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin: 30px 0; color: var(--muted); font-size: 14.5px;
  font-family: var(--mono);
}
.pagination a { text-decoration: none; }

/* ---------- Админка (остаётся светлой для удобства работы) ---------- */
body.admin { background: #f7f7f5; color: #232323; }
body.admin a { color: #2f6fed; }
body.admin main { padding-bottom: 60px; }

body.admin .site-header { background: #23272e; border-bottom: 1px solid #10131a; }
body.admin .logo { color: #f0a842; }
body.admin .logo::before { content: none; }
body.admin .menu a { color: #b9bfc9; }
body.admin .menu a:hover { color: #f0a842; }
body.admin .menu a.active { color: #f0a842; }

.login-box {
  max-width: 380px; margin: 60px auto 0;
  background: #fff; border: 1px solid #e3e3de;
  border-radius: var(--radius); padding: 28px 30px;
}
.login-box h1 { font-size: 22px; margin-top: 0; color: #232323; }

.form label, .login-box label { display: block; margin-bottom: 14px; font-size: 14.5px; color: #6f6f6a; }
.form input[type="text"], .form input[type="password"], .form input[type="number"],
.form input[type="datetime-local"], .form select, .form textarea,
.login-box input {
  display: block; width: 100%; margin-top: 5px;
  padding: 9px 12px; font: inherit; color: #232323;
  background: #fff; border: 1px solid #e3e3de; border-radius: 8px;
}
.form textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 13.5px; line-height: 1.5; }
.form label.check { color: #232323; }
.form label.check input { margin-right: 8px; }
.form details { margin: 14px 0; padding: 12px 16px; background: #fff; border: 1px solid #e3e3de; border-radius: 8px; }
.form summary { cursor: pointer; font-weight: 600; color: #6f6f6a; }
.form h2 { color: #232323; }
.cover-row { display: flex; gap: 8px; margin-top: 5px; }
.cover-row input { margin-top: 0; flex: 1; }
.cover-row .btn-mini { flex-shrink: 0; }
.ai-status { display: block; margin-top: 8px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.ai-status.process { color: #b8860b; }
.ai-status.ok { color: #1c7c3c; }
.ai-status.err { color: #a03030; }
.autopilot-info {
  background: #fff; border: 1px solid #e3e3de; border-radius: 8px;
  padding: 14px 18px; margin: 16px 0; font-size: 14.5px;
}
.autopilot-info p { margin: 0 0 10px; }
.settings-block {
  border: 1px solid #e3e3de; border-radius: 8px;
  padding: 8px 16px; margin: 14px 0; background: #fff;
}
.settings-block > summary { cursor: pointer; padding: 6px 0; }
.q-edit { position: relative; display: inline-flex; align-items: center; }
.q-edit > summary { list-style: none; cursor: pointer; }
.q-edit > summary::-webkit-details-marker { display: none; }
.q-edit[open]::before {
  content: ''; position: fixed; inset: 0; z-index: 98;
  background: rgba(0, 0, 0, .45); cursor: default;
}
.q-pop {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 99; width: min(560px, calc(100vw - 40px)); max-height: calc(100vh - 60px);
  overflow: auto;
  background: #fff; border: 1px solid #e3e3de; border-radius: 10px;
  padding: 18px 20px; margin: 0;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: left;
}
body.admin .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid #d8d8d2; border-radius: 7px; background: #fff;
  cursor: pointer; font-size: 14px; line-height: 1; color: #555; font-weight: 400;
}
body.admin .icon-btn:hover { border-color: #b5b5ad; color: #222; background: #fff; }
body.admin .icon-danger:hover { border-color: #c76a6a; color: #a03030; background: #fff; }
body.admin .tgl {
  display: inline-block; width: 20px; height: 12px; border-radius: 6px;
  background: #c9c9c2; position: relative; transition: background .15s ease;
}
body.admin .tgl::after {
  content: ''; position: absolute; top: 1px; left: 1px;
  width: 10px; height: 10px; border-radius: 50%; background: #fff;
  transition: left .15s ease;
}
body.admin .tgl.on { background: #1c7c3c; }
body.admin .tgl.on::after { left: 9px; }
body.admin .tgl.off { background: #c9c9c2; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: #f1f1ee; padding: 2px 6px; border-radius: 5px; word-break: break-all; }
.code-line {
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  background: #f1f1ee; border: 1px solid #e3e3de; border-radius: 6px;
  padding: 8px 12px; word-break: break-all;
}

body.admin button, body.admin .btn {
  display: inline-block; font: inherit; cursor: pointer; text-decoration: none;
  padding: 9px 20px; border-radius: 8px; border: 1px solid #2f6fed;
  background: #2f6fed; color: #fff; font-weight: 600; font-size: 15px;
}
body.admin button:hover, body.admin .btn:hover { background: #1d4fc4; border-color: #1d4fc4; color: #fff; }
.btn-accent { background: #111; border-color: #111; }
.btn-accent:hover { background: #000; border-color: #000; }
.btn-mini {
  font-size: 13px; padding: 4px 12px; border-radius: 6px;
  background: #fff; color: #232323; border: 1px solid #e3e3de;
}
.btn-mini:hover { border-color: #2f6fed; color: #2f6fed; background: #fff; }
.btn-danger:hover { border-color: #c0392b; color: #c0392b; }
.btn-link { margin-left: 12px; color: #6f6f6a; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; }

.tbl { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3e3de; border-radius: var(--radius); overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 10px 14px; border-bottom: 1px solid #e3e3de; font-size: 14.5px; }
.tbl th { background: #fbfbfa; color: #6f6f6a; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
.tbl tr:last-child td { border-bottom: 0; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 6px; }
.row-actions > * { vertical-align: middle; }
.row-actions > *:first-child { margin-left: 0; }

.ok, .alert { display: block; padding: 8px 14px; border-radius: 8px; font-size: 14.5px; }
.ok-label, .off-label { display: inline; padding: 0; font-size: 14.5px; }
p.ok { background: #e9f7ee; color: #1c7c3c; border: 1px solid #bfe6cd; }
p.alert { background: #fdeeee; color: #a03030; border: 1px solid #f0c9c9; }
.ok-label { color: #1c7c3c; }
.off-label { color: #6f6f6a; }

.stats { display: flex; flex-wrap: wrap; gap: 14px; margin: 20px 0 26px; }
.stat {
  background: #fff; border: 1px solid #e3e3de; border-radius: var(--radius);
  padding: 16px 24px; min-width: 150px;
}
.stat b { display: block; font-size: 26px; color: #232323; }
.stat span { color: #6f6f6a; font-size: 13.5px; }

.logout { margin-left: 18px; }
.logout button {
  background: none; border: 1px solid #3a4049; color: #b9bfc9;
  font-weight: 400; font-size: 14px; padding: 5px 14px;
}
.logout button:hover { border-color: #f0a842; color: #f0a842; background: none; }

/* выравнивание меню админки по одной линии с лого и кнопкой «Выйти» */
body.admin .header-inner { align-items: center; }
body.admin .menu { align-items: center; }
body.admin .logout { display: inline-flex; align-items: center; }

.filter { margin-bottom: 18px; }
.filter select, .filter input[type="date"], .filter input[type="search"] { padding: 7px 10px; font: inherit; border: 1px solid #e3e3de; border-radius: 8px; background: #fff; color: inherit; }
.list-count { margin-top: 12px; font-size: 13.5px; }
.row-num { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---------- Адаптивность ---------- */
@media (max-width: 860px) {
  .home-top { grid-template-columns: 1fr; }
  .fresh-box { padding: 16px 18px; }
}
@media (max-width: 640px) {
  h1 { font-size: 25px; }
  .header-inner { padding: 12px 16px; }
  .menu { margin-left: 0; width: 100%; }
  main { padding: 22px 16px 8px; }
  .hero-banner { padding: 26px 22px; }
  .hero-banner.has-image { min-height: 260px; }
  .topics-grid { grid-template-columns: 1fr; }
  .article-hero, .section-hero { padding: 28px 20px 24px; }
  .article-hero.has-image, .section-hero.has-image { padding: 130px 20px 26px; min-height: 380px; }
  .article-hero.no-crop .hero-text { padding: 20px 20px 24px; }
  .card { padding: 14px 16px; gap: 12px; }
  .card-thumb-wrap { width: 96px; height: 68px; }
  .card-title { font-size: 17px; }
  .post-pager { grid-template-columns: 1fr; }
  .pager-item.next { text-align: left; }
  .tbl { display: block; overflow-x: auto; }
}
