/* ====================================================================
   CommentGuard — Design System v2
   Premium minimal B2B UI · light + dark · CSS variables
   Layout: centered content column + top navigation bar
   ==================================================================== */

/* Fonts loaded via <link> in <head> of each page. */

/* ---------- Theme tokens ---------- */
:root {
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter Tight', sans-serif;

  /* dark (default) */
  --bg: #0a0e14;
  --bg-elevated: #121821;
  --bg-card: rgba(255, 255, 255, 0.022);
  --bg-card-solid: #141b24;
  --bg-hover: rgba(255, 255, 255, 0.055);
  --bg-input: rgba(255, 255, 255, 0.04);

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.18);
  --accent-text: #93c5fd;

  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.13);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 22px rgba(0, 0, 0, .26);
  --shadow-lg: 0 24px 70px -22px rgba(0, 0, 0, .62);
  --ring: 0 0 0 3px var(--accent-soft);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;

  --nav-h: 74px;
  --topbar-h: 74px;      /* legacy alias */
  --content-max: 1280px;
  --content-max-wide: 1460px;  /* плотные страницы (Facebook Pages) */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='light'] {
  --bg: #f6f7f9;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-input: rgba(0, 0, 0, 0.022);

  --border: rgba(9, 9, 11, 0.09);
  --border-strong: rgba(9, 9, 11, 0.16);

  --text: #18181b;
  --text-secondary: #52525b;
  --text-muted: #9a9aa3;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-text: #1d4ed8;

  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.1);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, 0.09);
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.1);

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .07);
  --shadow-lg: 0 24px 60px -20px rgba(16, 24, 40, .2);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  transition: background .4s var(--ease), color .4s var(--ease);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm);
  font-weight: 550; font-size: 14px; letter-spacing: -0.01em;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              transform .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
  white-space: nowrap; border: 1px solid transparent;
}
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-xs); }
.btn-ghost { background: var(--bg-input); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; transform: translateY(-1px); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
[data-theme='light'] .card { box-shadow: var(--shadow-xs); }

/* ---------- Form fields ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 13px; font-weight: 550;
  color: var(--text-secondary); margin-bottom: 8px;
}
.input {
  width: 100%; padding: 13px 15px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14.5px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--bg-elevated);
}

/* ---------- Toggle switch ---------- */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-strong); border-radius: 999px;
  transition: background .25s var(--ease);
}
.switch .slider::before {
  content: ''; position: absolute; height: 20px; width: 20px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 550; letter-spacing: -0.01em;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red   { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-muted { background: var(--bg-hover); color: var(--text-muted); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Toggle slot (theme + language) ---------- */
#toggleSlot { display: flex; align-items: center; gap: 8px; }

/* ---------- Theme / language toggle buttons ---------- */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--bg-input); border: 1px solid var(--border);
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.theme-toggle:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.theme-toggle svg { width: 18px; height: 18px; stroke: var(--text-secondary); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
[data-theme='light'] .theme-toggle .sun { display: block; }
[data-theme='light'] .theme-toggle .moon { display: none; }

.lang-toggle {
  height: 40px; min-width: 40px; padding: 0 13px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.03em; transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.lang-toggle:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text); }

/* ---------- Toast (стопка всплывашек внизу экрана) ----------
   Несколько сообщений подряд больше не затирают друг друга: они складываются
   стопкой. Время показа задаётся из JS (зависит от длины текста) — сюда оно
   приходит как animation-duration полоски прогресса. */
.toast-stack {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: min(460px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  position: relative; width: 100%;
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  color: var(--text); padding: 13px 12px 14px 15px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 550; line-height: 1.45;
  overflow: hidden; pointer-events: auto;
  opacity: 0; transform: translateY(16px) scale(.97);
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.hide { opacity: 0; transform: translateY(10px) scale(.97); }
.toast.error { border-color: var(--red); }
.toast.success { border-color: var(--green); }

.toast-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--text-muted); }
.toast.error .toast-dot { background: var(--red); }
.toast.success .toast-dot { background: var(--green); }

.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.toast-close {
  flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 24px;
  margin: -2px -2px 0 0; border-radius: 7px; color: var(--text-muted);
  opacity: .55; transition: opacity .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.toast:hover .toast-close { opacity: 1; }
.toast-close:hover { background: var(--bg-hover); color: var(--text); opacity: 1; }
.toast-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }

/* Полоска оставшегося времени: видно, сколько ещё будет висеть сообщение. */
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--border); }
.toast-bar i {
  display: block; height: 100%; width: 100%; transform-origin: left center;
  background: var(--text-muted); animation: toastBar linear forwards;
}
.toast.error .toast-bar i { background: var(--red); }
.toast.success .toast-bar i { background: var(--green); }
/* Наведение мыши / фокус — таймер на паузе, полоска замирает. */
.toast.paused .toast-bar i { animation-play-state: paused; }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- Центр уведомлений (колокольчик в шапке) ----------
   Сюда попадает всё, что успело мелькнуть всплывашкой. Иконка — SVG-маска,
   поэтому она красится currentColor и работает в обеих темах. */
.notif { position: relative; flex-shrink: 0; }
.notif-btn {
  position: relative; height: 40px; width: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary);
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.notif-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text); }
.notif-btn[aria-expanded='true'] { border-color: var(--accent); box-shadow: var(--ring); color: var(--text); }

/* Нет непрочитанных (всё прочитано) → обычный колокольчик */
.notif-ico {
  width: 18px; height: 18px; display: block; background: currentColor;
  -webkit-mask: url('/images/notification.svg') center / contain no-repeat;
          mask: url('/images/notification.svg') center / contain no-repeat;
  transition: background .18s var(--ease);
}
/* Есть непрочитанные → колокольчик со значком */
.notif-btn.has-unread .notif-ico {
  -webkit-mask-image: url('/images/notification_alert.svg');
          mask-image: url('/images/notification_alert.svg');
  background: var(--accent-text);
}
.notif-btn.has-unread { color: var(--text); }

