/* ==========================================================================
   games.wsega.ru — стили сайта
   Тёмная тема по умолчанию, светлая — по prefers-color-scheme или переключателю.
   Токены в :root, переопределение в [data-theme="light"].
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #12141a;
  --bg-elev: #1a1d26;
  --bg-elev-2: #222633;
  --bg-inset: #0e1015;
  --border: #2b3040;
  --border-strong: #3a4155;

  --text: #e8eaf0;
  --text-dim: #a3aab9;
  --text-faint: #6f7688;

  --accent: #5b8cff;
  --accent-hover: #7aa2ff;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(91, 140, 255, 0.14);

  /* Плашка логотипа: светлый фон + контурная обводка. */
  --logo-chip-bg: #eef1f6;
  --logo-chip-border: #4c5567;
  --logo-chip-ink: #12141a;

  --ok: #3ec98a;
  --ok-soft: rgba(62, 201, 138, 0.14);
  --warn: #e8b84b;
  --warn-soft: rgba(232, 184, 75, 0.14);
  --danger: #f0616d;
  --danger-soft: rgba(240, 97, 109, 0.14);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1120px;
  --gap: 20px;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --bg-elev-2: #f0f2f5;
  --bg-inset: #eceff3;
  --border: #dfe3ea;
  --border-strong: #c3cad6;

  --text: #1b1e25;
  --text-dim: #565e6d;
  --text-faint: #858d9c;

  --accent: #2f5fd8;
  --accent-hover: #2450c0;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(47, 95, 216, 0.1);

  /* Плашка логотипа: белая с серым контуром. */
  --logo-chip-bg: #ffffff;
  --logo-chip-border: #c6cdd8;
  --logo-chip-ink: #1b1e25;

  --ok: #1c8a55;
  --ok-soft: rgba(28, 138, 85, 0.12);
  --warn: #9a6c00;
  --warn-soft: rgba(154, 108, 0, 0.12);
  --danger: #c62b3c;
  --danger-soft: rgba(198, 43, 60, 0.12);

  --shadow: 0 4px 18px rgba(20, 30, 50, 0.1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f7f9;
    --bg-elev: #ffffff;
    --bg-elev-2: #f0f2f5;
    --bg-inset: #eceff3;
    --border: #dfe3ea;
    --border-strong: #c3cad6;
    --text: #1b1e25;
    --text-dim: #565e6d;
    --text-faint: #858d9c;
    --accent: #2f5fd8;
    --accent-hover: #2450c0;
    --accent-soft: rgba(47, 95, 216, 0.1);
    --ok: #1c8a55;
    --ok-soft: rgba(28, 138, 85, 0.12);
    --warn: #9a6c00;
    --warn-soft: rgba(154, 108, 0, 0.12);
    --danger: #c62b3c;
    --danger-soft: rgba(198, 43, 60, 0.12);
    --shadow: 0 4px 18px rgba(20, 30, 50, 0.1);
    --logo-chip-bg: #ffffff;
    --logo-chip-border: #c6cdd8;
    --logo-chip-ink: #1b1e25;
  }
}

/* ------------------------------------------------------------------ база */

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

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

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

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

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

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 650; }

code, .mono { font-family: var(--mono); font-size: 0.9em; }
code {
  background: var(--bg-inset);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

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

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

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

main { flex: 1 0 auto; padding-bottom: 56px; }

.muted { color: var(--text-faint); }
.spacer { flex: 1; }
.empty { color: var(--text-dim); padding: 24px 0; }
.empty-pad { padding: 32px 16px; text-align: center; }

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

.site-header {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.header-row {
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: 62px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

/*
 * Логотип. Марка вставляется инлайном (server/views/logo.js), поэтому её
 * оформление переключается здесь вместе с темой.
 *
 * Марка лежит на «плашке» — скруглённом квадрате: внутри светлый фон
 * (белый или серый), по краю контурная обводка. Сама марка тёмная, чтобы
 * читаться на светлой плашке в обеих темах.
 *
 * Геометрию path не трогаем, меняем только цвета.
 */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--accent); }

.logo-mark {
  display: block;
  flex: none;
  /* Плитка квадратная. Поля вокруг марки задаёт сам viewBox (64x64), поэтому
     padding не нужен: он бы только сжал марку, а владелец как раз просил
     «не слишком сжато». Радиус заметный, но не круглый — это значок, не аватар. */
  width: 36px;
  height: 36px;
  border-radius: 10px;
  /* Светлый фон + контурная обводка, а не заливка цветом. */
  background: var(--logo-chip-bg);
  border: 1.5px solid var(--logo-chip-border);
  color: var(--logo-chip-ink);
}
.logo-mark path {
  fill: currentColor;
  stroke: none;
}

.logo-text em {
  font-style: normal;
  color: var(--text-faint);
  font-weight: 500;
  font-size: 15px;
  margin-left: 4px;
}

.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 15px;
}
.nav-link:hover { background: var(--bg-elev-2); color: var(--text); text-decoration: none; }
.nav-link.is-active { color: var(--text); background: var(--accent-soft); }

