/* Панель жалоб: интерфейс (panel/ берёт этот файл в свою сборку) и
   страницы входа и ошибок. Mobile-first: одна колонка, карточки, кнопки ≥44px,
   инпуты 16px (iOS не зумит). С 640px — две кнопки действий в ряд.
   Тема — всегда тёмная, независимо от настроек системы. */
:root {
  color-scheme: dark; /* тёмные поля ввода, полосы прокрутки и т.п. */
  --bg: #0f1115; --card: #181b21; --text: #e6e8eb; --muted: #9aa3ae; --line: #2a2f37;
  --accent: #60a5fa; --danger: #f87171; --warn: #fbbf24; --ok: #4ade80;
  --radius: 12px;
  /* Заливки под белый текст — насыщенные (светлые --accent/--danger — для текста). */
  --fill: #2563eb; --fill-danger: #dc2626; --fill-warn: #b45309; --fill-ok: #15803d;
  --bubble: #242a33; --bubble-out: #1e3a5f; /* реплики собеседника — справа, синеватые */
  /* Фон-картинка под вуалью (читаемость) и полупрозрачные панели поверх. */
  --veil: rgba(15, 17, 21, .68); --glass: rgba(24, 27, 33, .86); /* вуаль: 68% затемнения */
}
/* Флаги стран: в Windows эмодзи-флагов нет (видно «RU»). Шрифт только с
   флагами (Twemoji Country Flags из country-flag-emoji-polyfill, MIT;
   графика Twemoji © Twitter, CC-BY 4.0) — unicode-range: остальной текст
   идёт следующим шрифтом в списке. */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url(/flags.woff2?v=9f04f14429) format("woff2");
  font-display: swap;
}
* { box-sizing: border-box; }
/* Цвет подложки — только у html (он же цвет холста, видно при «оттягивании»
   страницы). У body фона нет: иначе он перекрыл бы слой с картинкой ниже. */
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; font: 15px/1.45 "Twemoji Country Flags", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); }
/* Фон — отдельный слой position: fixed на весь экран: при прокрутке стоит
   на месте и всегда закрывает экран целиком (background-attachment: fixed
   Safari на iPhone не умеет). Высота 100lvh — экран со свёрнутой адресной
   строкой: когда она прячется при прокрутке, снизу не появляется полоса. */
body::before {
  content: ''; position: fixed; z-index: -1; top: 0; left: 0; right: 0;
  height: 100vh; height: 100lvh;
  background: linear-gradient(var(--veil), var(--veil)), url(/bg.jpg?v=7d7aa64570) center / cover no-repeat;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
h2 .muted { font-size: inherit; }
/* Эмодзи Apple картинкой (EmojiText): высотой со строку, на линии текста. */
img.emoji { display: inline-block; width: 1.25em; height: 1.25em; margin: 0 .05em; vertical-align: -.3em; }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
}
/* Подложка шапки с размытием — отдельным слоем: backdrop-filter на самой
   шапке сделал бы её рамкой для position: fixed внутри (боковое меню и
   затемнение сжались бы до высоты шапки). */
.top::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
@media (max-width: 440px) { .top { padding-left: 12px; padding-right: 12px; } }
.top form { margin: 0; }
.topnav { display: flex; align-items: center; gap: 18px; }
.brand, .topnav a, .topnav .link { white-space: nowrap; }
.topnav a.on { color: var(--text); font-weight: 600; }

/* The drawer also covers narrow tablets so all seven sections fit without
   horizontal overflow. It works without JavaScript on server error pages. */