.notif-badge {
  /* Сдвинут наружу: у самой иконки-«алерта» уже есть кружок в правом верхнем
     углу, и без сдвига счётчик наезжал бы на него. */
  position: absolute; top: -7px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  border: 2px solid var(--bg); box-sizing: content-box;
}
.notif-badge[hidden] { display: none; }

.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 360px; max-width: calc(100vw - 32px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 18px 48px rgba(0,0,0,.35);
  overflow: hidden; animation: fadeUp .16s var(--ease) both;
}
.notif-panel[hidden] { display: none; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.notif-head-title { font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.notif-clear {
  font-size: 12px; font-weight: 600; color: var(--text-muted); padding: 4px 8px; border-radius: 7px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.notif-clear:hover { background: var(--bg-hover); color: var(--text); }

/* Список — колонка отдельных карточек с зазором. Раньше записи стояли
   вплотную, и когда непрочитанных было несколько, их одинаковая подсветка
   сливалась в одно сплошное пятно: где кончается одно уведомление и
   начинается следующее, было не видно. */
.notif-list {
  max-height: min(60vh, 460px); overflow-y: auto;
  padding: 8px; display: flex; flex-direction: column; gap: 8px;
}
.notif-item {
  position: relative;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  font-size: 13px; line-height: 1.45; color: var(--text-secondary);
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.notif-item:hover { background: var(--bg-hover); border-color: var(--border-strong); }
/* Непрочитанное: мягкая заливка и акцентная рамка. */
.notif-item.fresh {
  background: var(--accent-soft); border-color: var(--accent); color: var(--text);
}

.notif-item .notif-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--text-muted); }
.notif-item.error .notif-dot { background: var(--red); }
.notif-item.warn .notif-dot { background: var(--amber); }
.notif-item.success .notif-dot { background: var(--green); }

.notif-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.notif-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.notif-title {
  font-size: 13px; font-weight: 650; color: var(--text); line-height: 1.35;
  min-width: 0; overflow-wrap: anywhere;
}
.notif-msg { overflow-wrap: anywhere; font-size: 12.5px; color: var(--text-muted); }
.notif-item.fresh .notif-msg { color: var(--text-secondary); }
/* Справа в шапке записи: относительная метка и под ней точное время.
   Две одинаковые по тексту записи различаются именно часами. */
.notif-time {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
  line-height: 1.3; text-align: right;
}
.notif-clock { font-size: 10.5px; opacity: .75; font-variant-numeric: tabular-nums; }
.notif-empty { display: flex; flex-direction: column; gap: 4px; padding: 26px 18px; text-align: center; }
.notif-empty-title { font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.notif-empty-sub { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Подписка: баннер, карточка, заблокированное состояние ---------- */

/* Баннер над контентом. Показывается на всех вкладках, чтобы человек понимал,
   почему кнопки модерации серые, где бы он ни находился. */
.sub-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 15px 18px; border-radius: var(--radius); margin-bottom: 22px;
  border: 1px solid var(--border-strong); background: var(--bg-card);
}
.sub-banner[hidden] { display: none; }
.sub-banner.warn { border-color: var(--amber); background: var(--amber-soft); }
.sub-banner.danger { border-color: var(--red); background: var(--red-soft); }
.sub-banner-body { flex: 1; min-width: 220px; }
.sub-banner-title { font-weight: 700; font-size: 14.5px; margin-bottom: 3px; }
.sub-banner-text { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }

.sub-card .sub-grid { display: flex; flex-direction: column; gap: 2px; }
.sub-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 15px;
}
.sub-row:last-child { border-bottom: none; }
.sub-row .k { color: var(--text-secondary); }
.sub-row .v { font-weight: 600; text-align: right; }

.sub-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.sub-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sub-status.active   { color: var(--green); }
.sub-status.expiring { color: var(--amber); }
.sub-status.expired  { color: var(--red); }
.sub-status.blocked  { color: var(--text-muted); }

.sub-note { font-size: 14px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 14px; }
.sub-note.ok {
  background: var(--green-soft); border: 1px solid var(--green); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 0;
}

/* Метка «!» / число дней на пункте меню «Подписка». */
/* Плашка на странице регистрации: состояние приглашения или срок триала. */
.invite-note {
  font-size: 13.5px; line-height: 1.5; border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 16px;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary);
}
.invite-note[hidden] { display: none; }
.invite-note.ok  { background: var(--green-soft); border-color: var(--green); color: var(--text); }
.invite-note.bad { background: var(--red-soft);   border-color: var(--red);   color: var(--text); }

.nav-sub-dot { background: var(--red-soft) !important; color: var(--red) !important; }
/* Пока доступ ещё есть — жёлтый счётчик оставшихся дней, а не красный «!». */
.nav-sub-dot.warn { background: var(--amber-soft) !important; color: var(--amber) !important; }
.nav-sub-dot[hidden] { display: none; }

/* Режим «только просмотр» при закрытой подписке.
   Правило нужно ИМЕННО в CSS: кнопки действий внутри карточек комментариев и
   строк страниц рисуются динамически, перечислить их по id невозможно.
   Настоящий запрет — на бэкенде; это только оформление. */
body.sub-locked .comment .acts .btn,
body.sub-locked .page-row .ctrl .btn,
body.sub-locked .page-row .switch,
body.sub-locked [data-act],
body.sub-locked .btn[disabled],
body.sub-locked .switch input[disabled] + .slider {
  opacity: .45;
  pointer-events: none;
  cursor: not-allowed;
}
body.sub-locked .comment .acts,
body.sub-locked .page-row .ctrl { position: relative; }

/* ---------- Глобальный индикатор загрузки (верхняя полоса) ---------- */
#topLoader {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 2000; pointer-events: none; overflow: hidden;
  opacity: 0; transition: opacity .2s var(--ease);
}
#topLoader.active { opacity: 1; }
#topLoader::before {
  content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loaderSlide 1.1s infinite linear;
}
@keyframes loaderSlide { from { transform: translateX(-120%); } to { transform: translateX(370%); } }

/* ---------- Инлайновый спиннер + плейсхолдер загрузки ---------- */
.spin {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box { display: grid; place-items: center; padding: 40px 20px; }
.btn .spin { width: 15px; height: 15px; border-width: 2px; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid var(--bg); }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.97); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.fade-up { animation: fadeUp .5s var(--ease) both; }

