/* ==========================================================================
   PlaySeek — тёмная тема
   Собрано вручную, без сборщика: на shared-хостинге нет node,
   а CSS-переменных хватает, чтобы тема правилась в одном месте.
   ========================================================================== */

:root {
  /* Фоны — от самого тёмного к светлому */
  --bg:            #0a0b10;
  --bg-raised:     #12141c;
  --bg-card:       #161822;
  --bg-hover:      #1c1f2b;
  --bg-input:      #0e1017;

  /* Границы */
  --border:        #232634;
  --border-strong: #2f3444;

  /* Текст */
  --text:          #e8eaf0;
  --text-muted:    #9198ab;
  --text-dim:      #626a80;

  /* Акценты */
  --accent:        #6c5ce7;
  --accent-hover:  #7d6ff0;
  --accent-soft:   rgba(108, 92, 231, 0.14);
  --accent-border: rgba(108, 92, 231, 0.35);

  --cyan:          #22d3ee;
  --green:         #34d399;
  --amber:         #fbbf24;
  --red:           #f87171;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;

  --shadow:    0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.55);

  --header-h: 68px;
  --max-w:    1240px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Мягкое свечение вверху страницы — оживляет плоский тёмный фон */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 480px;
  background:
    radial-gradient(60% 100% at 20% 0%, rgba(108, 92, 231, 0.16), transparent 70%),
    radial-gradient(50% 100% at 85% 0%, rgba(34, 211, 238, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

img, svg { max-width: 100%; height: auto; vertical-align: middle; }

a { color: var(--accent-hover); text-decoration: none; transition: color .15s; }
a:hover { color: var(--cyan); }

h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: .4em; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .875em;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .12em .4em;
}

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Раскладка ---------- */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.main { flex: 1 0 auto; padding: 32px 0 72px; }

.layout-split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.stack     { display: flex; flex-direction: column; gap: 16px; }
.stack-lg  { display: flex; flex-direction: column; gap: 32px; }
.row       { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow      { flex: 1; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .more { font-size: .9rem; color: var(--text-muted); white-space: nowrap; }
.section-head .more:hover { color: var(--cyan); }

/* ---------- Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header .wrap { display: flex; align-items: center; gap: 24px; }

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { color: var(--text); }
.logo-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #fff; font-size: 15px; font-weight: 900;
}
.logo em { font-style: normal; color: var(--accent-hover); }

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .925rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { background: var(--bg-hover); color: var(--text); }
.nav a.active { color: var(--text); background: var(--accent-soft); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.burger {
  display: none;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer;
  padding: 0;
  place-items: center;
}

/* Меню пользователя */
.user-menu { position: relative; }
.user-menu > button {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px 5px 5px;
  color: var(--text); cursor: pointer; font: inherit; font-size: .9rem;
}
.user-menu > button:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.user-menu-drop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 210px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
}
.user-menu.open .user-menu-drop { display: block; }
.user-menu-drop a, .user-menu-drop button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text); font-size: .9rem;
  background: none; border: 0; cursor: pointer; font-family: inherit;
  text-align: left;
}
.user-menu-drop a:hover, .user-menu-drop button:hover { background: var(--bg-hover); color: var(--text); }
.user-menu-drop hr { margin: 6px 0; }

.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff;
  flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  color: var(--text);
  font: inherit;
  font-size: .925rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, color .15s;
}
.btn:hover { background: var(--bg-card); color: var(--text); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), #9b6cf8); color: #fff; }

.btn-ghost { background: none; border-color: var(--border-strong); color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); border-color: var(--accent-border); }

.btn-danger { background: rgba(248, 113, 113, .12); color: var(--red); border-color: rgba(248,113,113,.25); }
.btn-danger:hover { background: rgba(248, 113, 113, .2); color: var(--red); }

.btn-success { background: rgba(52, 211, 153, .12); color: var(--green); border-color: rgba(52,211,153,.25); }
.btn-success:hover { background: rgba(52, 211, 153, .2); color: var(--green); }