.header-tools { display: flex; align-items: center; gap: 10px; }

.tool-link {
  position: relative;
  font-size: 14px;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tool-link:hover { background: var(--bg-elev-2); color: var(--text); text-decoration: none; }

.badge {
  display: inline-block;
  min-width: 19px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 12px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
}
.badge-muted { background: var(--bg-inset); color: var(--text-dim); }

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { background: var(--bg-elev-2); }

/* Иконка темы: солнце в тёмной теме, полумесяц в светлой. */
.theme-icon { width: 18px; height: 18px; display: block; position: relative; }
.theme-icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: var(--warn);
  border: 1.5px solid var(--text-faint);
}
.theme-icon::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: var(--bg-elev);
  transform: translate(5px, -5px);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}
[data-theme="light"] .theme-icon::after { opacity: 1; }

/* ------------------------------------------------------------------ hero */

.hero { padding: 40px 0 12px; max-width: 720px; }
.hero-title { font-size: clamp(28px, 5vw, 42px); letter-spacing: -0.02em; margin-bottom: 12px; }
.hero-lead { font-size: 18px; color: var(--text-dim); margin: 0 0 6px; }
.hero-note { font-size: 14px; color: var(--text-faint); margin: 0; }

.section { padding: 36px 0 8px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-title { font-size: 22px; margin: 0; }
.section-more { font-size: 14px; color: var(--text-dim); white-space: nowrap; }

.page-head { padding: 36px 0 8px; }
.page-title { font-size: clamp(26px, 4.5vw, 36px); letter-spacing: -0.02em; }
.page-lead { color: var(--text-dim); margin: 0; }

/* ----------------------------------------------------------------- карточки */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.card-link { color: inherit; text-decoration: none; display: block; }
.card-link:hover { text-decoration: none; }

.card-media { position: relative; aspect-ratio: 16 / 9; background: var(--bg-inset); }
.card-cover { width: 100%; height: 100%; object-fit: cover; }
.card-cover-placeholder {
  display: grid;
  place-items: center;
  font-size: 44px;
  font-weight: 800;
  color: var(--text-faint);
  opacity: 0.5;
}

.card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.card-body { padding: 14px 16px 8px; flex: 1; }
.card-title { font-size: 18px; margin: 0 0 4px; }
.card-tagline { font-size: 14px; color: var(--text-dim); margin: 0 0 8px; }
.card-meta { display: flex; gap: 12px; font-size: 13px; color: var(--text-faint); }
.meta-item { white-space: nowrap; }

.card-actions {
  display: flex;
  gap: 8px;
  padding: 8px 16px 16px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 8px; padding: 0; }
.chip {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
}
.chip-sm { font-size: 11px; padding: 1px 6px; }

/* ------------------------------------------------------------------ кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }

.btn-secondary { background: var(--bg-elev-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-elev-2); color: var(--text); }

.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.1); color: #fff; }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }

.btn-sm { padding: 7px 13px; font-size: 14px; }
.btn-xs { padding: 4px 9px; font-size: 12.5px; }
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-block { width: 100%; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--accent); }

/* ------------------------------------------------------------------ новости */

.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.news-item { border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-link { display: block; padding: 14px 0; color: inherit; text-decoration: none; }
.news-link:hover { text-decoration: none; }
.news-link:hover .news-title { color: var(--accent); }
.news-meta { display: flex; gap: 10px; font-size: 13px; color: var(--text-faint); margin-bottom: 3px; }
.news-game { color: var(--accent); }
.news-title { font-size: 17px; margin: 0; transition: color 0.15s; }
.news-excerpt { font-size: 14px; color: var(--text-dim); margin: 4px 0 0; }

.news-cards { display: flex; flex-direction: column; gap: 16px; }
.news-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.news-card-meta { display: flex; gap: 12px; font-size: 13px; color: var(--text-faint); margin-bottom: 6px; }
.news-card-game { color: var(--accent); }
.news-card-game-general { color: var(--text-faint); }
.news-card-title { font-size: 20px; margin: 0 0 6px; }
.news-card-title a { color: var(--text); }
.news-card-title a:hover { color: var(--accent); text-decoration: none; }
.news-card-cover { border-radius: var(--radius-sm); margin: 10px 0; }
.news-card-excerpt { font-size: 15px; color: var(--text-dim); margin: 0; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 20px; }
.filter {
  padding: 6px 13px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-dim);
  background: var(--bg-elev);
}
.filter:hover { background: var(--bg-elev-2); color: var(--text); text-decoration: none; }
.filter.is-active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.filter-count { opacity: 0.7; font-size: 12px; }

/* ------------------------------------------------------------------ игра */

.breadcrumbs {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: var(--text-faint);
  padding: 20px 0 0;
}
.breadcrumbs a { color: var(--text-dim); }

.game { padding-bottom: 8px; }

.game-head {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 18px 0 20px;
}
.game-head-main { flex: 1 1 340px; min-width: 0; }
.game-title { font-size: clamp(26px, 4.5vw, 36px); margin: 0 0 4px; letter-spacing: -0.02em; }
.game-tagline { font-size: 17px; color: var(--text-dim); margin: 0 0 10px; }
.game-head-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.game-url-hint { font-size: 12px; color: var(--text-faint); margin: 0; text-align: center; word-break: break-all; }

.game-hero { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--bg-inset); }
.game-hero img { width: 100%; }