.menu { display: none; }
@media (max-width: 999px) {
  .topnav { display: none; }
  .menu { display: block; }
  .menu > summary {
    position: relative; z-index: 3; display: grid; place-items: center; width: 44px; height: 44px;
    margin-right: -8px; border-radius: 10px; color: var(--text); font-size: 22px; cursor: pointer; list-style: none;
  }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu > summary::before { content: '☰'; }
  .menu[open] > summary::before { content: '✕'; }
  .menu[open]::before { content: ''; position: fixed; inset: 0; z-index: 1; background: rgba(0, 0, 0, .55); }
  .drawer {
    position: fixed; z-index: 2; top: 0; right: 0; bottom: 0; width: min(82vw, 300px);
    display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
    padding: calc(64px + env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
    background: var(--card); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(0, 0, 0, .45);
    animation: drawer-in .18s ease-out;
  }
  .drawer a, .drawer .link {
    display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0 14px;
    border-radius: 10px; color: var(--text); font-size: 17px; text-align: left;
  }
  .drawer a.on { background: var(--fill); color: #fff; }
  .drawer form { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
  .drawer .link { color: var(--danger); }
}
@keyframes drawer-in { from { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
.brand { display: flex; color: var(--text); }
/* The logo picture has a transparent background: the white character with a
   dark outline reads well on the dark header without a backing. */
/* Negative margins let the logo spill into the header padding: it fills the bar
   almost edge to edge without making the header taller. */
.brand img { display: block; width: 52px; height: 52px; margin: -6px 0; }
/* On the phone the bar height is set by the 44px menu button, so the logo can be
   a bit larger and still keep the same 44px box. */
@media (max-width: 799px) { .brand img { width: 56px; height: 56px; } }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }

/* Вкладки — «таблетки», как на компьютере. На телефоне — во всю строку,
   подпись над счётчиком; ширина — по подписи: длинная («Просмотренные»)
   шире коротких и не упирается в скругление. */
.tabs { display: flex; gap: 6px; margin: 0 0 14px; }
.tab {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px;
  padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; line-height: 1.2; text-align: center;
}
.tab.on { background: var(--fill); border-color: var(--fill); color: #fff; }
.count { opacity: .75; font-size: 13px; margin-top: 2px; }

.cards { display: grid; gap: 10px; }
/* «Баны»: семь вкладок (сроки, «Капча», «ИИ»); строка раскрывается — снизу
   сообщения и кнопки. На телефоне — сеткой 4 + 3, мельче и с узкими
   отступами: иначе четыре в строку не влезают. Шире — подпись и число в одну
   строку, не влезли — на следующую. */
.tabs.bans .tab { white-space: nowrap; }
@media (max-width: 639px) {
  .tabs.bans { display: grid; grid-template-columns: repeat(4, 1fr); }
  .tabs.bans .tab { padding: 6px 2px; font-size: 13px; }
}
@media (min-width: 640px) {
  .tabs.bans { flex-wrap: wrap; }
}
.ban-item { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.ban-item[open] { border-color: var(--accent); }
.ban-item > summary { display: grid; gap: 4px; padding: 12px 14px; cursor: pointer; list-style: none; }
.ban-item > summary::-webkit-details-marker { display: none; }
.ban-body { padding: 0 14px 14px; }
.ban-body.loading { opacity: .5; }
.ban-card .facts { margin-bottom: 4px; }
.card { display: grid; gap: 4px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--text); }
.card:hover, .card:focus-visible { border-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.row.between { justify-content: space-between; }
/* Заголовок раздела со ссылкой напротив (h2 — без своего отступа). */
.section-head { margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.row:empty { display: none; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; margin-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; background: var(--line); color: var(--text); }
.badge.danger { background: var(--fill-danger); color: #fff; }
.badge.warn { background: var(--fill-warn); color: #fff; }
.badge.ok { background: var(--fill-ok); color: #fff; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }

.panel { background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.panel > :last-child { margin-bottom: 0; }
.crumbs { display: flex; justify-content: space-between; gap: 12px; margin: 4px 0 -10px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; white-space: nowrap; }
.flash { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; font-weight: 600; }
.flash.ok { background: var(--fill-ok); color: #fff; }
.flash.err { background: var(--fill-danger); color: #fff; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Карточка жалобы: факты («На», «От», ИИ…) и решение. */
dl.kv.facts { font-size: 14px; gap: 4px 14px; }
.facts dd { overflow-wrap: anywhere; }

/* Переписка — «пузыри», время в последней строке справа. */
.msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.msg { max-width: 88%; background: var(--bubble); border-radius: 16px 16px 16px 6px; padding: 6px 10px 6px 12px; }
.msg.out { align-self: flex-end; background: var(--bubble-out); border-radius: 16px 16px 6px 16px; }
.msg time { float: right; margin: 5px 0 -5px 10px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.mline { font-size: 14px; overflow-wrap: anywhere; }
.mtype { color: var(--muted); }
/* Медиа в переписке, которое можно посмотреть: подпись — кнопкой. */
.media-open { border: 0; padding: 0; background: none; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
/* Просмотр медиа поверх страницы. */
.media-dialog { border: 0; padding: 0; background: transparent; width: min(92vw, 720px); max-width: none; }
.media-dialog::backdrop { background: rgba(0, 0, 0, .8); }
.media-dialog-body { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--card); color: var(--text); }
.media-dialog .media-file { max-height: 75vh; }
/* ✕ — квадрат 40×40 под палец; отрицательные поля — шапка окна не выше
   строки. Окно при открытии ставит фокус на ✕: рамка — только с клавиатуры. */
.media-close { flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin: -8px -8px -8px 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.media-close:hover, .media-close:active { background: rgba(255, 255, 255, .08); color: var(--text); }
.media-close:focus { outline: none; }
.media-close:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mline + .body { margin-top: 2px; }
.day { align-self: center; margin: 6px 0 2px; font-size: 12px; color: var(--muted); }
.day:first-child { margin-top: 0; }

/* Карточка жалобы: на телефоне — столбиком (жалоба, сообщения, профиль);
   на ПК — профиль слева и жалоба с кнопками справа, вместе шириной как
   блок сообщений под ними. */
.detail { display: grid; gap: 12px; margin-bottom: 12px; }
.detail > .panel { margin-bottom: 0; }

.ban-history-list { display: grid; gap: 12px; }
.ban-history-entry { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.ban-history-entry > .row, .ban-history-entry > .kv { margin-bottom: 8px; }
.ban-history-entry .kv { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.ban-history-entry .kv dt { max-width: 140px; }
.ban-history-entry p { margin-bottom: 0; }

/* Решение: «Бан на N» и «Похоронить» (навсегда) → подтверждение (details). */
.decide { display: grid; gap: 8px; margin-top: 16px; }
.decide-note { margin: 8px 0 0; }
/* Поведение по проверкам ИИ: строка-итог, по нажатию — вердикты. */
.behavior > summary { cursor: pointer; }
.behavior-list { margin: 6px 0 0; padding-left: 18px; }
/* Complaint facts fill spare height; actions and model comparisons follow.
   The card grows to fit its contents. Use a smaller minimum height on mobile. */
.complaint .d-main { display: flex; flex-direction: column; min-height: 320px; }
.complaint .d-facts { flex: 1 1 auto; }
.ai-comparison { margin-top: 12px; border-top: 1px solid var(--line); min-width: 0; }
.ai-comparison > summary { min-height: 44px; padding: 12px 0; cursor: pointer; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.ai-comparison summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ai-comparison-body { display: flow-root; }
.ai-comparison .ai-comparison-refresh { float: right; min-height: 44px; padding: 8px 0 8px 12px; font-size: 13px; }
.ai-comparison-kind { margin-top: 12px; min-width: 0; }
.ai-comparison-kind + .ai-comparison-kind { border-top: 1px solid var(--line); padding-top: 12px; }
.ai-comparison-models { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 12px 0; clear: both; }
.ai-comparison-model { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.ai-comparison-model + .ai-comparison-model { border-left: 1px solid var(--line); padding-left: 8px; }
.ai-comparison-model strong { font-size: 13px; }
.ai-comparison-model .small { font-size: 12px; }
.ai-comparison-kind > .row { flex-wrap: wrap; gap: 4px; }
.complaint .d-actions { flex: none; }
.decide form { margin: 0; }
.decided { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.decided.ok { color: var(--ok); }
.decided span { display: block; color: var(--muted); font-size: 13px; }
.forever summary, .unban summary { list-style: none; }
.forever summary::-webkit-details-marker, .unban summary::-webkit-details-marker { display: none; }
.unban { margin-top: 8px; }
.confirm { display: grid; gap: 8px; margin-top: 10px; }
.confirm p { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 44px;
  padding: 8px 16px; border: 0; border-radius: 10px; font: inherit; text-align: center;
  cursor: pointer; background: var(--fill); color: #fff;
}
.btn.danger { background: var(--fill-danger); }
.btn.outline { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.forever[open] > .btn.outline, .unban[open] > .btn.outline-ok { background: var(--bg); }
.btn.ok { background: var(--fill-ok); }
.btn.outline-ok { background: transparent; color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.btn:active { opacity: .85; }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 8px 0; min-height: 40px; }

.pager { display: flex; justify-content: space-between; margin-top: 16px; }
.page-title { margin: 4px 2px 12px; }
/* «Статистика» → «Сводка»: на ПК — две колонки панелей. */
/* minmax(0, …): колонка не раздувается под самое широкое окно — иначе на
   телефоне вслед за ним вылезают за экран и остальные. */
.stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.stats > .panel { margin-bottom: 0; }
/* Регистрации и разбивки онлайна: плитками в колонки (до двух, не уже
   300px) — окна разной высоты встают друг под другом, а не строками сетки. */
.stats-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); column-gap: 12px; align-items: start; margin-top: 12px; }
.stats-col > .panel { margin: 0 0 12px; }
/* У разбивок нет строки-заголовка: первая строка — как все. */
.ai-table.breakdown th:first-child, .ai-table.breakdown tr:first-child th { color: var(--text); font-size: inherit; }
.ai-table.breakdown td.muted { width: 3.5em; font-size: 13px; }
.big { font-size: 34px; line-height: 1.1; margin: 0 0 8px; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ai-table th, .ai-table td { padding: 5px 6px; text-align: right; font-weight: 400; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ai-table th:first-child { text-align: left; color: var(--muted); white-space: normal; }
.ai-table tr:first-child th { color: var(--muted); font-size: 13px; }
.ai-table tr.sum td, .ai-table tr.sum th { color: var(--text); }
/* Ошибки ИИ: на телефоне — строкой под числом, в одну строку таблица шире экрана. */
.ai-err { display: block; font-size: 13px; }
.sub-title { margin-top: 14px; }
.refresh-note { text-align: center; margin: 12px 0 0; }

/* «Есть обновления» — плавающая кнопка, когда список прокручен вниз. */
.updates {
  position: fixed; z-index: 20; left: 50%; transform: translateX(-50%);
  bottom: max(16px, env(safe-area-inset-bottom));
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--fill); color: #fff; font: inherit; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25); cursor: pointer;
}
.pager a { display: inline-flex; align-items: center; min-height: 44px; }

.login { max-width: 380px; margin: 12vh auto 0; display: grid; gap: 8px; }
.login input[type="password"], .inline-form input {
  width: 100%; min-height: 48px; font-size: 16px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.err { color: var(--danger); margin: 0; }

/* Стикерпаки: в карточке жалобы и «Чёрные списки». Поле + кнопка в строку
   (.inline-form) — там же и в «Поиске». */
.pk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-size: 14px; }
.pk { min-width: 0; overflow-wrap: anywhere; }
.pk-bl summary { list-style: none; cursor: pointer; }
.pk-bl summary::-webkit-details-marker { display: none; }
.pk-btn { flex: none; padding: 3px 12px; border-radius: 999px; font-size: 13px; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.pk-bl[open] .pk-btn { background: var(--bg); }
.pk-bl .confirm { margin: 2px 0 8px; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.inline-form .btn { width: auto; }
/* «Поиск» → «По тексту»: поле, срок и кнопка в строку; у найденных — галочка
   и пример сообщения. */
.inline-form.with-period { grid-template-columns: 1fr auto auto; }
.inline-form select, .category-select {
  min-height: 48px; font-size: 16px; padding: 0 8px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
/* «ИИ-проверки»: исправление вердикта — выбор и кнопка в строку. */
.correct-verdict { margin-top: 8px; }
/* «ИИ-проверки»: категория — над вкладками, во всю ширину на телефоне. */
.category-select { display: block; width: 100%; margin: 0 0 10px; }
@media (min-width: 640px) { .category-select { width: auto; min-width: 240px; } }
.pk-item.found { align-items: flex-start; justify-content: flex-start; }
.pk-item.found input[type="checkbox"] { flex: none; width: 20px; height: 20px; margin: 2px 0 0; }
.sample { margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }
.found-ban { margin-top: 12px; }
/* «Поиск» → «Медиа»: сетка карточек; файл закрыт до «Показать». */
.media-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.media-item { display: grid; gap: 6px; align-content: start; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.media-cover { aspect-ratio: 1; border: 0; border-radius: 8px; background: repeating-linear-gradient(45deg, var(--line), var(--line) 8px, transparent 8px, transparent 16px); color: var(--text); font: inherit; cursor: pointer; }
.media-file { width: 100%; max-height: 360px; object-fit: contain; border-radius: 8px; background: #000; }
.media-item audio { width: 100%; }
.media-cover.audio { aspect-ratio: auto; min-height: 48px; }
.inline-form + .err { margin-top: 8px; }
.pk-list { list-style: none; margin: 0; padding: 0; }
.pk-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pk-item:first-child { border-top: 0; padding-top: 0; }
.pk-main { min-width: 0; overflow-wrap: anywhere; }
.pk-item form, .pk-item > .link { margin: 0; flex: none; }
.pk-item code { font-size: 13px; padding: 1px 6px; border-radius: 6px; background: var(--bg); overflow-wrap: anywhere; }
.ban-existing { margin-top: 4px; }
.job { margin-top: 4px; font-size: 13px; }
.job.running { color: var(--warn); }
.job.err { color: var(--danger); }
.ban-existing > summary.link { padding: 4px 0; min-height: 0; color: var(--danger); font-size: 13px; }
.ban-existing .confirm form, .pk-item .ban-existing form { flex: initial; }

@media (min-width: 640px) {
  .wrap { padding: 24px; }
  .decide { grid-template-columns: 1fr 1fr; align-items: start; }
  .ai-err { display: inline; font-size: inherit; }
  .ai-err::before { content: ' · '; }
  .tabs { gap: 8px; }
  .tab { flex: none; flex-direction: row; min-height: 40px; padding: 0 16px; font-size: 15px; }
  .count { margin: 0 0 0 6px; }
}

@media (min-width: 900px) {
  .detail { grid-template-columns: 1fr 1fr; grid-template-areas: "profile main" "msgs msgs"; }
  .detail.has-packs { grid-template-areas: "profile main" "packs packs" "msgs msgs"; }
  .d-main { grid-area: main; }
  .d-profile { grid-area: profile; }
  .d-packs { grid-area: packs; }
  .d-msgs { grid-area: msgs; }
  .d-main .decide { grid-template-columns: 1fr; } /* в половине ширины кнопки — друг под другом */
  .complaint .d-main { min-height: 420px; }
  .complaint .d-profile { height: 420px; overflow-y: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* окна в строке — одной высоты */
  .stats .wide { grid-column: 1 / -1; }
}

/* Жалоба и ИИ-проверка на широком экране (.chat-center): диалог — по центру,
   «Профиль» — слева, решение («Жалоба» с кнопками, вердикт) — справа
   (стикерпаки жалобы — над диалогом). Страница шире обычной; длинная
   переписка прокручивается в своём окне — кнопки справа на месте. */
@media (min-width: 1100px) {
  /* Переписка по центру, по бокам — профиль (слева) и решение (справа):
     жалоба, ИИ-проверка. */
  .wrap:has(.detail.chat-center) { max-width: 1320px; }
  .detail.chat-center { grid-template-columns: 320px minmax(0, 1fr) 360px; grid-template-areas: "profile msgs main"; align-items: start; }
  .chat-center .d-msgs { max-height: calc(100vh - 140px); overflow-y: auto; }
  /* У жалобы боковые — одной высоты, пониже */
  .complaint .d-main { min-height: 360px; }
  .complaint .d-profile { height: 360px; }
  .detail.complaint.has-packs { grid-template-areas: "profile packs main" "profile msgs main"; }
}

/* Смена жалобы — анимация (View Transitions: Chrome 111+, Safari 18+; где не
   поддерживается — просто смена). Интерфейс подменяет карточку внутри
   document.startViewTransition (panel/src/pages/ComplaintDetail.jsx).
   «Следующая новая» и открытие из списка: старая карточка уезжает влево,
   новая въезжает справа. После бана старая «улетает» вниз с уменьшением.
   Остальная страница меняется без эффекта. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
.detail { view-transition-name: complaint; }
.detail.vt-banned { view-transition-name: complaint-banned; }
.detail.vt-stay { view-transition-name: complaint-stay; } /* разбан: та же карточка — лёгкое затухание */

/* Старая уходит быстрее, новая въезжает с небольшой задержкой — без «двоения». */
::view-transition-group(complaint) { animation-duration: .35s; }
::view-transition-old(complaint) { animation: vt-out-left .18s ease-in both; }
::view-transition-new(complaint) { animation: vt-in-right .26s ease-out .09s both; }
::view-transition-old(complaint-banned) { animation: vt-out-banned .22s ease-in both; }
::view-transition-group(complaint-stay) { animation-duration: .2s; }

@keyframes vt-out-left { to { transform: translateX(-40px); opacity: 0; } }
@keyframes vt-in-right { from { transform: translateX(40px); opacity: 0; } }
@keyframes vt-out-banned { to { transform: translateY(24px) scale(.94); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Observational model comparison: one shared preview, independent manual reviews. */
.wrap:has(.nsfw-intro) { max-width: 1100px; }
.nsfw-intro h1 { margin: 0; }
.nsfw-filters { display: grid; gap: 12px; margin-bottom: 16px; }
.nsfw-filters label { color: var(--muted); font-size: 13px; }
.nsfw-filters select { margin: 5px 0 0; width: 100%; }
.nsfw-check { margin-bottom: 16px; min-width: 0; }
.nsfw-person { margin-top: 12px; overflow-wrap: anywhere; }
.nsfw-status { font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.nsfw-status-pending { color: var(--warn); }
.nsfw-status-error { color: var(--danger); }
.nsfw-status-unavailable { color: var(--muted); }
.nsfw-preview { min-width: 0; max-width: 440px; margin: 16px auto; }
.nsfw-preview .media-cover { width: 100%; max-height: 220px; }
.nsfw-preview .media-file { display: block; max-height: 280px; }
.nsfw-model-grid { display: grid; gap: 16px; }
.nsfw-model-result { display: flex; flex-direction: column; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.nsfw-model-heading { margin-bottom: 14px; }
.nsfw-model-heading h2 { margin: 0; color: var(--text); font-size: 17px; font-weight: 600; text-transform: none; letter-spacing: normal; }
.nsfw-scores { min-width: 0; }
.nsfw-top { margin: 0 0 12px; }
.nsfw-probabilities { margin: 0; }
.nsfw-probabilities > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.nsfw-probabilities dt { font-size: 14px; }
.nsfw-probabilities dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nsfw-probabilities small, .nsfw-check .err small, .nsfw-frames small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.nsfw-model { overflow-wrap: anywhere; }
.nsfw-review { margin-top: auto; padding-top: 18px; }
.nsfw-review-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.nsfw-review-buttons .btn { padding-left: 6px; padding-right: 6px; font-size: 14px; }
.nsfw-review-buttons .btn:disabled { cursor: default; opacity: .45; }
.nsfw-review-buttons .btn[aria-pressed="true"] { opacity: 1; background: var(--bg); }
.nsfw-reset { background: var(--line); color: var(--text); }
.nsfw-mark-correct { color: var(--ok); }
.nsfw-mark-wrong { color: var(--danger); }
.nsfw-mark-unreviewed { color: var(--muted); }
.nsfw-receipts { display: grid; gap: 12px; }
.nsfw-receipt { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.nsfw-receipt h3 { font-size: 14px; font-weight: 600; margin: 0; }
.nsfw-receipt .kv { margin-top: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.nsfw-outcome { margin: 12px 0 0; }
.nsfw-frames { margin-top: 16px; }
.nsfw-frames summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
.nsfw-table-wrap { overflow-x: auto; }
.nsfw-table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.nsfw-frames table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.nsfw-frames th, .nsfw-frames td { padding: 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.nsfw-frames th:first-child { text-align: left; }
.nsfw-frames caption { text-align: left; margin-bottom: 8px; }
@media (max-width: 440px) {
  .nsfw-frames:not(.has-archive) th, .nsfw-frames:not(.has-archive) td { padding: 8px 4px; font-size: 12px; }
}
.nsfw-scroll-hint { display: none; }
@media (max-width: 999px) { .nsfw-scroll-hint { display: block; } }
@media (min-width: 760px) {
  .nsfw-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .nsfw-model-grid.has-archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nsfw-receipts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Achievements of the admin (panel/src/pages/Achievements.jsx). The button
   with the rank medal sits next to the logo; on a narrow screen it shows only
   the medal count, so it fits beside ☰. */
.top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.trophy {
  display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 2px 12px 2px 4px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: var(--text); font-size: 14px; white-space: nowrap;
}
.trophy.on { background: var(--fill); border-color: var(--fill); color: #fff; }
.trophy .medal { width: 34px; height: 34px; flex: none; }
.trophy-short { display: none; font-weight: 600; }
@media (max-width: 999px) {
  .trophy-full { display: none; }
  .trophy-short { display: inline; }
}
.ach-title { font-size: 22px; margin: 4px 2px 12px; }
.ach-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 12px; }
.ach-top > .panel { margin: 0; }
.ach-rank { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.ach-rank .medal { width: 76px; height: 76px; }
.ach-rank-name { font-size: 22px; font-weight: 600; line-height: 1.15; }
.ach-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.ach-bar i { display: block; height: 100%; border-radius: 99px; background: var(--fill); }
.ach-prog { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ach-prog b { color: var(--text); font-weight: 600; }
.ach-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ach-facts b { display: block; font-size: 20px; font-weight: 600; }
.ach-facts span { color: var(--muted); font-size: 13px; }
.ach-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 2px 10px; }
.ach-head h2 { margin: 0; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.ach { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); }
.ach .medal { width: 64px; height: 64px; }
.ach.locked .ach-name { color: var(--muted); }
.ach-name { font-weight: 600; }
.ach-what { color: var(--muted); font-size: 13px; margin: 1px 0 0; }
.ach-tier { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; color: #14161a; vertical-align: 1px; }
.ach-pips { display: flex; gap: 4px; margin-top: 6px; }
.ach-pips i { width: 16px; height: 4px; border-radius: 2px; background: var(--line); }
/* Tier colours: the light side of the medal (components/Medal.jsx). */
.ach-tier.t1, .ach-pips .t1 { background: #e2a66f; }
.ach-tier.t2, .ach-pips .t2 { background: #eef1f5; }
.ach-tier.t3, .ach-pips .t3 { background: #ffe17a; }
.ach-tier.t4, .ach-pips .t4 { background: #b9f3ff; }
.ach-tier.t5, .ach-pips .t5 { background: #e0d4ff; }
.ach-recent { list-style: none; margin: 0; padding: 0; }
.ach-recent li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.ach-recent li:last-child { border-bottom: 0; }
.ach-recent .medal { width: 36px; height: 36px; }
.ach-recent time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.ach-news { display: flex; gap: 10px; align-items: center; }
.ach-news .medal { width: 40px; height: 40px; flex: none; }
@media (max-width: 480px) {
  .ach-rank .medal { width: 64px; height: 64px; }
  .ach-rank-name { font-size: 20px; }
  .ach-facts b { font-size: 18px; }
}