.btn-sm  { padding: 6px 12px; font-size: .85rem; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Карточки ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-pad-lg { padding: 28px; }

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.panel-head h3 { margin: 0; font-size: 1rem; }
.panel-body { padding: 20px; }

/* Сворачиваемая панель: показываем, что по ней можно кликнуть */
details.panel > summary { list-style: none; cursor: pointer; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after {
  content: '+';
  color: var(--accent-hover);
  font-size: 1.25rem;
  line-height: 1;
  margin-left: auto;
}
details.panel > summary.panel-head { border-bottom: 0; }
details.panel[open] > summary.panel-head { border-bottom: 1px solid var(--border); }
details.panel[open] > summary::after { content: '−'; }
details.panel > summary:hover { background: var(--bg-hover); }

/* ---------- Объявление ---------- */
.listing {
  position: relative;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text);
  transition: border-color .15s, transform .15s, background .15s;
}
.listing:hover {
  border-color: var(--accent-border);
  background: var(--bg-hover);
  color: var(--text);
  transform: translateY(-2px);
}
/* Цветная полоса слева — цвет игры */
.listing::before {
  content: '';
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--game-color, var(--accent));
  opacity: .8;
}

.listing-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.listing-title { font-size: 1.05rem; font-weight: 650; margin: 0 0 8px; line-height: 1.35; }
.listing-body {
  color: var(--text-muted);
  font-size: .925rem;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: .8rem; color: var(--text-dim);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.listing-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Метки ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.tag-game   { background: var(--accent-soft); border-color: var(--accent-border); color: #b3a8ff; }
.tag-intent { background: rgba(34, 211, 238, .1); border-color: rgba(34,211,238,.25); color: var(--cyan); }
.tag-rank   { background: rgba(251, 191, 36, .1); border-color: rgba(251,191,36,.25); color: var(--amber); }
.tag-green  { background: rgba(52, 211, 153, .1); border-color: rgba(52,211,153,.25); color: var(--green); }
.tag-red    { background: rgba(248, 113, 113, .1); border-color: rgba(248,113,113,.25); color: var(--red); }
.tag-sm     { padding: 2px 8px; font-size: .72rem; }
/* Пример от редакции: приглушённый, не спорит с настоящими объявлениями */
.tag-example {
  background: rgba(145, 152, 171, .12);
  border-color: var(--border-strong);
  color: var(--text-dim);
  font-weight: 500;
}

.badge-count {
  display: inline-grid; place-items: center;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 100px;
  background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 700;
}

/* ---------- Формы ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 7px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
}
.field .hint { display: block; margin-top: 6px; font-size: .8rem; color: var(--text-dim); }
.field-error { display: block; margin-top: 6px; font-size: .8rem; color: var(--red); }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  transition: border-color .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-raised);
}
.textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239198ab' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }

/* Выбор файла: у браузера по умолчанию тёмный текст — на тёмном фоне не читается */
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
}
input[type="file"]:hover { border-color: var(--accent); }

/* Выбор одного из вариантов плитками */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice {
  position: relative;
  display: block;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  transition: border-color .15s, background .15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #fff;
}

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .9rem; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Фильтры ---------- */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.filters .field { margin: 0; flex: 1 1 160px; }
.filters .field label { font-size: .78rem; color: var(--text-muted); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent-border); color: var(--text); background: var(--bg-hover); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active:hover { color: #fff; }

/* ---------- Главная: первый экран ---------- */
.hero { padding: 56px 0 44px; text-align: center; }
.hero h1 { max-width: 780px; margin: 0 auto .8rem; }
.hero .lead {
  max-width: 620px; margin: 0 auto 32px;
  font-size: 1.1rem; color: var(--text-muted);
}
.hero-accent {
  background: linear-gradient(120deg, var(--accent-hover), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.searchbar {
  display: flex; gap: 8px;
  max-width: 620px; margin: 0 auto 20px;
}
.searchbar .input { padding: 14px 18px; font-size: 1rem; }

.hero-stats {
  display: flex; gap: 32px; justify-content: center; flex-wrap: wrap;
  margin-top: 36px;
}
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.03em; }
.hero-stat span { font-size: .82rem; color: var(--text-dim); }

/* ---------- Сетки ---------- */
.grid-listings { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.grid-games    { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.grid-articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.grid-2        { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* Карточка игры */
/* Обложка раздела: во всю ширину карточки, текст идёт под ней */
.game-cover {
  display: block;
  margin: -18px -18px 14px;
  aspect-ratio: 1200 / 630;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  overflow: hidden;
}
.game-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.game-card:hover .game-cover img { transform: scale(1.03); }

.game-card {
  position: relative;
  display: block;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.game-card::after {
  content: '';
  position: absolute; inset: auto -30% -60% auto;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: var(--game-color, var(--accent));
  opacity: .12;
  filter: blur(24px);
  transition: opacity .2s;
}
.game-card:hover { border-color: var(--accent-border); transform: translateY(-2px); color: var(--text); }
.game-card:hover::after { opacity: .22; }
.game-card h3 { font-size: 1.02rem; margin: 0 0 4px; position: relative; }
.game-card .game-genre { font-size: .78rem; color: var(--text-dim); position: relative; }
.game-card .game-count {
  margin-top: 12px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-hover);
  position: relative;
}
.game-card .game-count.is-empty { color: var(--text-dim); font-weight: 500; }

/* Карточка статьи */
.article-card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.article-card:hover { border-color: var(--accent-border); transform: translateY(-2px); color: var(--text); }

/* Обложка: рисуется сайтом, поэтому пропорции всегда одни и те же */
.article-cover {
  display: block;
  aspect-ratio: 1200 / 630;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.article-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.article-card:hover .article-cover img { transform: scale(1.03); }

.article-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.article-card h3 { font-size: 1.05rem; margin: 8px 0 8px; }
.article-card p { color: var(--text-muted); font-size: .9rem; margin: 0 0 14px; }
.article-card .article-meta {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--text-dim);
  display: flex; gap: 12px;
}

/* Просмотр обложки в админке */
.cover-preview {
  display: block;
  width: 100%; max-width: 520px; height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}


/* ---------- Страница объявления ---------- */
.listing-page-head { margin-bottom: 24px; }
.listing-page-head h1 { margin-bottom: 14px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.detail {
  background: var(--bg-card);
  padding: 14px 16px;
}
.detail dt { font-size: .75rem; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.detail dd { margin: 0; font-size: .95rem; font-weight: 600; }

.prose { font-size: 1.02rem; line-height: 1.75; }
.prose p { margin-bottom: 1.1em; }
.prose h2 { margin-top: 2em; padding-top: .2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { margin-bottom: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
  font-style: italic;
}
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.4em; font-size: .95rem; }
.prose th, .prose td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.prose th { background: var(--bg-raised); font-weight: 600; }
.prose img { border-radius: var(--radius); }

.contact-box {
  background: linear-gradient(135deg, var(--accent-soft), rgba(34, 211, 238, .07));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-value {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .95rem;
  word-break: break-all;
}
.copy-btn {
  margin-left: auto; flex-shrink: 0;
  background: none; border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 4px 10px;
  color: var(--text-muted); font-size: .78rem; cursor: pointer; font-family: var(--font);
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-border); }

/* ---------- Боковая колонка ---------- */
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); }
.sidebar .panel + .panel { margin-top: 16px; }

.side-list { display: flex; flex-direction: column; }
.side-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: .9rem;
  border-top: 1px solid var(--border);
}
.side-list a:first-child { border-top: 0; }
.side-list a:hover { background: var(--bg-hover); color: var(--text); }
.side-list a.active { color: var(--text); background: var(--accent-soft); }
.side-list .count { font-size: .78rem; color: var(--text-dim); }

/* ---------- Хлебные крошки ---------- */
.crumbs {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-dim);
  margin-bottom: 20px;
}
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent-hover); }
.crumbs span::after { content: '/'; margin-left: 8px; color: var(--border-strong); }
.crumbs span:last-child::after { content: none; }

/* ---------- Сообщения ---------- */
.flash-area { position: fixed; top: calc(var(--header-h) + 14px); right: 20px; z-index: 200; max-width: 380px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
  animation: slide-in .25s ease-out;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } }
.flash-success { border-left: 3px solid var(--green); }
.flash-error   { border-left: 3px solid var(--red); }
.flash-info    { border-left: 3px solid var(--cyan); }
.flash-warning { border-left: 3px solid var(--amber); }
.flash button { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0; margin-left: auto; }

.notice {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  font-size: .9rem;
  margin-bottom: 20px;
}
.notice-warning { border-left-color: var(--amber); background: rgba(251, 191, 36, .06); }
.notice-error   { border-left-color: var(--red); background: rgba(248, 113, 113, .06); }
.notice-success { border-left-color: var(--green); background: rgba(52, 211, 153, .06); }
.notice p:last-child { margin-bottom: 0; }

/* ---------- Пустое состояние ---------- */
.empty {
  text-align: center;
  padding: 56px 24px;
  background: var(--bg-raised);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-icon { font-size: 2.4rem; margin-bottom: 12px; opacity: .6; }
.empty h3 { margin-bottom: 8px; }
.empty p { color: var(--text-muted); max-width: 420px; margin: 0 auto 20px; }

/* ---------- Пагинация ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px;
  display: grid; place-items: center;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .9rem;
}
.pagination a:hover { border-color: var(--accent-border); color: var(--text); background: var(--bg-hover); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pagination .gap { border: 0; color: var(--text-dim); }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left; padding: 12px 16px;
  background: var(--bg-raised);
  color: var(--text-muted);
  font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-card);
}
.faq-item summary {
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent-hover); font-size: 1.3rem; font-weight: 400; flex-shrink: 0; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--bg-hover); }
.faq-item .faq-answer { padding: 0 18px 16px; color: var(--text-muted); font-size: .925rem; }

/* ---------- Оглавление статьи ---------- */
.toc {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 28px;
}
.toc-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin-bottom: .35em; font-size: .9rem; }

/* ---------- Админка ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--header-h) + 24px); }
.admin-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 2px;
}
.admin-nav a:hover { background: var(--bg-hover); color: var(--text); }
.admin-nav a.active { background: var(--accent-soft); color: #fff; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-label { font-size: .78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-value { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat-sub { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.stat-value.ok   { color: var(--green); }
.stat-value.warn { color: var(--amber); }
.stat-value.bad  { color: var(--red); }

/* Столбчатый график активности */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 110px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar i {
  display: block; width: 100%;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
}
.bar span { font-size: .65rem; color: var(--text-dim); white-space: nowrap; }

.job-row { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }
.job-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.job-status.done    { background: var(--green); }
.job-status.pending { background: var(--amber); }
.job-status.running { background: var(--cyan); }
.job-status.failed  { background: var(--red); }

/* ---------- Подвал ---------- */
.footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  padding: 40px 0 28px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 28px;
}
.footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin-bottom: 12px; }
.footer a { display: block; color: var(--text-muted); font-size: .9rem; margin-bottom: 8px; }
.footer a:hover { color: var(--accent-hover); }
/* логотип в подвале — тоже flex, иначе название уезжает под значок */
.footer .logo { display: inline-flex; color: var(--text); margin-bottom: 16px; }
.footer .logo:hover { color: var(--text); }
.footer .about { color: var(--text-muted); font-size: .875rem; max-width: 320px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .82rem; color: var(--text-dim);
}

/* ---------- Мелочи ---------- */
.muted   { color: var(--text-muted); }
.dim     { color: var(--text-dim); }
.small   { font-size: .85rem; }
.tiny    { font-size: .78rem; }
.center  { text-align: center; }
.nowrap  { white-space: nowrap; }
.mono    { font-family: ui-monospace, Menlo, Consolas, monospace; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.hide { display: none !important; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 0 0 var(--radius-sm) 0;
  z-index: 300;
}
.skip-link:focus { left: 0; top: 0; color: #fff; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .layout-split { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
  .admin-nav a { white-space: nowrap; margin: 0; }
}

@media (max-width: 720px) {
  .burger { display: grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 2px;
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }

  .hero { padding: 36px 0 28px; }
  .hero-stats { gap: 24px; }
  .searchbar { flex-direction: column; }
  .grid-listings { grid-template-columns: 1fr; }
  .flash-area { left: 12px; right: 12px; max-width: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .header-actions .btn-hide-mobile { display: none; }
  .main { padding: 20px 0 48px; }
  .card-pad-lg { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .header, .footer, .sidebar, .flash-area, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