.prose { font-size: 16.5px; color: var(--text); max-width: 70ch; }
.prose p { margin: 0 0 1em; }
.prose ul { margin: 0 0 1em; padding-left: 22px; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--accent); }
/* Список внутри фразы-абзаца не должен начинаться с отступа лишнего абзаца. */
.prose > :last-child { margin-bottom: 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.gallery-item { display: block; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.gallery-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery-item:hover { border-color: var(--accent); }

.post { padding: 18px 0; }
.post-title { font-size: clamp(26px, 4.5vw, 36px); letter-spacing: -0.02em; margin: 0 0 8px; }
.post-meta { display: flex; gap: 12px; font-size: 14px; color: var(--text-faint); margin-bottom: 18px; }
.post-cover { border-radius: var(--radius); margin-bottom: 20px; border: 1px solid var(--border); }

.howto { padding-left: 20px; color: var(--text-dim); }
.howto li { margin-bottom: 6px; }
.about-games { list-style: none; padding: 0; margin: 0; }
.about-games li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.about-games li:last-child { border-bottom: none; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; color: var(--text-dim); }
.facts strong { color: var(--text); font-size: 17px; }

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

.count-pill {
  display: inline-block;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text-dim);
  vertical-align: middle;
}

.comment-list, .comment-children { list-style: none; margin: 0; padding: 0; }
.comment-list { margin-bottom: 28px; }
.comment {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--bg-elev);
}
.comment-children { margin: 12px 0 0 0; padding-left: 16px; border-left: 2px solid var(--border); }
.comment-children .comment { background: var(--bg-elev-2); }

.comment-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.comment-author { font-weight: 650; font-size: 15px; }
.comment-time { font-size: 13px; color: var(--text-faint); }
.comment-body { font-size: 15.5px; word-wrap: break-word; overflow-wrap: anywhere; }
.comment-body a { word-break: break-all; }
.comment-actions { margin-top: 6px; }

.comment-form, .reply-form {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.reply-form { margin-top: 12px; background: var(--bg-elev-2); }
.form-title { font-size: 18px; margin: 0 0 4px; }
.form-note { font-size: 13.5px; color: var(--text-dim); margin: 0 0 14px; }
.form-row { margin-bottom: 12px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.form-actions-sticky {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 14px 0;
  margin-top: 20px;
  z-index: 5;
}

.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; color: var(--text); }
.field-hint { font-weight: 400; color: var(--text-faint); font-size: 13px; }
.req { color: var(--danger); }

.input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input-xs { padding: 4px 8px; font-size: 13px; width: auto; min-width: 180px; }
.textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
select.input { cursor: pointer; }

/* Honeypot: скрыто от людей, но не display:none (некоторые боты это проверяют). */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0 0 18px;
  font-size: 15px;
  border: 1px solid;
}
.notice-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--text); }
.notice-warn { background: var(--warn-soft); border-color: var(--warn); color: var(--text); }
.notice-error { background: var(--danger-soft); border-color: var(--danger); color: var(--text); }
.notice p { margin: 0; }