/* ====================================================================
   AUTH PAGES (login / register / reset)
   ==================================================================== */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  position: relative; overflow: hidden;
}
.auth-wrap::before, .auth-wrap::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(90px);
  opacity: .5; z-index: 0; pointer-events: none;
}
.auth-wrap::before {
  width: 460px; height: 460px; background: var(--accent);
  top: -160px; left: -120px; animation: float1 14s ease-in-out infinite;
}
.auth-wrap::after {
  width: 380px; height: 380px; background: #38bdf8;
  bottom: -160px; right: -100px; opacity: .35; animation: float2 18s ease-in-out infinite;
}
@keyframes float1 { 50% { transform: translate(40px, 30px) scale(1.08); } }
@keyframes float2 { 50% { transform: translate(-30px, -40px) scale(1.12); } }

.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 42px 38px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: var(--shadow-lg);
  animation: pop .55s var(--ease) both;
}
[data-theme='light'] .auth-card { background: rgba(255, 255, 255, 0.78); }

/* Логотип по центру: .auth-logo — flex-контейнер, justify-content: center
   выравнивает его содержимое (иконку и название) по центру главной оси. */
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; }
.auth-logo .mark {
  width: 40px; height: 40px;
  align-items: center;
  display: grid; place-items: center; flex-shrink: 0;
}
.auth-logo .mark img { width: 40px; height: 40px; align-items: center; object-fit: contain; display: block; }
.auth-logo .mark svg { width: 20px; height: 20px; align-items: center; stroke: #fff; }
.auth-logo span { font-family: var(--font-display); align-items: center; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }

.auth-card h1 { font-size: 26px; margin-bottom: 7px; }
.auth-sub { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 28px; }
.auth-foot { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-secondary); }
.auth-foot a { color: var(--accent-text); font-weight: 550; }
.auth-foot a:hover { text-decoration: underline; }

.auth-top-toggle { position: absolute; top: 24px; right: 24px; z-index: 2; }

/* Дисклеймер и юридические ссылки на страницах входа/регистрации.
   Снижают риск ложного флага фишинга: явно сообщаем, что сервис независим
   от Meta и не запрашивает пароль Facebook. */
.auth-disclaimer {
  margin-top: 22px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-muted);
  font-size: 12px; line-height: 1.5; text-align: center;
}
.auth-legal { text-align: center; margin-top: 12px; font-size: 12.5px; color: var(--text-muted); }
.auth-legal a { color: var(--text-secondary); }
.auth-legal a:hover { text-decoration: underline; color: var(--text); }

.form-error {
  background: var(--red-soft); color: var(--red);
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px; display: none;
  border: 1px solid transparent;
}
.form-error.show { display: block; animation: fadeIn .25s ease; }

/* ---------- Показать пароль (глазик) ---------- */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--text-muted); border-radius: 8px; background: transparent;
}
.pw-eye:hover { color: var(--text-secondary); background: var(--bg-hover); }

/* ---------- Анимированный фон «мамонты» (вход/регистрация) ----------
   Размеры/отступы легко правятся этими переменными: */
.mamont-bg {
  --m-size: 120px;   /* размер мамонта */
  --m-gap: 100px;    /* отступ между мамонтами по горизонтали */
  --m-vgap: 70px;    /* отступ между строками по вертикали */
  position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  display: flex; flex-direction: column; justify-content: center; gap: var(--m-vgap);
  opacity: .16;
}
.mamont-row { height: var(--m-size); overflow: hidden; flex-shrink: 0; }
.mamont-track {
  display: flex; width: max-content; will-change: transform;
  animation: mamontMarquee linear infinite;
}
.mamont-row.rtl .mamont-track { animation-direction: reverse; }
.mamont-item {
  width: var(--m-size); height: var(--m-size); margin-right: var(--m-gap); flex-shrink: 0;
  background: var(--mamont-url) center / contain no-repeat;
}
/* Трек содержит 2 одинаковые копии — сдвиг на -50% бесшовно зацикливает. */
@keyframes mamontMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .mamont-track { animation: none; } }

/* ====================================================================
   DASHBOARD LAYOUT — top nav + centered column
   ==================================================================== */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Top navigation bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.topbar-inner {
  max-width: var(--content-max); margin: 0 auto;
  height: var(--nav-h); padding: 0 32px;
  display: flex; align-items: center; gap: 24px;
}

/* Brand */
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand .mark {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
}
.brand .mark img { width: 38px; height: 38px; object-fit: contain; display: block; }
.brand .mark svg { width: 36px; height: 36px; stroke: var(--accent); color: var(--accent); }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }

/* Nav (center) — flex:1 keeps it centred between brand and actions without overlap */
.nav { display: flex; align-items: center; justify-content: center; gap: 3px; flex: 1 1 auto; min-width: 0; }
.nav-label { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: background .16s var(--ease), color .16s var(--ease);
  cursor: pointer; position: relative; white-space: nowrap;
}
.nav-item svg { width: 17px; height: 17px; stroke: currentColor; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 550; }
.nav-item .count {
  font-size: 11px; background: var(--bg-hover); font-weight: 600;
  padding: 1px 7px; border-radius: 99px; color: var(--text-muted); line-height: 1.6;
}
.nav-item.active .count { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-text); }