.notfound { text-align: center; padding: 60px 0; }
.notfound .page-title { font-size: 72px; color: var(--text-faint); margin: 0; }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: auto;
  flex-shrink: 0;
}
.footer-row {
  display: flex;
  gap: var(--gap);
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.footer-copy { margin: 0; font-size: 14px; color: var(--text-faint); }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.footer-nav a { color: var(--text-dim); }

.more { text-align: center; margin: 24px 0; }

/* ------------------------------------------------------------------ адаптив */

@media (max-width: 640px) {
  :root { --gap: 16px; }
  .header-row { gap: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .nav-link { flex: 1; text-align: center; }
  .logo-text em { display: none; }
  .game-head-actions { width: 100%; }
  .cards { grid-template-columns: 1fr; }
  .hero { padding: 28px 0 8px; }
  .footer-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .comment-children { padding-left: 10px; }
  .form-actions-sticky { position: static; }
}

/* -------------------------------------------------------------- админка */

.admin-body { background: var(--bg-inset); }

.admin-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.admin-side {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-logo { padding: 0 6px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav-link {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.admin-nav-link:hover { background: var(--bg-elev-2); color: var(--text); text-decoration: none; }
.admin-nav-link.is-active { background: var(--accent-soft); color: var(--accent); }
.admin-side-foot { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.admin-exit { font-size: 13px; color: var(--text-faint); }
.admin-user { font-size: 13px; color: var(--text-faint); margin: 0; }

.admin-main { padding: 20px 24px 60px; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.admin-title { font-size: 24px; margin: 0; }

.admin-section { margin-bottom: 28px; }
.admin-h2 { font-size: 17px; margin: 0 0 12px; }
.admin-hint { font-size: 13.5px; color: var(--text-dim); margin: 0 0 12px; }
.admin-foot-note { font-size: 13px; color: var(--text-faint); }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-toolbar .filters { margin: 0; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
}
.stat:hover { border-color: var(--border-strong); text-decoration: none; }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-faint); }
.stat-warn { border-color: var(--warn); }
.stat-warn .stat-value { color: var(--warn); }

.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.todo { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.todo li::before { content: "→ "; color: var(--text-faint); }
.todo .done { color: var(--text-dim); }
.todo .done::before { content: "✓ "; color: var(--ok); }
.todo .warn { color: var(--warn); }
.todo .warn::before { content: "! "; color: var(--warn); }

.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.mini-list li:last-child { border-bottom: none; }
.mini-list a { text-decoration: none; color: inherit; flex: 1 1 200px; min-width: 0; }
.mini-list a:hover .mini-title { color: var(--accent); }
.mini-title { display: block; font-weight: 550; color: var(--text); }
.mini-sub { display: block; font-size: 12.5px; color: var(--text-faint); }

.form-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.admin-form .field { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.admin-table th {
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-strong);
}
.admin-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-elev); }
.cell-title a { font-weight: 600; color: var(--text); text-decoration: none; }
.cell-title a:hover { color: var(--accent); }
.cell-sub { display: block; font-size: 12px; color: var(--text-faint); font-family: var(--mono); }
.cell-num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-tags { max-width: 200px; }
.mono-link { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.table-wrap { overflow-x: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); }

.status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.status-published, .status-approved { background: var(--ok-soft); color: var(--ok); }
.status-draft, .status-pending { background: var(--warn-soft); color: var(--warn); }
.status-rejected { background: var(--danger-soft); color: var(--danger); }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .input { flex: 1 1 260px; }
.inline-form-wrap .field { max-width: 340px; }

.scrape-preview { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.scrape-url { font-size: 13px; color: var(--text-faint); margin: 0 0 12px; word-break: break-all; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: 14px; }
.kv dt { color: var(--text-faint); font-family: var(--mono); font-size: 13px; }
.kv dd { margin: 0; word-break: break-word; }
.pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
}
details { margin: 10px 0; }
summary { cursor: pointer; font-size: 14px; color: var(--text-dim); }
summary:hover { color: var(--text); }

.mod-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.mod-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  scroll-margin-top: 20px;
}
.mod-item:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mod-item.is-highlight { border-color: var(--accent); }
.mod-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.mod-author { font-weight: 650; }
.mod-time { font-size: 12.5px; color: var(--text-faint); margin-left: auto; }
.mod-where { font-size: 13px; color: var(--text-faint); margin: 0 0 8px; }
.mod-body { font-size: 15px; margin: 0 0 10px; white-space: pre-wrap; word-wrap: break-word; }
.mod-note { font-size: 13px; color: var(--warn); margin: 0 0 8px; }
.mod-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.login-wrap { display: grid; place-items: center; min-height: 78vh; }
.login-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.login-title { font-size: 22px; margin-bottom: 18px; }
.login-form .field { margin-bottom: 14px; }
.login-form .btn { margin-top: 6px; }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .admin-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .admin-side-foot { flex-direction: row; align-items: center; border-top: none; padding-top: 0; }
  .admin-user { display: none; }
  .admin-main { padding: 16px 14px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
}