/* Right cluster — kept compact so the (wider) Russian nav never collides with it.
   Refresh is icon-only; the user's name/email appears only on very wide screens. */
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* User chip */
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 4px; }
.user-chip .av {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px;
  font-family: var(--font-display);
}
.user-chip .meta { display: none; overflow: hidden; max-width: 150px; }
.user-chip .meta .n { font-size: 13.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta .e { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mobile page title (hidden on desktop) */
.topbar-title { display: none; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }

/* Hamburger (mobile only) */
.menu-toggle {
  display: none; width: 40px; height: 40px; border-radius: 11px;
  place-items: center; flex-shrink: 0;
  background: var(--bg-input); border: 1px solid var(--border);
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.menu-toggle:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.menu-toggle svg { width: 20px; height: 20px; stroke: var(--text-secondary); }

.sidebar-backdrop { display: none; }

/* ---------- Main / content ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 44px 32px 72px; }

.page { display: none; }
.page.active { display: block; animation: fadeUp .4s var(--ease) both; }
.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: 30px; margin-bottom: 8px; }
.page-head p { color: var(--text-secondary); font-size: 15px; max-width: 640px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 34px; }
.stat { padding: 24px 24px 26px; transition: border-color .18s var(--ease), transform .18s var(--ease); }
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat .label { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.stat .label svg { width: 16px; height: 16px; stroke: var(--text-muted); }
.stat .value { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }

/* ---------- Section card ---------- */
.section { padding: 28px; margin-bottom: 22px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-head h3 { font-size: 18px; margin-bottom: 5px; }
.section-head p { font-size: 14px; color: var(--text-secondary); }

/* ---------- Comments inbox ---------- */
#inboxList, #recentList { display: flex; flex-direction: column; gap: 12px; }
.comment {
  display: flex; gap: 15px; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  animation: fadeUp .35s var(--ease) both;
}
.comment:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.comment .av {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #38bdf8, #60a5fa);
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px;
  font-family: var(--font-display);
}
/* Фото-аватар: заполняем круг, обрезая по краям. */
.comment img.av { object-fit: cover; background: var(--bg-hover); }
.comment .body { flex: 1; min-width: 0; }
.comment .meta-row { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; flex-wrap: wrap; }
.comment .name { font-weight: 600; font-size: 14.5px; }
.comment .time { font-size: 12.5px; color: var(--text-muted); }
.comment .text { font-size: 14.5px; color: var(--text-secondary); word-break: break-word; line-height: 1.6; }
.comment.is-hidden .text { opacity: .5; }
.comment .acts { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- Page list rows ---------- */
.page-row {
  display: flex; align-items: center; gap: 15px; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); margin-bottom: 12px;
  transition: border-color .18s var(--ease), opacity .18s var(--ease);
}
/* Ручка для перетаскивания страницы */
.page-row .drag-handle {
  display: grid; place-items: center; flex-shrink: 0;
  width: 22px; align-self: stretch; cursor: grab;
  color: var(--text-muted); margin: -18px 0 -18px -6px;
  touch-action: none; /* на телефоне жест по ручке = перетаскивание, не скролл */
}
.page-row .drag-handle:hover { color: var(--text-secondary); }
.page-row .drag-handle:active { cursor: grabbing; }
.page-row .drag-handle svg { width: 16px; height: 18px; }
.page-row.dragging { opacity: .45; border-color: var(--accent); }
.page-row:last-child { margin-bottom: 0; }
.page-row:hover { border-color: var(--border-strong); }
.page-row .pic {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #1877f2, #00c6ff);
  display: grid; place-items: center; color: #fff;
  position: relative; overflow: hidden;
}
.page-row .pic svg { width: 21px; height: 21px; stroke: #fff; }
/* Фото страницы поверх иконки; если не загрузится — img удаляется, остаётся иконка. */
.page-row .pic .pic-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-row .info { flex: 1; min-width: 0; }
.page-row .info .nm { font-weight: 550; font-size: 15px; }
.page-row .info .id { font-size: 12.5px; color: var(--text-muted); }
.page-row .ctrl { display: flex; align-items: center; gap: 14px; }

/* Скролл списка подключённых страниц: при большом количестве страниц список
   не растягивает карточку бесконечно, а прокручивается внутри неё. */
#pagesList { max-height: 60vh; overflow-y: auto; overflow-x: hidden; }
#pagesList::-webkit-scrollbar { width: 8px; }
/* небольшой отступ, чтобы полоса прокрутки не наезжала на кнопки «Delete» */
.card.section:has(> #pagesList) #pagesList { padding-right: 4px; margin-right: -4px; }

/* ---------- Rule rows ---------- */
.rule {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--border);
}
.rule:first-child { padding-top: 4px; }
.rule:last-child { border-bottom: none; }
.rule .rinfo h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; font-family: var(--font-body); letter-spacing: 0; }
.rule .rinfo p { font-size: 13.5px; color: var(--text-secondary); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty svg { width: 44px; height: 44px; stroke: var(--text-muted); margin-bottom: 14px; opacity: .55; }
.empty h4 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; font-family: var(--font-body); }
.empty p { font-size: 14px; max-width: 340px; margin: 0 auto; line-height: 1.6; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(5px); display: none; place-items: center;
  z-index: 200; padding: 24px; animation: fadeIn .2s ease;
}
.modal-bg.show { display: grid; }
.modal {
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 32px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); animation: pop .35s var(--ease) both;
  max-height: 84vh; display: flex; flex-direction: column;
}
.modal h3 { font-size: 20px; margin-bottom: 6px; }
.modal .msub { font-size: 14px; color: var(--text-secondary); margin-bottom: 22px; }
.modal .scroll { overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.modal .foot { display: flex; gap: 12px; margin-top: 26px; }

.select-row {
  display: flex; align-items: center; gap: 13px; padding: 15px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; cursor: pointer; transition: background .16s var(--ease), border-color .16s var(--ease);
}
.select-row:hover { background: var(--bg-hover); }
.select-row.sel { border-color: var(--accent); background: var(--accent-soft); }
/* Уже подключённая страница — серая и некликабельная. */
.select-row.is-connected { opacity: .55; cursor: default; }
.select-row.is-connected:hover { background: transparent; }
.select-row.is-connected input { cursor: default; }
.select-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.select-row .nm { font-weight: 550; font-size: 14.5px; }
.select-row .id { font-size: 12.5px; color: var(--text-muted); }

.info-banner {
  display: flex; gap: 12px; padding: 15px 17px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid transparent;
  font-size: 13.5px; color: var(--accent-text); margin-bottom: 20px; line-height: 1.5;
}

/* ---------- Панель Facebook-аккаунтов (чипы-переключатели) ---------- */
.acct-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.acct-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; margin-right: 2px; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; font-weight: 550;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
  user-select: none;
}
.acct-chip:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.acct-chip.sel { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.acct-chip .st { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.acct-chip .st.warn { background: var(--amber); }
.acct-chip .st.bad { background: var(--red); }
.acct-chip .cnt { font-size: 11px; background: var(--bg-hover); padding: 1px 7px; border-radius: 99px; color: var(--text-muted); }
.acct-chip.sel .cnt { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-text); }
.acct-x {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  color: var(--text-muted); font-size: 13px; line-height: 1; padding: 0;
  transition: background .15s, color .15s;
}
.acct-x:hover { background: var(--red-soft); color: var(--red); }
.info-banner svg { width: 18px; height: 18px; stroke: currentColor; flex-shrink: 0; margin-top: 1px; }

/* Компактный селект периода в инбоксе */
.range-select {
  height: 34px; padding: 0 30px 0 12px; border-radius: 9px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .16s var(--ease), border-color .16s var(--ease);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.range-select:hover { background-color: var(--bg-hover); border-color: var(--border-strong); }
.range-select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.range-select option { background: var(--bg-elevated); color: var(--text); }

.divider { height: 1px; background: var(--border); margin: 24px 0; }

.inline-form { display: flex; gap: 10px; }
.inline-form .input { flex: 1; }

/* ====================================================================
   RESPONSIVE
   ==================================================================== */

/* Wide screens: show the user's name/email beside the avatar */
@media (min-width: 1440px) {
  .user-chip .meta { display: block; }
}

/* Tablet: nudge column padding */
@media (max-width: 1240px) {
  .content { padding: 36px 26px 64px; }
}

/* Narrow / tablet: collapse nav into a drop panel.
   Breakpoint is 1160px because the Russian labels are wider than English —
   the horizontal nav only appears when there's genuinely room for it. */
@media (max-width: 1160px) {
  .topbar-inner { gap: 10px; padding: 0 22px; }

  .menu-toggle { display: grid; }
  .brand { gap: 9px; }
  .brand span { display: none; }
  .topbar-title {
    display: block; flex: 1 1 auto; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* Slim the right cluster so nothing overflows off-screen on phones */
  .topbar-actions { gap: 6px; }
  .user-chip { display: none; }

  /* Nav becomes a slide-down panel */
  .nav {
    position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 300;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 14px 16px 18px;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-14px); opacity: 0; pointer-events: none;
    transition: transform .28s var(--ease), opacity .28s var(--ease);
  }
  .nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-item { padding: 13px 15px; font-size: 15px; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item .count { margin-left: auto; }
  .nav-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 600; padding: 6px 10px 2px; }

  /* Backdrop sits BELOW the top bar (z:100) so the drawer — which lives inside
     the bar's stacking context — stays crisp and tappable above it. */
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 90;
    background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .28s var(--ease);
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .page-head h1 { font-size: 25px; }
  .section { padding: 22px; }
  .section-head { flex-direction: column; align-items: stretch; }
  .section-head .btn { align-self: flex-start; }
}

/* Small phones */
@media (max-width: 520px) {
  .content { padding: 28px 16px 56px; }
  .stats { grid-template-columns: 1fr; }
  .topbar-inner { padding: 0 12px; gap: 6px; }
  .theme-toggle, .lang-toggle, .menu-toggle, #logoutBtn, .notif-btn { height: 38px; }
  .theme-toggle, .menu-toggle, .notif-btn { width: 38px; padding: 0; }
  .toast-stack { bottom: 14px; width: calc(100vw - 24px); }
  .comment .acts { flex-wrap: wrap; }
  .page-row { flex-wrap: wrap; }
  .page-row .ctrl { width: 100%; justify-content: space-between; }
  .modal { padding: 24px; }
  .modal .foot { flex-direction: column; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav, .sidebar-backdrop { transition: none; }
  .page.active, .comment, .auth-card, .modal, .fade-up, .notif-panel { animation: none; }
  /* Полоску таймера оставляем (она несёт смысл — сколько ещё висит тост),
     но убираем «выезд» карточки. */
  .toast { transition: opacity .2s linear; transform: none !important; }
  .stat:hover, .btn-primary:hover, .btn-danger:hover { transform: none; }
}
/* end of stylesheet */

/* ===== App Review — professional layout ===== */
.page-head.between { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pages-oauth-note { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; max-width: 640px; }

/* Top 4-card status row */
.status-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px;
}
.status-cell { padding: 18px; }
.review-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.review-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.review-card-head h4 { font-family: var(--font-body); font-size: 14.5px; font-weight: 600; margin: 0; }
.review-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-green { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.status-red { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.status-text { font-size: 15px; font-weight: 600; }
.status-green-text { color: var(--green); }
.status-amber-text { color: var(--amber); }
.status-red-text { color: var(--red); }
/* Иконки-файлы (network.svg / moderation.svg) внутри цветной плитки */
.review-icon img { width: 18px; height: 18px; display: block; }
.review-sub { font-size: 12.5px; color: var(--text-muted); }
.review-strong { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px; }

/* Facebook Pages — плотная страница, ей нужна более широкая колонка.
   Расширяем И контент, И верхнюю панель, чтобы бренд/навигация оставались
   выровнены по левому краю контента. */
.app:has(#page-pages.active) .content,
.app:has(#page-pages.active) .topbar-inner { max-width: var(--content-max-wide); }

/* Two-column main + aside layout.
   minmax(0, …) обязателен: без него трек «1fr» не может стать уже своего
   min-content (длинный endpoint без переносов, таймлайн из 8 шагов), из-за чего
   левая колонка вылезала и перекрывала правую ленту событий. */
.pages-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pages-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pages-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* Webhook subscription card */
.code-box {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 9px;
  padding: 11px 13px; margin: 6px 0 14px; font-family: monospace; font-size: 12.5px;
  color: var(--text-secondary); overflow-x: auto; white-space: nowrap;
}
.code-box-copy { display: flex; align-items: center; gap: 10px; overflow: visible; }
.code-box-copy code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.copy-btn {
  display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px; color: var(--text-muted);
  background: var(--bg-input); border: 1px solid var(--border);
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.copy-btn:hover { color: var(--text); background: var(--bg-hover); border-color: var(--border-strong); }
.copy-btn svg { width: 15px; height: 15px; stroke: currentColor; }
.tech-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.tech-row:last-child { border-bottom: none; }
.tech-key { color: var(--text-muted); }
.tech-val { font-family: monospace; font-size: 12px; color: var(--text-secondary); text-align: right; }
.perm-badge { display: inline-block; font-family: monospace; font-size: 12.5px; background: var(--green-soft); color: var(--green); padding: 5px 11px; border-radius: 7px; font-weight: 600; }
.sub-success-box {
  display: flex; gap: 11px; align-items: flex-start; margin-top: 14px;
  background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  border-radius: 10px; padding: 13px 15px;
}

/* Permission + tech grid */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.review-card { padding: 20px; }

/* Horizontal timeline */
.htimeline { display: flex; justify-content: space-between; gap: 8px; position: relative; padding-top: 6px; overflow-x: auto; }
.htl-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-width: 82px; position: relative; text-align: center; }
.htl-step:not(:last-child)::after {
  content: ''; position: absolute; top: 15px; left: calc(50% + 18px); right: calc(-50% + 18px);
  height: 2px; background: var(--green); opacity: 0.4;
}
.htl-dot {
  width: 30px; height: 30px; border-radius: 50%; background: var(--green);
  color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700;
  flex-shrink: 0; position: relative; z-index: 1;
}
.htl-label { font-size: 11.5px; color: var(--text-secondary); line-height: 1.3; }
.htl-time { font-size: 10.5px; color: var(--text-muted); font-family: monospace; margin-top: 1px; }

/* Timezone note under the timeline */
.pages-tz-note {
  text-align: center; font-size: 12px; color: var(--text-muted);
  padding: 18px 0 2px;
}
.pages-tz-note:empty { display: none; }

/* Live event feed (right column) */
.live-feed-card { padding: 18px; position: sticky; top: 84px; }
.live-feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--green); }
.live-feed { display: flex; flex-direction: column; }
.live-empty { padding: 28px 8px; text-align: center; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.live-ev {
  position: relative; padding: 0 0 20px 24px; animation: fadeUp .4s var(--ease) both;
}
.live-ev::before {
  content: ''; position: absolute; left: 4px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.live-ev:not(:last-child)::after {
  content: ''; position: absolute; left: 8px; top: 16px; bottom: 0; width: 2px; background: var(--border);
}
.live-ev-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.live-ev-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.live-ev-time { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.live-ev-body {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-size: 12px; color: var(--text-secondary);
}
.live-ev-body code, .live-ev-json { font-family: monospace; font-size: 11.5px; white-space: pre-wrap; color: var(--text-secondary); }
.live-ev-json .k { color: #7dd3fc; }
.live-ev-json .s { color: #86efac; }
.mod-bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 8px; }
.mod-bar > span { display: block; height: 100%; width: 0; background: var(--green); animation: modFill 1.2s var(--ease) forwards; }
@keyframes modFill { to { width: 100%; } }

/* Subscription animation (kept for the connect moment) */
.sub-anim { display: flex; flex-direction: column; gap: 12px; }
.sub-anim-row { display: flex; align-items: center; gap: 10px; font-size: 14px; animation: fadeUp .35s var(--ease) both; }
.sub-spinner { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; }
.tl-check { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--green-soft); color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .pages-layout { grid-template-columns: 1fr; }
  .live-feed-card { position: static; }
}
@media (max-width: 860px) {
  .status-row { grid-template-columns: 1fr 1fr; }
  .pages-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .status-row { grid-template-columns: 1fr; }
}
/* ==========================================================================
   Работа с большим числом аккаунтов и страниц
   ========================================================================== */

/* ---------- Переключатель области (аккаунт / страница) в шапке ---------- */
.scope { position: relative; flex-shrink: 1; min-width: 0; }
.scope-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 260px;
  height: 36px; padding: 0 10px 0 11px; border-radius: 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); font-family: inherit; font-size: 13px; font-weight: 550;
  cursor: pointer; transition: background .16s var(--ease), border-color .16s var(--ease);
}
.scope-btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.scope-btn[aria-expanded='true'] { border-color: var(--accent); box-shadow: var(--ring); }
.scope-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.scope-dot.warn { background: var(--amber); }
.scope-dot.bad { background: var(--red); }
.scope-dot.none { background: var(--text-muted); }
.scope-caret { flex-shrink: 0; color: var(--text-muted); }

.scope-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 18px 48px rgba(0,0,0,.35);
  overflow: hidden; animation: fadeUp .16s var(--ease) both;
}
.scope-menu[hidden] { display: none; }
.scope-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.scope-search-input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
  color: var(--text); font-family: inherit; font-size: 13.5px;
}
.scope-search-input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.6); }
.scope-list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.scope-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; padding: 8px 10px 5px; }
.scope-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-secondary); font-size: 13.5px; text-align: left;
  background: transparent; border: 0; font-family: inherit;
}
.scope-item:hover, .scope-item.kbd { background: var(--bg-hover); color: var(--text); }
.scope-item.sel { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.scope-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-item .cnt { font-size: 11px; background: var(--bg-hover); padding: 1px 7px; border-radius: 99px; color: var(--text-muted); flex-shrink: 0; }
.scope-item.sel .cnt { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-text); }
.scope-item .sub { font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }
.scope-item-page { padding-left: 26px; }
.scope-act {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  color: var(--text-muted); flex-shrink: 0; opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.scope-item:hover .scope-act { opacity: 1; }
.scope-act:hover { background: var(--bg-card); color: var(--text); }
.scope-act.danger:hover { background: var(--red-soft); color: var(--red); }
.scope-empty { padding: 18px 12px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ---------- Панель фильтров (инбокс, страницы, модалка) ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 0 0 14px; margin-bottom: 4px;
}
.filter-search { position: relative; display: flex; align-items: center; flex: 1 1 220px; min-width: 180px; }
.filter-search > svg { position: absolute; left: 11px; color: var(--text-muted); pointer-events: none; }
.filter-input { height: 36px; padding-left: 34px; font-size: 13.5px; }
.filter-count { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.modal-filter { padding-bottom: 10px; }

/* ---------- Панель массовых действий ---------- */
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  animation: fadeUp .16s var(--ease) both;
}
.bulk-bar[hidden] { display: none; }
.bulk-count { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.bulk-spacer { flex: 1; }

/* Чекбокс выбора внутри карточки комментария / строки страницы */
.comment .pick, .page-row .pick { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; align-self: center; }
.comment.picked, .page-row.picked { border-color: var(--accent); background: var(--accent-soft); }
.select-mode .comment .acts { display: none; }

/* Индикатор «грузим ещё» внизу бесконечного списка */
.load-more-hint { display: flex; justify-content: center; padding: 14px 0 4px; color: var(--text-muted); font-size: 12.5px; }

@media (max-width: 720px) {
  .scope-btn { max-width: 150px; }
  .scope-menu { right: -60px; }
  /* На узких экранах панель уведомлений упирается в правый край — сдвигаем
     её внутрь, иначе часть текста уезжает за экран. */
  .notif-panel { right: -46px; width: min(340px, calc(100vw - 24px)); }
  .bulk-bar { position: sticky; bottom: 0; z-index: 20; }
}

/* ====================================================================
   DESIGN REFRESH v3 — «крупнее и просторнее»
   Отдельным блоком-надстройкой (идёт последним → перекрывает базовые
   правила по каскаду), чтобы улучшения читались одним куском и легко
   откатывались. Три цели:
     1) шире рабочая область и крупнее мелкие тексты для читаемости;
     2) шапка в русском языке НИКОГДА не наезжает сама на себя;
     3) вкладка «Connect Facebook» — опрятнее и крупнее.
   ==================================================================== */

/* ---- 1. Ширина и базовый размер ---- */
:root {
  --content-max: 1600px;
  /* «Широкий» режим приравнен к обычному: раньше вкладка Facebook Pages
     расширяла И контент, И шапку до 1760px, из-за чего при переходе на неё
     логотип с меню заметно уезжали влево. Теперь ширина шапки и контента
     ОДНА на всех вкладках — заголовок стоит на месте. */
  --content-max-wide: 1600px;
  --nav-h: 78px;
  --topbar-h: 78px;
}
/* Тёмная тема: приглушённые тексты делаем заметно контрастнее — бейджи и
   подписи раньше «терялись» на чёрном. Светлая тема сохраняет свои значения. */
:root:not([data-theme='light']) {
  --text-secondary: #b8b8c2;
  --text-muted: #8c8c98;
}
body { font-size: 16.5px; }
.content { padding: 46px 44px 96px; max-width: var(--content-max); }
/* Всегда резервируем место под вертикальный скроллбар. Иначе на «коротких»
   вкладках (Comments) скроллбара нет, а на «длинных» (Facebook Pages) он
   появляется и сужает окно — центрированная шапка и контент прыгают вбок при
   переключении. scrollbar-gutter держит ширину постоянной на всех вкладках. */
html { scrollbar-gutter: stable; }
/* Приглушённый бейдж читаем: текст вторичный, а не почти-невидимый muted */
.badge-muted { color: var(--text-secondary); }

/* Заголовки страниц крупнее и «воздушнее» */
.page-head { margin-bottom: 36px; }
.page-head h1 { font-size: 33px; }
.page-head p { font-size: 16px; max-width: 720px; line-height: 1.6; }

/* Навигация в шапке. Раньше она «плавала» по центру и из-за широкого правого
   кластера казалась смещённой и кривой. Теперь выравниваем меню сразу за
   логотипом (слева) — это ровно и предсказуемо, а элементы справа сами уходят
   к правому краю. */
.topbar-inner { gap: 22px; padding: 0 36px; }
.nav { justify-content: flex-start; gap: 4px; }
.brand { margin-right: 6px; }
.nav-item { font-size: 15px; padding: 10px 14px; gap: 8px; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item .count { font-size: 12px; }
.brand span { font-size: 18px; }

/* Кнопки чуть крупнее — мелкие «-sm» перестают быть микроскопическими */
.btn { font-size: 14.5px; padding: 12px 19px; }
.btn-sm { font-size: 14px; padding: 9px 15px; border-radius: 10px; }
.btn-lg { font-size: 15.5px; }

/* Карточки статистики — крупнее и «солиднее»: одинаковая высота, число прижато
   к низу, чтобы ряд смотрелся ровно и не терялся в пустом пространстве. */
.stats { gap: 20px; }
.stat { padding: 26px 28px 28px; min-height: 148px; display: flex; flex-direction: column; justify-content: space-between; }
.stat .label { font-size: 14.5px; }
.stat .value { font-size: 42px; }

/* Секции и их заголовки */
.section { padding: 30px; }
.section-head h3 { font-size: 19.5px; }
.section-head p { font-size: 14.5px; }

/* Лента комментариев — крупнее имя, текст и время */
.comment { padding: 22px; gap: 16px; }
.comment .av { width: 46px; height: 46px; font-size: 16px; }
.comment .name { font-size: 15.5px; }
.comment .time { font-size: 13px; }
.comment .text { font-size: 15.5px; }

/* Строки страниц */
.page-row { padding: 20px 22px; }
.page-row .info .nm { font-size: 15.5px; }
.page-row .info .id { font-size: 13px; }
.page-row .pic { width: 46px; height: 46px; }

/* Правила модерации */
.rule .rinfo h4 { font-size: 15.5px; }
.rule .rinfo p { font-size: 14px; }

/* Поля, фильтры, селекты — крупнее и выше (удобнее попадать) */
.input { font-size: 15px; padding: 13px 16px; }
.field label { font-size: 13.5px; }
.filter-input { height: 40px; font-size: 14.5px; }
.filter-count { font-size: 13px; }
.range-select { height: 38px; font-size: 13.5px; }
.badge { font-size: 12.5px; padding: 4px 11px; }
.check-inline { font-size: 13.5px; }

/* Переключатель области (scope) в шапке */
.scope-btn { height: 38px; font-size: 13.5px; max-width: 280px; }
.scope-item { font-size: 14px; }
.scope-item .cnt { font-size: 11.5px; }

/* Модалка — просторнее */
.modal { padding: 34px; max-width: 560px; }
.modal h3 { font-size: 21px; }
.modal .msub { font-size: 14.5px; }
.select-row .nm { font-size: 15px; }
.select-row .id { font-size: 13px; }

/* ---- 2. Шапка: русский текст шире — сворачиваем навигацию в «бургер»
        РАНЬШЕ, чтобы пункты меню и правый кластер не наезжали друг на друга.
        Язык живёт в html[lang] (см. i18n.js), поэтому порог делаем
        языко-зависимым: EN сворачивается на 1160px, RU — уже на 1440px. ---- */
@media (min-width: 1161px) and (max-width: 1440px) {
  html[lang='ru'] .menu-toggle { display: grid; }
  html[lang='ru'] .brand span { display: none; }
  html[lang='ru'] .topbar-title {
    display: block; flex: 1 1 auto; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html[lang='ru'] .user-chip { display: none; }
  html[lang='ru'] .nav {
    position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 300;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 14px 16px 18px;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-14px); opacity: 0; pointer-events: none;
    transition: transform .28s var(--ease), opacity .28s var(--ease);
  }
  html[lang='ru'] .nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  html[lang='ru'] .nav-item { padding: 13px 15px; font-size: 15.5px; }
  html[lang='ru'] .nav-item .count { margin-left: auto; }
  html[lang='ru'] .nav-label {
    display: block; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.07em; color: var(--text-muted); font-weight: 600; padding: 6px 10px 2px;
  }
  html[lang='ru'] .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 90;
    background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .28s var(--ease);
  }
  html[lang='ru'] .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
}

/* Правый кластер: гарантированно не сжимается в кашу, элементы дышат */
.topbar-actions { gap: 12px; }

/* ---- 3. Connect Facebook — крупнее и опрятнее ---- */
.page-head.between { gap: 20px; align-items: flex-start; }
.page-head .head-actions { gap: 10px; }
.pages-oauth-note { font-size: 13px; margin-top: 8px; max-width: 680px; }

/* Верхние 4 статус-карточки */
.status-row { gap: 16px; }
.status-cell { padding: 20px 22px; }
.review-card-head { gap: 12px; margin-bottom: 16px; }
.review-icon { width: 38px; height: 38px; border-radius: 10px; }
.review-icon svg { width: 20px; height: 20px; }
.review-icon img { width: 20px; height: 20px; }
.review-card-head h4 { font-size: 15.5px; }
.review-status { gap: 9px; }
.status-text { font-size: 16px; }
.status-dot { width: 10px; height: 10px; }
.review-sub { font-size: 13.5px; }
.review-strong { font-size: 15.5px; }

/* Карточка подписки на вебхук + тех.детали */
.review-card { padding: 24px; }
.code-box { font-size: 13px; padding: 12px 14px; }
.tech-row { font-size: 14px; padding: 10px 0; }
.tech-val { font-size: 12.5px; }
.tech-key { font-size: 13.5px; }
.perm-badge { font-size: 13.5px; padding: 6px 12px; }
.copy-btn { width: 32px; height: 32px; }

/* Таймлайн событий */
.htl-dot { width: 32px; height: 32px; font-size: 15px; }
.htl-label { font-size: 12.5px; }
.htl-time { font-size: 11.5px; }
.htl-step:not(:last-child)::after { top: 16px; }

/* Живая лента событий (правая колонка) */
.live-feed-card { padding: 20px; top: 90px; }
.live-ev-title { font-size: 14.5px; }
.live-ev-time { font-size: 12px; }
.live-ev-body { font-size: 13px; padding: 11px 13px; }
.live-ev-body code, .live-ev-json { font-size: 12.5px; }

/* Чипы Facebook-аккаунтов */
.acct-chip { font-size: 13.5px; padding: 8px 13px; }
.acct-label { font-size: 12.5px; }

/* На больших экранах показываем имя пользователя чуть раньше */
@media (min-width: 1460px) {
  .user-chip .meta { display: block; }
}

/* Мелкие телефоны: не раздуваем отступы после укрупнения */
@media (max-width: 520px) {
  .content { padding: 26px 16px 56px; }
  .page-head h1 { font-size: 27px; }
  .stat .value { font-size: 34px; }
}

/* ---- 4. Вкладка Facebook: раскладка без кривого пустого провала ----
   Раньше «Подключённые страницы» и «Подписка на Webhook» стояли рядом в
   двух колонках разной высоты — слева зияла пустота, а строки страниц
   сжимались (имя переносилось, кнопка «Удалить» подрезалась). Теперь список
   страниц — на всю ширину, а доказательные карточки App Review выстраиваются
   ровной адаптивной сеткой (сколько влезет по 300px), заполняясь без дыр. */
#connectedPagesCard { width: 100%; }
.review-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }

/* Строки страниц: имя не переносим (обрезаем многоточием), панель управления
   не сжимаем и не переносим — кнопка «Удалить» больше не режется. */
.page-row .info { min-width: 0; }
.page-row .info .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-row .ctrl { flex-shrink: 0; flex-wrap: nowrap; }
.page-row .ctrl .btn { white-space: nowrap; }

@media (max-width: 640px) {
  /* На узком экране список и карточки — в одну колонку, строкам можно переносить
     управление вниз (там ширины действительно не хватает). */
  .review-grid { grid-template-columns: 1fr; }
  .page-row { flex-wrap: wrap; }
  .page-row .ctrl { width: 100%; justify-content: space-between; }
}
/* end DESIGN REFRESH v3 */

/* ===== Тумблер «Технические детали» (режим App Review) ===== */
.review-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  cursor: pointer; user-select: none; padding: 0 4px;
}
.review-toggle-label {
  font-size: 13px; font-weight: 500; color: var(--text-secondary); white-space: nowrap;
}
/* Когда режим выключен — правая колонка убирается, список на всю ширину */
.pages-layout.review-off { grid-template-columns: 1fr; }