/* =====================================================================
   BOT Panel — дизайн-система v8 («Control room»)
   Один файл, одна система: токены → каркас → компоненты → страницы.
   Держать идентичную копию в dashboard/static/style.css.
   ===================================================================== */

/* ---------- 0. Шрифт (локально, без внешних CDN) ---------- */
@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/static/fonts/manrope-cyrillic.woff2) format('woff2-variations'), url(/static/fonts/manrope-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/static/fonts/manrope-latin.woff2) format('woff2-variations'), url(/static/fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 1. Токены ---------- */
:root {
  color-scheme: dark;
  --font: 'Manrope Variable', 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Mono', Consolas, 'SFMono-Regular', monospace;

  --bg: #0b0d12;
  --side-bg: linear-gradient(180deg, #0f1828 0%, #0c111a 42%, #0b0d12 100%);
  --surface: #0f1218;
  --surface-2: #141822;
  --surface-3: #1a1f2b;
  --field: #0d1016;
  --line: #1e2330;
  --line-strong: #2a3041;
  --text: #e3e6ed;
  --text-2: #c2c7d2;
  --muted: #8a92a4;
  --faint: #5c6476;

  --accent: #3b6fd4;
  --accent-hover: #4a7ee0;
  --accent-text: #8fb0ff;
  --accent-soft: rgba(59, 111, 212, .15);
  --accent-line: rgba(59, 111, 212, .5);
  --accent-ink: #ffffff;

  --green: #34c47f;
  --green-soft: rgba(52, 196, 127, .12);
  --red: #ef5b67;
  --red-soft: rgba(239, 91, 103, .12);
  --amber: #e0ac45;
  --amber-soft: rgba(224, 172, 69, .13);
  --blue: #4aa8e0;
  --blue-soft: rgba(74, 168, 224, .13);
  --violet: #8b7cf6;
  --violet-soft: rgba(139, 124, 246, .14);

  --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .02);
  --r-lg: 10px;
  --r: 8px;
  --r-sm: 6px;
  --r-xs: 4px;
  --side-w: 248px;
  --side-w-collapsed: 64px;
  --top-h: 58px;

  /* старые имена — на случай inline-стилей в шаблонах */
  --panel: var(--surface);
  --panel2: var(--surface-2);
  --panel3: var(--field);
  --yellow: var(--amber);
  --majestic: var(--red);
  --majestic2: var(--violet);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f7;
  --side-bg: linear-gradient(180deg, #e9eef8 0%, #f1f3f7 45%, #f3f4f7 100%);
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #eaedf2;
  --field: #ffffff;
  --line: #e1e4ea;
  --line-strong: #cdd2dc;
  --text: #151922;
  --text-2: #2e3442;
  --muted: #5f6878;
  --faint: #8a93a3;
  --accent: #3463c9;
  --accent-hover: #2b56b3;
  --accent-text: #2b56b3;
  --accent-soft: rgba(52, 99, 201, .1);
  --accent-line: rgba(52, 99, 201, .45);
  --green: #1d9a5f;
  --green-soft: rgba(29, 154, 95, .1);
  --red: #d23c49;
  --red-soft: rgba(210, 60, 73, .09);
  --amber: #a8761a;
  --amber-soft: rgba(196, 140, 30, .12);
  --blue: #1f7fb8;
  --blue-soft: rgba(31, 127, 184, .1);
  --violet: #6b5bd8;
  --violet-soft: rgba(107, 91, 216, .1);
  --shadow-pop: 0 14px 36px rgba(20, 28, 45, .16), 0 0 0 1px rgba(20, 28, 45, .04);
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11' 1;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { margin: 0 0 6px; font-weight: 700; line-height: 1.25; letter-spacing: -.005em; color: var(--text); }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; margin-top: 14px; }
b, strong { font-weight: 700; }
small { font-size: 12px; }
img { max-width: 100%; }
pre, code { font-family: var(--mono); font-size: 12px; }
pre { overflow: auto; white-space: pre-wrap; color: var(--text-2); background: var(--field); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
::selection { background: var(--accent-soft); color: var(--text); }
.muted, .hint { color: var(--muted); }
.hint { font-size: 12px; margin: -2px 0 4px; font-weight: 500; }
.tiny { font-size: 11px; }
.small { font-size: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.num, td, .rx-stat-num, .metric b { font-variant-numeric: tabular-nums; }

/* Тонкие скроллбары везде */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a4256; }
::-webkit-scrollbar-corner { background: transparent; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #b5bccb; }

/* ---------- 3. Каркас ---------- */
body.rx { display: flex; min-height: 100vh; }

.rx-sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  width: var(--side-w);
  height: 100vh;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--side-bg);
  border-right: 1px solid var(--line);
  transition: width .2s ease;
}
.rx-side-top {
  height: var(--top-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}
.rx-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: var(--text); }
.rx-brand:hover { color: var(--text); }
.rx-logo { width: 30px; height: 30px; border-radius: 7px; overflow: hidden; flex: none; background: var(--surface-3); }
.rx-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rx-btitle { font-size: 13.5px; font-weight: 800; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-bsub { display: none; }

/* Переключатель темы — «тумблер» как в референсе */
.rx-theme {
  position: relative;
  width: 40px;
  height: 22px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  color: var(--muted);
}
.rx-theme::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform .18s ease;
}
:root[data-theme="light"] .rx-theme::after { transform: translateX(18px); background: var(--amber); }
.rx-theme i { position: absolute; top: 3px; font-size: 13px; z-index: 1; color: #fff; left: 4px; }
:root[data-theme="light"] .rx-theme i { left: auto; right: 4px; }

/* Выбор сервера */
.rx-guild-switch { position: relative; padding: 10px 10px 8px; border-bottom: 1px solid var(--line); flex: none; }
.rx-guild-switch > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}
.rx-guild-switch > summary::-webkit-details-marker { display: none; }
.rx-guild-switch > summary:hover { border-color: var(--line-strong); }
.rx-guild-switch[open] > summary { border-color: var(--accent-line); }
.rx-gs-ico { width: 20px; height: 20px; border-radius: 5px; flex: none; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); font-size: 10px; font-weight: 700; }
.rx-gs-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-gs-caret { color: var(--muted); font-size: 15px; transition: transform .15s ease; }
.rx-guild-switch[open] .rx-gs-caret { transform: rotate(180deg); }
.rx-gs-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(100% - 2px);
  z-index: 80;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
  max-height: 320px;
  overflow: auto;
}
.rx-gs-menu a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; }
.rx-gs-menu a:hover { background: var(--surface-2); color: var(--text); }
.rx-gs-menu a.on { background: var(--accent-soft); color: var(--text); }
.rx-gs-menu .rx-gs-all { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 9px; border-radius: 0 0 var(--r-sm) var(--r-sm); color: var(--muted); }

/* Кнопка сворачивания на правом краю сайдбара */
.rx-collapse {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -12px;
  z-index: 70;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}
.rx-collapse:hover { color: var(--text); border-color: var(--accent-line); }
.rx-collapse i { transition: transform .2s ease; }

.rx-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 8px 12px; }
.rx-group + .rx-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.rx-gtitle { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.rx-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  margin-bottom: 1px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.rx-link i { font-size: 17px; width: 18px; flex: none; text-align: center; color: var(--muted); }
.rx-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rx-link:hover { background: rgba(255, 255, 255, .035); color: var(--text); }
:root[data-theme="light"] .rx-link:hover { background: rgba(20, 30, 60, .045); }
.rx-link.active { background: var(--surface-3); color: var(--text); }
.rx-link.active i { color: var(--accent-text); }
.rx-link.active::after { content: ''; position: absolute; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* Пользователь внизу сайдбара */
.rx-side-user {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-top: 1px solid var(--line);
}
.rx-user { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; cursor: pointer; border-radius: var(--r-sm); padding: 2px; }
.rx-avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b6fd4, #7a5cf0);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.rx-uinfo { min-width: 0; }
.rx-uname { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.rx-urole { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.rx-umenu-btn {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}
.rx-umenu-btn:hover { color: var(--text); background: var(--surface-2); }

/* Свёрнутый сайдбар (иконки) — только на десктопе */
@media (min-width: 861px) {
  html.nav-collapsed .rx-sidebar { width: var(--side-w-collapsed); }
  html.nav-collapsed .rx-btitle,
  html.nav-collapsed .rx-theme,
  html.nav-collapsed .rx-gtitle,
  html.nav-collapsed .rx-link span,
  html.nav-collapsed .rx-link.active::after,
  html.nav-collapsed .rx-gs-name,
  html.nav-collapsed .rx-gs-caret,
  html.nav-collapsed .rx-uinfo,
  html.nav-collapsed .rx-user { display: none; }
  html.nav-collapsed .rx-side-top { justify-content: center; padding: 0; }
  html.nav-collapsed .rx-brand { flex: none; }
  html.nav-collapsed .rx-guild-switch { padding: 10px 12px 8px; }
  html.nav-collapsed .rx-guild-switch > summary { justify-content: center; padding: 0; }
  html.nav-collapsed .rx-gs-menu { left: 8px; right: auto; width: 230px; }
  html.nav-collapsed .rx-nav { padding: 8px 12px; }
  html.nav-collapsed .rx-group + .rx-group { margin-top: 8px; padding-top: 8px; }
  html.nav-collapsed .rx-link { justify-content: center; padding: 0; height: 36px; }
  html.nav-collapsed .rx-link i { font-size: 18px; }
  html.nav-collapsed .rx-side-user { justify-content: center; }
  html.nav-collapsed .rx-collapse i { transform: rotate(180deg); }
}

/* Основная часть */
.rx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.rx-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: rgba(11, 13, 18, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
:root[data-theme="light"] .rx-topbar { background: rgba(243, 244, 247, .9); }
.rx-tleft { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rx-tright { display: flex; align-items: center; gap: 8px; flex: none; }
.rx-title { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rx-crumb { color: var(--faint); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.rx-content { flex: 1; min-width: 0; padding: 26px 28px 40px; }
.content { min-width: 0; max-width: 1240px; margin: 0 auto; }
.rx-lede { color: var(--muted); margin: -6px 0 18px; font-size: 12.5px; max-width: 760px; }
.site-footer { max-width: 1240px; margin: 32px auto 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; text-align: center; }

.rx-burger, .rx-backdrop { display: none; }
.rx-burger {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: none;
}

/* Устаревшая шапка страницы (если где-то осталась) */
.rx-phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.rx-phead h1 { font-size: 20px; margin: 0 0 3px; }
.rx-phead .sub { color: var(--muted); font-size: 12.5px; }

/* ---------- 4. Кнопки ---------- */
.btn, button.btn, .rx-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn i, .rx-back-btn i { font-size: 16px; }
.btn.secondary, .rx-back-btn {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text-2);
}
.btn.secondary:hover, .rx-back-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn.good { background: var(--green); color: #06180e; }
.btn.good:hover { background: #3fd38c; color: #06180e; }
:root[data-theme="light"] .btn.good { color: #fff; }
.btn.danger { background: var(--red-soft); border-color: rgba(239, 91, 103, .35); color: var(--red); }
.btn.danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small, .btn.tiny { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.tiny { height: 24px; padding: 0 8px; font-size: 11.5px; }
.btn.wide { width: 100%; }
.btn.big { height: 40px; padding: 0 18px; }
.rx-iconbtn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}
.rx-iconbtn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- 5. Бейджи, пилюли, чипы ---------- */
.badge, .status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-2);
}
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.yellow { background: var(--amber-soft); color: var(--amber); }
.badge.green, .status-dot.ok { background: var(--green-soft); color: var(--green); }
.badge.red, .status-dot.off { background: var(--red-soft); color: var(--red); }
.badge.gray { background: var(--surface-3); color: var(--muted); }

.rx-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.rx-pill i { font-size: 14px; }
.rx-pill.green { background: var(--green-soft); border-color: transparent; color: var(--green); }
.rx-pill.live { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
.rx-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor; }

.chips, .stats, .mini-status, .rx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.rx-chips { margin: 0; }
.chip, .rx-chip, .stats span, .mini-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}
.chip, .rx-chip { cursor: pointer; font-family: inherit; }
.chip:hover, .rx-chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active, .rx-chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.status-online { color: var(--green) !important; border-color: transparent !important; background: var(--green-soft) !important; }

.rec-pill, .rx-cnt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
  border: 0;
}
.rec-pill.green { background: var(--green-soft); color: var(--green); }
.rec-pill.red { background: var(--red-soft); color: var(--red); }
.rec-pill.yellow { background: var(--amber-soft); color: var(--amber); }
.rx-cnt b { color: var(--text); font-weight: 800; }
.rx-cnt.warn { background: var(--amber-soft); color: var(--amber); }
.rx-cnt.warn b { color: var(--amber); }
.rx-cnt.strike { background: var(--violet-soft); color: var(--violet); }
.rx-cnt.strike b { color: var(--violet); }
.rx-cnt.max { background: var(--red-soft); color: var(--red); }
.rx-cnt.max b { color: var(--red); }
.rx-cnt.mini { height: 18px; margin-left: 8px; padding: 0 5px; font-size: 10.5px; vertical-align: 1px; }
.rx-rcnts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.rx-rcnts.big { gap: 8px; margin-top: 0; }
.rx-rcnts.big .rx-cnt { height: 28px; padding: 0 10px; font-size: 12.5px; }

.channel-pill, .user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
}
.user-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.user-pill { height: auto; min-height: 30px; padding: 4px 9px; }
.user-pill span { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.user-pill small { color: var(--muted); font-size: 11px; }

/* ---------- 6. Поверхности ---------- */
.card, .rx-card, .section-box, .hero, .metric, .rx-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
}
.card { margin-bottom: 14px; }
.card:last-child { margin-bottom: 0; }
.grid > .card, .two-cards > .card, .rx-cols > .card { margin-bottom: 0; }
.card form { margin: 0; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.section-box { display: grid; gap: 14px; padding: 18px 20px; }
.compact-box { padding: 16px 18px; }
.section-box h2, .section-box h3 { margin: 0; font-size: 14.5px; }
.section-title { display: grid; gap: 2px; }
.section-title h2 { font-size: 14.5px; margin: 0; }
.section-title p { margin: 0; color: var(--muted); font-size: 12.5px; }
.rx-chead, .app-head, .card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: -18px -20px 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.app-head, .card-head { margin: 0 0 12px; padding: 0; border: 0; }
.rx-chead h2 { font-size: 14px; margin: 0 0 1px; }
.rx-chead .sub { color: var(--muted); font-size: 12px; }
.hero { padding: 22px 24px; margin-bottom: 18px; }
.hero h1 { font-size: 20px; margin-bottom: 4px; }
.hero p { color: var(--muted); }
.rx-empty { color: var(--muted); font-size: 12.5px; padding: 6px 0; }
.rx-card.rx-empty { padding: 28px 20px; text-align: center; }
.alert, .error-alert {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  margin: 0 0 14px;
  color: var(--text-2);
}
.error-alert, .alert.error-alert { border-left-color: var(--red); background: var(--red-soft); color: var(--text); font-weight: 600; }
.reason { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--red-soft); color: var(--text-2); }

/* Статистика */
.rx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.rx-stats .rx-stat { border: 0; border-radius: 0; border-right: 1px solid var(--line); padding: 16px 20px; background: transparent; }
.rx-stats .rx-stat:last-child { border-right: 0; }
.rx-stat-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rx-stat-ico { color: var(--faint); font-size: 16px; display: inline-flex; }
.rx-stat-num { margin: 0; font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.rx-stat-sub { margin-top: 7px; color: var(--faint); font-size: 12px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric b { display: block; font-size: 22px; margin-bottom: 2px; }
.metric span { color: var(--muted); font-size: 12px; }
.rx-status { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; font-size: 12.5px; }
.rx-status i { font-size: 16px; }
.rx-status small { display: none; }

/* ---------- 7. Сетки ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.grid.guild-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ticket-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.two-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.aligned-grid > label, .aligned-grid > .field { align-self: start; }
.panel-grid { grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.35fr); align-items: start; }
.rx-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.rx-side-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.apps-layout, .rx-app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.apps-main, .editor-card { min-width: 0; }
.create-form-card { display: grid; gap: 14px; }
.create-form-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 14px; align-items: end; }
.create-form-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }

/* ---------- 8. Формы ---------- */
.form, .settings-form { display: grid; gap: 14px; }
.form > h2 { margin: 10px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14.5px; }
.form > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form > h3 { margin: 6px 0 0; font-size: 13.5px; color: var(--text-2); }
label, .field { display: grid; gap: 6px; min-width: 0; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.label-title { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
label > small.muted, .field > small.muted { font-weight: 500; font-size: 11.5px; }
.required-star { color: var(--red); margin-left: 2px; }

input, textarea, select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { height: auto; min-height: 80px; padding: 9px 11px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover, select:hover { border-color: #353c4f; }
:root[data-theme="light"] input:hover, :root[data-theme="light"] textarea:hover, :root[data-theme="light"] select:hover { border-color: #b9c0cd; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); box-shadow: none; }
input[type="range"] { height: auto; padding: 0; border: 0; background: transparent; accent-color: var(--accent); box-shadow: none; }
select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 11px) 15px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
input[type="color"] { height: 34px; padding: 3px; cursor: pointer; }
input[type="file"] { height: auto; min-height: 34px; padding: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
input[type="file"]::file-selector-button {
  height: 24px;
  margin-right: 10px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
input[type="file"]:hover::file-selector-button { background: var(--surface-3); color: var(--text); }
input:required:invalid, textarea:required:invalid { border-color: var(--line-strong); }
input:required:focus:invalid, textarea:required:focus:invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.file-field { gap: 6px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input { min-width: 220px; flex: 1; width: auto; }
.reject { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; align-items: center; margin-top: 10px; }
.actions, .action-bar, .row-actions, .form-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions { margin-top: 14px; }
.actions form, .row-actions form, .action-bar form { display: inline-flex; margin: 0; }
.row-actions { justify-content: flex-end; }
.head-actions { margin: -6px 0 14px; }
.sticky-actions {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: rgba(15, 18, 24, .92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-pop);
}
:root[data-theme="light"] .sticky-actions { background: rgba(255, 255, 255, .94); }

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.check-row:hover { background: var(--surface-2); }
.check-row input { width: 16px; }
.check-row small { color: var(--muted); font-size: 11px; font-weight: 500; }
.check-row.compact { grid-template-columns: auto minmax(0, 1fr); }
.picker { border: 1px solid var(--line-strong); background: var(--field); border-radius: var(--r-sm); padding: 6px; max-height: 260px; overflow: auto; }
.server-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px; max-height: 320px; }

/* Выпадающие списки (single / multi) */
.role-field, .choice-field { position: relative; }
.multi-select, .single-select { position: relative; width: 100%; }
.multi-select > summary, .single-select > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 4px 10px 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--field);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}
.multi-select > summary::-webkit-details-marker, .single-select > summary::-webkit-details-marker { display: none; }
.multi-select > summary:hover, .single-select > summary:hover { border-color: #353c4f; }
.multi-select[open] > summary, .single-select[open] > summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.selected-roles { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.selected-roles .muted { font-weight: 500; }
.selected-choice { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-caret { color: var(--muted); font-size: 11px; flex: none; transition: transform .15s ease; }
.multi-select[open] .multi-caret, .single-select[open] .multi-caret { transform: rotate(180deg); }
.multi-menu, .choice-menu {
  position: absolute;
  z-index: 55;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.role-filter { height: 30px; margin-bottom: 5px; font-size: 12.5px; }
.majestic-server-field .multi-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 2px; max-height: 380px; }
.majestic-server-field .role-filter { grid-column: 1 / -1; }
.majestic-server-field .role-option span { display: inline-flex; align-items: center; gap: 7px; }

.choice-option, .role-option, .server-option, .colored-role-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  border: 0;
}
.role-option, .server-option, .colored-role-option { grid-template-columns: 18px minmax(0, 1fr); }
.role-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice-option:hover, .role-option:hover { background: var(--surface-2); }
.choice-option:has(input:checked), .role-option:has(input:checked) { background: var(--accent-soft); }
.colored-role-option:has(input:checked) { background: color-mix(in srgb, var(--role-color, var(--accent)) 14%, transparent); }
.choice-option input, .role-option input, .server-option input, .colored-role-option input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.choice-option small { color: var(--faint); font-size: 11px; white-space: nowrap; }
.choice-check, .fake-check {
  width: 16px;
  height: 16px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--line-strong);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.choice-check { border-radius: 50%; }
.colored-role-option .fake-check { border-color: color-mix(in srgb, var(--role-color, #8a92a4) 70%, transparent); }
.choice-option input:checked + .choice-check,
.server-option input:checked + .fake-check,
.role-option input:checked + .fake-check { background: var(--accent); border-color: var(--accent); }
.colored-role-option input:checked + .fake-check { background: var(--role-color, var(--accent)); border-color: var(--role-color, var(--accent)); }
.choice-option input:checked + .choice-check::after,
.role-option input:checked + .fake-check::after {
  content: '';
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.choice-option input:checked + .choice-check::after { width: 6px; height: 6px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.role-option-name { color: var(--text); font-weight: 600; }

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  background: var(--surface-3);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
}
.role-chip.colored-role-chip { --role-color: #8a92a4; background: color-mix(in srgb, var(--role-color) 16%, transparent); }
.role-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--role-color); flex: none; }
.role-chip.muted-chip, .muted-chip { color: var(--muted); }
.server-chip { gap: 6px; max-width: 260px; }
.plain-chip { background: var(--accent-soft); }
.role-chip .emoji-img { margin-right: 2px; }
.server-dot { color: var(--accent-text); font-size: 10px; }
.emoji-img, .emoji-inline { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; flex: none; vertical-align: -4px; }
.role-button-chip { gap: 6px; padding-right: 3px; height: 26px; }
.role-button-chip form { display: inline-flex; margin: 0; }
.button-role-list { align-items: center; }
.mini-x {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: var(--r-xs);
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.mini-x:hover { background: var(--red); color: #fff; }

/* Цвет */
.color-field { gap: 8px; }
.color-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: center; }
.color-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.color-dot { width: 22px; height: 22px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.color-dot:hover { outline: 2px solid var(--accent-line); outline-offset: 1px; }

/* Поля с эмодзи */
.ta-wrap, .emoji-input-wrap { position: relative; }
.ta-wrap textarea { width: 100%; padding-right: 44px; }
.emoji-input-wrap input { padding-right: 40px; }
.emoji-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  filter: grayscale(.4);
}
.emoji-btn:hover { filter: none; border-color: var(--line-strong); }
.emoji-input-btn { top: 50%; bottom: auto; right: 5px; transform: translateY(-50%); }
.emoji-popup {
  position: absolute;
  z-index: 20000;
  width: 320px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
}
.emoji-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.emoji-tabs button { flex: 1; height: 28px; border: 1px solid var(--line); border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 12px; }
.emoji-tabs button.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 220px; overflow-y: auto; }
.emoji-cell { min-width: 32px; min-height: 32px; border: 0; background: transparent; border-radius: var(--r-xs); cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.emoji-cell:hover { background: var(--surface-2); }
.emoji-cell img { width: 22px; height: 22px; object-fit: contain; }

.readonly-user, .uploaded-file-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  overflow: hidden;
}
.readonly-user .avatar { width: 22px; height: 22px; border-radius: 5px; }
.readonly-user small { margin-left: auto; color: var(--muted); }
.uploaded-file-chip b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }

/* Сворачиваемые блоки настроек */
.collapsible-section { display: block; padding: 0; overflow: visible; }
.collapsible-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  border-radius: var(--r);
}
.collapsible-section > summary::-webkit-details-marker { display: none; }
.collapsible-section > summary:hover { background: rgba(255, 255, 255, .015); }
.collapse-caret {
  width: 26px;
  height: 26px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 11px;
  transition: transform .15s ease;
}
.collapsible-section[open] > summary .collapse-caret { transform: rotate(180deg); }
.collapse-content { display: grid; gap: 14px; padding: 16px 18px 18px; border-top: 1px solid var(--line); }

/* ---------- 9. Таблицы ---------- */
.table-wrap, .panel-card { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
.table-wrap table, .panel-card table { min-width: 720px; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th {
  height: 34px;
  padding-top: 9px;
  padding-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  background: transparent;
}
td { font-size: 13px; color: var(--text); }
td:first-child { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .018); }
:root[data-theme="light"] tbody tr:hover td { background: rgba(20, 30, 60, .025); }
.card > table, .rx-card > table, .section-box > table { margin: 0; }

/* Списки */
.list { display: grid; gap: 0; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.list-row:last-child { border-bottom: 0; }
.list-row > a { display: grid; gap: 4px; min-width: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }

/* ---------- 10. Серверы (главная) ---------- */
.guild-card { display: flex; flex-direction: column; min-height: 190px; }
.guild-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.guild-title h2 { margin: 0 0 2px; font-size: 15px; }
.guild-title p { margin: 0; font-size: 12.5px; }
.guild-avatar { width: 44px; height: 44px; border-radius: var(--r); object-fit: cover; flex: none; }
.guild-avatar.fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-2); font-weight: 700; }
.compact-stats { margin-top: auto; }
.majestic-hero { border-color: var(--line); }
.current-guild, .current-label { display: none; }

/* ---------- 11. Заявки ---------- */
.rx-applications { display: flex; flex-direction: column; gap: 14px; }
.apps-toolbar, .rx-app-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.apps-toolbar-right { display: flex; justify-content: flex-end; }
.activity-chip { color: var(--text-2); }
.rx-app-list, .app-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.rx-app-card { border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.rx-app-card:last-child { border-bottom: 0; }
.rx-app-card[open] { background: rgba(255, 255, 255, .012); }
:root[data-theme="light"] .rx-app-card[open] { background: #fbfcfd; }
.rx-app-card[data-focused="1"] { box-shadow: inset 2px 0 0 var(--accent); }
.rx-app-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
}
.rx-app-summary::-webkit-details-marker { display: none; }
.rx-app-summary:hover { background: var(--surface-2); }
.rx-app-main { min-width: 0; }
.rx-app-summary h2 { margin: 0 0 2px; font-size: 13.5px; }
.rx-app-summary p { margin: 0; font-size: 12px; line-height: 1.45; }
.rx-app-summary .summary-line { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 720px; }
.rx-app-state { display: flex; align-items: center; gap: 10px; flex: none; }
.rx-app-state i { color: var(--faint); transition: transform .15s ease; }
.rx-app-card[open] .rx-app-state i { transform: rotate(180deg); }
.rx-app-details { display: grid; gap: 12px; padding: 4px 16px 16px; }
.rx-app-details > .actions { margin-top: 2px; }
.rx-app-details .reject { margin: 0; }
.answers { display: grid; gap: 0; margin-top: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.answer { padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--field); }
.answer:last-child { border-bottom: 0; }
.answer .label { color: var(--muted); font-size: 11.5px; font-weight: 600; margin-bottom: 2px; }
.answer div:not(.label) { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.reviewer-line, .reminder-line { font-size: 12px; }
.voice-call { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.voice-call select { width: auto; min-width: 200px; }

.player-audit { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; background: var(--field); }
.audit-title { font-weight: 700; margin-bottom: 8px; font-size: 12.5px; color: var(--text-2); }
.audit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.audit-cell { padding: 9px 10px; border-right: 1px solid var(--line); }
.audit-cell:last-child { border-right: 0; }
.audit-cell b { display: block; font-size: 13.5px; }
.audit-cell span { font-size: 11.5px; color: var(--muted); }
.audit-prob { margin-top: 8px; }

/* Активность рекрутеров (правая колонка) */
.apps-side { position: static; min-width: 0; }
.recruiter-panel { display: grid; gap: 12px; padding: 16px; }
.rec-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.rec-card, .rec-card.recruiter-person { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 0; gap: 0; }
.rec-card:last-child { border-bottom: 0; }
.rec-card > .rec-sum { display: grid; grid-template-columns: 34px minmax(0, 1fr) 26px; align-items: center; gap: 10px; padding: 10px 12px; }
.rec-card[open] { background: rgba(255, 255, 255, .012); }
.rx-rec-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  font-size: 15px;
}
.rx-rec-avatar.senior { background: var(--amber-soft); color: var(--amber); }
.rec-main { display: grid; gap: 4px; min-width: 0; }
.rec-userline a { display: block; font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { font-size: 11.5px; color: var(--muted); }
.rec-counts { display: flex; gap: 5px; flex-wrap: wrap; }
.rec-apps.collapse-content { gap: 2px; padding: 6px; max-height: min(420px, calc(100vh - 260px)); overflow-y: auto; overscroll-behavior: contain; }
.rec-app-row, .rx-rec-app-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: var(--r-xs);
  font-size: 12px;
  color: var(--text);
}
.rec-app-row:hover { background: var(--surface-2); }
.rec-app-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#recruiter-activity { scroll-margin-top: 80px; }
#recruiter-activity.activity-pulse { animation: activityPulse .8s ease; }
@keyframes activityPulse { 40% { box-shadow: 0 0 0 3px var(--accent-soft); } }

/* Карточки форм */
.form-card { display: flex; flex-direction: column; gap: 10px; min-height: 220px; position: relative; }
.form-card .app-head { align-items: flex-start; }
.form-card .app-head h2 { margin-bottom: 4px; }
.form-status-box { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.form-meta { display: grid; gap: 8px; margin: auto 0 0; }
.form-meta-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 12px; font-weight: 600; }
.form-card-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.form-card-actions form, .form-card-actions .btn { width: 100%; }
.ticket-card .app-head { align-items: center; }

/* ---------- 12. Обзор: состав и лента ---------- */
.rx-rgroup { margin-bottom: 14px; }
.rx-rgroup:last-child { margin-bottom: 0; }
.rx-rgtitle { display: flex; align-items: center; gap: 8px; padding: 0 2px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.rx-rgtitle span { color: var(--faint); font-weight: 700; }
.rx-rgtitle.dep { color: var(--violet); }
.rx-row, .rx-lead {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text);
}
.rx-row:hover, .rx-lead:hover { background: var(--surface-2); color: var(--text); }
.rx-lead, .rx-row.rx-lead-row { background: var(--amber-soft); }
.rx-lead:hover { background: color-mix(in srgb, var(--amber) 20%, transparent); }
.rx-row.rx-dep { background: var(--violet-soft); }
.rx-row.rx-over { box-shadow: inset 2px 0 0 var(--red); }
.rx-rav {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 15px;
  object-fit: cover;
}
.rx-rav.crown { background: var(--amber-soft); color: var(--amber); }
.rx-rav.dep { background: var(--violet-soft); color: var(--violet); }
.rx-rname { font-weight: 700; font-size: 13px; }
.rx-rrole { color: var(--muted); font-size: 11.5px; }
.rx-rinfo { flex: 1; min-width: 0; }
.rx-rgo { margin-left: auto; color: var(--faint); display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.rx-rgo i { font-size: 16px; }
.rx-row:hover .rx-rgo { color: var(--muted); }
.rx-ractions { display: flex; align-items: center; gap: 6px; flex: none; }
.rx-locked { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: var(--faint); cursor: not-allowed; }
.rx-feed { display: flex; flex-direction: column; }
.rx-feed-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.rx-feed-row:last-child { border-bottom: 0; }
.rx-feed-time { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.rx-feed-tag { color: var(--accent-text); font-weight: 700; }
.rx-feed-txt { color: var(--text-2); }
.rx-feed-row.rx-off, tr.rx-off { opacity: .45; text-decoration: line-through; }

/* ---------- 13. Музыка ---------- */
.rx-music-card { padding: 0; overflow: visible; }
.rx-music-card > .rx-chead { margin: 0; }
.rx-music-card #musicLive { padding: 18px 20px 0; }
.music-now, .music-empty { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 16px; align-items: center; }
.music-cover { width: 88px; height: 88px; border-radius: var(--r); object-fit: cover; background: var(--surface-3); display: block; }
.music-cover-fallback { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 30px; }
.music-meta { min-width: 0; }
.music-title { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; overflow-wrap: anywhere; }
.music-title a:hover { color: var(--accent-text); }
.music-subline { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; }
.music-progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin: 12px 0 5px; }
.music-progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.music-time { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.music-queue { display: grid; margin-top: 16px; border-top: 1px solid var(--line); }
.music-queue-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.music-queue-row:last-child { border-bottom: 0; }
.music-queue-row span:first-child { color: var(--faint); font-variant-numeric: tabular-nums; }
.music-queue-row span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-queue-empty { margin: 14px 0 0; color: var(--muted); }
.music-player-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; margin-top: 18px; border-top: 1px solid var(--line); }
.music-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.music-control-form { display: inline-flex; }
.music-volume-control { position: relative; display: flex; align-items: center; }
.music-volume-trigger {
  height: 34px;
  min-width: 78px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.music-volume-trigger i { font-size: 16px; color: var(--muted); }
.music-volume-trigger:hover, .music-volume-control.open .music-volume-trigger { background: var(--surface-2); border-color: var(--accent-line); }
.music-volume-popover {
  position: absolute;
  right: 0;
  bottom: 42px;
  z-index: 15;
  width: 46px;
  height: 170px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.music-volume-control.open .music-volume-popover { opacity: 1; transform: none; pointer-events: auto; }
.music-volume-max, .music-volume-min { display: none; }
.music-volume-slider { position: absolute; left: 50%; top: 50%; width: 124px; height: 22px; margin: 0; transform: translate(-50%, -50%) rotate(-90deg); cursor: pointer; }
.rx-music-divider { height: 1px; background: var(--line); margin: 0; }
.music-add-head { padding: 16px 20px 0; margin-bottom: 12px; }
.music-add-head h2 { font-size: 14px; margin: 0 0 2px; }
.music-add-head p { margin: 0; font-size: 12px; }
.music-add-form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(200px, .6fr) auto; gap: 10px; align-items: end; padding: 0 20px 18px; }
.music-add-field { display: grid; gap: 6px; margin: 0; min-width: 0; }
.music-add-field span { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.music-add-submit { white-space: nowrap; }
.music-add-field[hidden] { display: none; }
.music-add-form:has(.music-add-field[hidden]) { grid-template-columns: minmax(220px, 1fr) auto; }

/* ---------- 14. Предпросмотр Discord ---------- */
.discord-preview { margin-top: 14px; display: grid; gap: 8px; }
.preview-title { color: var(--muted); font-weight: 600; font-size: 12px; }
.fake-embed {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: var(--r-xs);
  background: #15171c;
  color: #dbdee1;
}
:root[data-theme="light"] .fake-embed { background: #f2f3f5; color: #2e3338; }
.fake-embed h3 { margin: 0; font-size: 14px; color: inherit; }
.fake-embed p { margin: 0; color: inherit; }
.fake-embed small { color: var(--muted); }
.fake-embed img { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--r-xs); }
.fake-embed-head { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 12px; align-items: start; }
.fake-embed .fake-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: var(--r-xs); }
.fake-buttons { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.fake-btn { height: 30px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 3px; background: #4e5058; color: #fff; font-size: 12.5px; font-weight: 600; }
.fake-btn.good { background: #248046; }
.fake-field { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 8px; font-size: 13px; line-height: 1.6; }
.fake-field code { background: rgba(255, 255, 255, .08); border-radius: 3px; padding: 1px 4px; }
.fake-mention { color: #c9cdfb; background: rgba(88, 101, 242, .3); border-radius: 3px; padding: 0 3px; }

/* ---------- 15. Попапы и загрузка ---------- */
.clickable-profile { cursor: pointer; user-select: none; }
.profile-popup {
  position: fixed;
  z-index: 21000;
  width: 290px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-pop);
}
.pp-head { display: flex; gap: 10px; align-items: center; }
.pp-head img { width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover; }
.pp-head b { display: block; font-size: 13.5px; }
.pp-id { font-size: 11.5px; }
.pp-access { display: inline-flex; margin-top: 4px; height: 20px; align-items: center; padding: 0 7px; border-radius: var(--r-xs); font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); }
.pp-roles-title { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.pp-roles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-height: 160px; overflow-y: auto; }
.pp-role { height: 22px; display: inline-flex; align-items: center; padding: 0 7px; border-radius: var(--r-xs); font-size: 11.5px; font-weight: 600; color: var(--text); background: color-mix(in srgb, var(--rc, #8a92a4) 18%, transparent); }
.pp-menu { display: grid; gap: 2px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.pp-menu a { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; }
.pp-menu a i { font-size: 16px; color: var(--muted); }
.pp-menu a:hover { background: var(--surface-2); color: var(--text); }
.pp-menu a.danger:hover, .pp-menu a.danger:hover i { color: var(--red); }

.page-transition-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  height: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
.page-transition-loader.active { opacity: 1; }
.page-transition-loader::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: var(--accent);
  animation: rxLoad 1s ease-in-out infinite;
}
.page-loader-card { display: none; }
@keyframes rxLoad { 0% { left: -40%; } 100% { left: 100%; } }
body.page-leaving .rx-content { opacity: .55; transition: opacity .15s ease; }

/* ---------- 16. НВУ и «старший состав» ---------- */
.rx-nvu-form .actions { margin-top: 12px; }
.staff-panel-status { margin-bottom: 10px; }
.staff-groups { display: grid; gap: 10px; margin-top: 10px; }
.staff-group-slot { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--field); }
.staff-group-num { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- 17. Пользователи (журнал участника) ---------- */
.u-search { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 10px; align-items: end; }
.u-search .field { gap: 6px; }
.u-search-ico { position: relative; }
.u-search-ico i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 15px; pointer-events: none; }
.u-search-ico input { padding-left: 32px; }
.u-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 8px; color: var(--muted); font-size: 12.5px; }
.u-person { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.u-person:hover { color: var(--accent-text); }
.u-ava { width: 30px; height: 30px; border-radius: var(--r-sm); object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: 11.5px; }
.u-ava.lg { width: 56px; height: 56px; border-radius: var(--r); font-size: 18px; }
.u-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-sub { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.u-head h2 { font-size: 17px; margin: 0 0 3px; }
.u-head .u-ids { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12px; }
.u-head .u-ids b { color: var(--text-2); font-weight: 600; }
.u-head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.u-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.u-kpi { padding: 14px 20px; border-right: 1px solid var(--line); min-width: 0; }
.u-kpi:last-child { border-right: 0; }
.u-kpi span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.u-kpi b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.u-kpi small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 18px 0 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.u-tabs::-webkit-scrollbar { display: none; }
.u-tab { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.u-tab:hover { color: var(--text); }
.u-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.u-tab em { font-style: normal; color: var(--faint); font-size: 11.5px; font-weight: 700; }
.u-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.u-filter input, .u-filter select { width: auto; min-width: 180px; }
.u-filter input[type="search"] { flex: 1; min-width: 220px; }
.u-check { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.u-timeline { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.u-day { padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.u-ev { display: grid; grid-template-columns: 56px 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.u-ev:last-child { border-bottom: 0; }
.u-ev-time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 3px; }
.u-ev-ico { width: 26px; height: 26px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); font-size: 14px; }
.u-ev-ico.green { background: var(--green-soft); color: var(--green); }
.u-ev-ico.red { background: var(--red-soft); color: var(--red); }
.u-ev-ico.amber { background: var(--amber-soft); color: var(--amber); }
.u-ev-ico.blue { background: var(--blue-soft); color: var(--blue); }
.u-ev-ico.violet { background: var(--violet-soft); color: var(--violet); }
.u-ev-body { min-width: 0; padding-top: 3px; }
.u-ev-title { font-weight: 600; color: var(--text); }
.u-ev-title .muted { font-weight: 500; }
.u-ev-detail { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.u-ev-detail del { color: var(--faint); }
.u-msg { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.u-msg.deleted { color: var(--muted); }
.u-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--r-xs); font-size: 10.5px; font-weight: 700; background: var(--surface-3); color: var(--muted); vertical-align: 1px; margin-left: 6px; }
.u-tag.red { background: var(--red-soft); color: var(--red); }
.u-tag.amber { background: var(--amber-soft); color: var(--amber); }
.u-tag.green { background: var(--green-soft); color: var(--green); }
.u-bars { display: grid; gap: 8px; }
.u-bar { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr) 90px; gap: 12px; align-items: center; font-size: 12.5px; }
.u-bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.u-bar-track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.u-bar-track span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.u-bar.plain { grid-template-columns: minmax(0, 1fr) auto; }
.u-bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.u-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.u-pager .actions { margin: 0; }
.u-names { display: grid; gap: 0; }
.u-note { color: var(--faint); font-size: 12px; margin-top: 10px; }

/* ---------- 17b. Публикации: список и редактор ---------- */
.cs-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rx-chip em { font-style: normal; color: var(--faint); font-size: 11.5px; font-weight: 700; }
.rx-chip.on em { color: var(--accent-text); }
.cs-create { display: flex; gap: 8px; align-items: center; flex: 0 1 460px; }
.cs-create input { flex: 1; min-width: 160px; }
.cs-create select { width: auto; flex: none; }
.cs-table td { vertical-align: middle; }
.cs-table tr[data-href] { cursor: pointer; }
.cs-title { font-weight: 700; color: var(--text); }
.cs-title:hover { color: var(--accent-text); }
.cs-sub { color: var(--muted); font-size: 12px; margin-top: 1px; max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th.right, td.right { text-align: right; }
td.right .row-actions { justify-content: flex-end; flex-wrap: nowrap; }

.ed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.ed-main { padding: 0; }
.ed-sec { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; padding: 20px; border-bottom: 1px solid var(--line); }
.ed-sec-h h3 { margin: 0 0 4px; font-size: 13.5px; }
.ed-sec-h p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ed-sec-b { display: grid; gap: 14px; min-width: 0; }
.ed-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--surface);
  border-radius: 0 0 var(--r) var(--r);
}
.ed-bar-note { color: var(--faint); font-size: 12px; margin-left: 4px; }
.ed-side { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 12px; min-width: 0; max-height: calc(100vh - var(--top-h) - 32px); overflow-y: auto; }
.ed-card { padding: 0; }
.ed-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--text-2); list-style: none; }
.ed-card-h::-webkit-details-marker { display: none; }
.ed-card-h em { font-style: normal; color: var(--faint); margin-left: 4px; }
details.ed-card > summary { cursor: pointer; }
details.ed-card:not([open]) > .ed-card-h { border-bottom: 0; }
details.ed-card[open] > .ed-card-h i { transform: rotate(180deg); }
details.ed-card > .user-list, details.ed-card > p { padding: 12px 14px; margin: 0; max-height: 280px; overflow-y: auto; }
.ed-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; padding: 12px 14px; font-size: 12.5px; }
.ed-facts dt { color: var(--muted); }
.ed-facts dd { margin: 0; text-align: right; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.ed-actions form { display: inline-flex; margin: 0; }
.ed-preview { padding: 14px; background: #1a1b1e; border-radius: 0 0 var(--r) var(--r); }
:root[data-theme="light"] .ed-preview { background: #ffffff; }
.ed-preview .fake-embed { background: #222327; }
:root[data-theme="light"] .ed-preview .fake-embed { background: #f2f3f5; }
.fe-desc, .fe-lines { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.fake-embed .fe-lines { margin-top: 8px; }
.fe-image { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--r-xs); }
.fake-embed img[hidden] { display: none; }
.fake-btn.red { background: #da373c; }
.fake-btn.gray { background: #4e5058; }

.img-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.img-thumb { width: 40px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--faint); font-size: 16px; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-up { position: relative; overflow: hidden; height: 34px; }
.img-up input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.img-up span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-clear { width: 34px; height: 34px; }

.q-list { display: grid; gap: 8px; }
.q-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: end; }
.q-row > label { font-size: 0; gap: 0; }
.q-num { width: 26px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--muted); font-weight: 700; font-size: 12px; }

.cmd-new { margin-bottom: 4px; }
.cmd-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; align-items: start; }
.apps-search { width: 260px; }
.ar-grid { display: grid; grid-template-columns: minmax(0, 460px) auto; gap: 10px; align-items: end; justify-content: start; }
.apps-toolbar-right { gap: 8px; align-items: center; }

@media (max-width: 1180px) {
  .ed-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .ed-sec { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 980px) {
  .ed-layout { grid-template-columns: 1fr; }
  .ed-side { position: static; max-height: none; order: -1; }
  .cs-create { flex-basis: 100%; }
  .cmd-grid, .ar-grid { grid-template-columns: 1fr; }
  .apps-search { width: 100%; }
}
@media (max-width: 640px) {
  .img-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .img-up span { display: none; }
  .img-clear { display: none; }
  .cs-table .cs-sub { max-width: 220px; }
}

/* ---------- 17c. Настройки сервера: вкладки ---------- */
.st-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.st-nav { position: sticky; top: calc(var(--top-h) + 16px); display: flex; flex-direction: column; gap: 1px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.st-tab { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; white-space: nowrap; }
.st-tab i { font-size: 16px; color: var(--muted); }
.st-tab:hover { background: var(--surface-2); color: var(--text); }
.st-tab.on { background: var(--surface-3); color: var(--text); }
.st-tab.on i { color: var(--accent-text); }
.st-tab em { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--faint); }
.st-main { padding: 0; min-width: 0; }
.st-panel { display: none; }
.st-panel.on { display: block; }
.st-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.st-head h2 { margin: 0 0 2px; font-size: 16px; }
.st-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.ed-bar-note.warn { color: var(--amber); }
.ed-bar-note.ok { color: var(--green); }

.sw { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sw-track { position: relative; flex: none; width: 34px; height: 20px; margin-top: 1px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: background-color .15s ease, border-color .15s ease; }
.sw-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background-color .15s ease; }
.sw input:checked + .sw-track { background: var(--accent); border-color: var(--accent); }
.sw input:checked + .sw-track::after { transform: translateX(14px); background: #fff; }
.sw input:focus-visible + .sw-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw-text { display: grid; gap: 1px; min-width: 0; }
.sw-text b { font-weight: 600; color: var(--text); font-size: 13px; }
.sw-text small { color: var(--muted); font-size: 12px; }
.sw-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }

@media (max-width: 980px) {
  .st-layout { grid-template-columns: 1fr; }
  .st-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .st-nav::-webkit-scrollbar { display: none; }
  .st-tab em { display: none; }
  .sw-list { grid-template-columns: 1fr; }
}

/* ---------- 17d. Разделы и AFK ---------- */
.rx-link.off { opacity: .55; }
.rx-link em { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--faint); }
.rx-link.off.active::after { display: none; }
.sec-list { display: grid; }
.sec-head, .sec-row { display: grid; grid-template-columns: minmax(0, 260px) 90px minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px 20px; }
.sec-head { border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sec-row { border-bottom: 1px solid var(--line); }
.sec-row .role-field { gap: 0; }
.sec-row .role-field > .label-title { display: none; }
.sec-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sec-name i { font-size: 17px; color: var(--muted); }
.sec-name b { display: block; font-weight: 600; }
.sec-name small { display: block; color: var(--faint); font-size: 11.5px; }
.sec-note { padding: 12px 20px 0; margin: 0; }
.u-bar.afk { grid-template-columns: minmax(0, 180px) auto 90px; opacity: .7; }
tr.afk-row td { color: var(--muted); }

@media (max-width: 760px) {
  .sec-head { display: none; }
  .sec-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sec-row .role-field { grid-column: 1 / -1; }
}

/* ---------- 17e. Подача заявки ---------- */
.af-forms { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.af-form { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--field); color: var(--text); }
.af-form:hover { border-color: var(--accent-line); color: var(--text); }
.af-form.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.af-form-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.af-form-top b { font-weight: 700; line-height: 1.3; }
.af-form-sub { color: var(--muted); font-size: 12px; line-height: 1.4; }
.af-form-meta { color: var(--faint); font-size: 11.5px; }
.af-qs { display: grid; gap: 14px; }
.af-q { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; }
.af-q-num { width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-2); font-weight: 700; font-size: 12px; }
.af-q-body { gap: 6px; }
.af-q-label { color: var(--text); font-size: 13px; font-weight: 600; }
.af-q-body textarea { min-height: 58px; resize: none; overflow: hidden; }
.af-q-count { justify-self: end; color: var(--faint); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.af-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.af-user b { display: block; }
.af-user small { color: var(--muted); font-size: 11.5px; }
.af-steps { margin: 0; padding: 12px 14px 14px 32px; display: grid; gap: 6px; color: var(--text-2); font-size: 12.5px; }
.af-steps li::marker { color: var(--faint); font-weight: 700; }
.af-mine { display: grid; }
.af-mine-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.af-mine-row:last-child { border-bottom: 0; }
.af-mine-row b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.af-mine-row small { color: var(--faint); font-size: 11.5px; }
.af-empty { padding: 12px 14px; margin: 0; }
.af-warn { border-left-color: var(--amber); background: var(--amber-soft); color: var(--text); margin: 0; }
.af-sent { display: flex; gap: 12px; align-items: flex-start; border-left-color: var(--green); background: var(--green-soft); color: var(--text); }
.af-sent i { color: var(--green); font-size: 18px; margin-top: 1px; }
.af-sent b { display: block; }
.af-sent span { color: var(--text-2); font-size: 12.5px; }

/* ---------- 17f. Вход ---------- */
body.lg-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
  background:
    radial-gradient(900px 600px at 0% 0%, rgba(59, 111, 212, .10), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(59, 111, 212, .07), transparent 60%),
    var(--bg);
}
.lg-wrap { display: grid; justify-items: center; gap: 18px; width: 100%; max-width: 400px; }
.lg-card {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 34px 30px 26px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
}
.lg-ava { width: 92px; height: 92px; margin-bottom: 10px; border-radius: 50%; padding: 3px; background: var(--surface-3); box-shadow: 0 0 0 1px var(--line-strong); }
.lg-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.lg-card h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.lg-sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.lg-error { width: 100%; margin: 0 0 6px; text-align: left; font-weight: 500; }
.lg-btn { width: 100%; height: 42px; font-size: 14px; }
.lg-btn i { font-size: 18px; }
.lg-note { margin: 10px 0 0; color: var(--faint); font-size: 11.5px; line-height: 1.5; max-width: 300px; }
.lg-foot { margin: 0; color: var(--faint); font-size: 12px; }
[data-theme="light"] body.lg-page, :root[data-theme="light"] body.lg-page { background: radial-gradient(900px 600px at 0% 0%, rgba(52, 99, 201, .08), transparent 60%), var(--bg); }

/* ---------- 17g. Серверы ---------- */
.srv-card { gap: 0; }
.srv-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 4px; }
.srv-note { color: var(--muted); font-size: 12px; }
.srv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: auto; padding-top: 14px; }
.srv-actions > .btn { flex: 1; }
.srv-edit { flex-basis: 100%; }
.srv-edit > summary { list-style: none; width: 100%; }
.srv-edit > summary::-webkit-details-marker { display: none; }
.srv-edit[open] > summary { background: var(--surface-2); color: var(--text); }
.srv-edit-body { display: grid; gap: 12px; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--field); }
.srv-edit-body .form { gap: 10px; }
.srv-danger { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.srv-danger form { display: inline-flex; }

/* ---------- 17h. Главная семьи ---------- */
.ov-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 22px 24px; margin-bottom: 14px; }
.ov-hero-ava { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--surface-3); background: var(--surface-3); }
.ov-hero-text h2 { margin: 0 0 4px; font-size: 20px; }
.ov-hero-text p { margin: 0; color: var(--text-2); max-width: 680px; }
.ov-hero-cta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ov-block { margin-bottom: 14px; }
.ov-leaders { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.ov-leader { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--field); color: var(--text); }
.ov-leader:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.ov-ava { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); font-weight: 700; }
.ov-ava.sm { width: 34px; height: 34px; font-size: 12px; }
.ov-leader-info { display: grid; gap: 2px; min-width: 0; }
.ov-leader-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-leader-info small { color: var(--muted); font-size: 12px; }
.ov-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ov-group + .ov-group { margin-top: 16px; }
.ov-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.ov-person { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--text); }
.ov-person:hover { background: var(--surface-2); color: var(--text); }
.ov-person.ov-senior { background: var(--amber-soft); }
.ov-person.ov-dep { background: var(--violet-soft); }
.ov-person-info { display: grid; min-width: 0; }
.ov-person-info b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-person-info small { color: var(--muted); font-size: 11.5px; }
@media (max-width: 760px) {
  .ov-hero { grid-template-columns: auto minmax(0, 1fr); }
  .ov-hero-cta { grid-column: 1 / -1; justify-content: stretch; }
  .ov-hero-cta .btn { flex: 1; }
}

.ov-elders { display: grid; gap: 6px; }
.ov-elder { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); color: var(--text); }
.ov-elder:hover { color: var(--text); filter: brightness(1.08); }
.ov-elder-senior { background: var(--amber-soft); }
.ov-elder-dep { background: var(--violet-soft); }
.ov-elder .ov-ava { width: 40px; height: 40px; font-size: 18px; }
.ov-elder-senior .ov-ava:not(img) { color: var(--amber); }
.ov-elder-dep .ov-ava:not(img) { color: var(--violet); }
.ov-elder-info { display: grid; min-width: 0; flex: 1; }
.ov-elder-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-elder-info small { color: var(--muted); font-size: 12px; }
.ov-elder-go { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; flex: none; }
.ov-elder-go i { font-size: 18px; }
.ov-elder:hover .ov-elder-go { color: var(--text); }
.ov-more > summary { list-style: none; cursor: pointer; }
.ov-more > summary::-webkit-details-marker { display: none; }
.ov-more > summary i { margin-left: 2px; transition: transform .15s ease; }
.ov-more[open] > summary i { transform: rotate(180deg); }
@media (max-width: 640px) { .ov-elder-go span { display: none; } }

.ov-lead-edit { display: grid; gap: 12px; margin-bottom: 16px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--field); }
.ov-lead-edit[hidden] { display: none; }
.ov-lead-edit-head { display: grid; gap: 2px; }
.ov-lead-edit-head .muted { font-size: 12px; }
.ov-lead-list { display: grid; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.ov-lead-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ov-lead-row:last-child { border-bottom: 0; }
.ov-lead-row:has(input[name="visible"]:not(:checked)) .ov-lead-name, .ov-lead-row:has(input[name="visible"]:not(:checked)) > .ov-ava { opacity: .45; }
.ov-lead-name { display: grid; min-width: 0; }
.ov-lead-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-lead-name small { color: var(--muted); font-size: 11.5px; }
.ov-lead-move { display: inline-flex; gap: 4px; }
.ov-lead-move .rx-iconbtn { width: 28px; height: 28px; }
.ov-lead-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- 17i. Безопасность и логи ---------- */
.sec-srcs { display: grid; }
.sec-src { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sec-src:last-child { border-bottom: 0; }
.sec-src b { display: block; font-weight: 700; }
.sec-src b small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.sec-src > div > small { color: var(--muted); font-size: 12px; }
.sec-src .row-actions { flex-wrap: nowrap; }
.sec-src form { display: inline-flex; margin: 0; }
.sec-filter { display: grid; gap: 12px; }
.sec-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-group-title { width: 90px; color: var(--muted); font-size: 12px; font-weight: 600; }
.sec-search { max-width: 420px; }
.logs-search { width: 240px; }
@media (max-width: 760px) { .logs-search, .sec-search { width: 100%; max-width: none; } .sec-group-title { width: 100%; } }

/* ---------- 17j. Решение по заявке ---------- */
.reviewer-line { margin-top: 4px !important; }
.ap-verdict-chip { display: inline-flex; align-items: center; flex-wrap: wrap; column-gap: 6px; row-gap: 1px; max-width: 100%; min-height: 24px; padding: 3px 9px; border-radius: var(--r-xs); font-size: 12px; font-weight: 600; line-height: 1.35; }
.ap-verdict-chip i { font-size: 14px; flex: none; }
.ap-verdict-chip b { font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.ap-verdict-chip em { font-style: normal; opacity: .75; font-weight: 500; white-space: nowrap; }
.sec-path { display: block; margin-top: 4px; padding: 4px 7px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-2); font-family: inherit; font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere; width: fit-content; max-width: 100%; }
.ap-verdict-chip.ok { background: var(--green-soft); color: var(--green); }
.ap-verdict-chip.no { background: var(--red-soft); color: var(--red); }
.ap-verdict-chip.wait { background: var(--amber-soft); color: var(--amber); }
.ap-verdict { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid transparent; }
.ap-verdict b { display: block; font-size: 14px; }
.ap-verdict small { color: var(--text-2); font-size: 12px; }
.ap-verdict > div { flex: 1; min-width: 0; }
.ap-verdict.ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.ap-verdict.no { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.ap-verdict.wait { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.ap-verdict-ava { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.ap-verdict-ico { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); font-size: 17px; }
.ap-verdict.ok .ap-verdict-ico { color: var(--green); }
.ap-verdict.no .ap-verdict-ico { color: var(--red); }
.ap-verdict.wait .ap-verdict-ico { color: var(--amber); }

/* ---------- 17k. Модерация и защита ---------- */
.mod-card { margin-top: 14px; }
.mod-flash { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--r); font-size: 13px; font-weight: 600; border: 1px solid transparent; }
.mod-flash.ok { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.mod-flash.err { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.mod-sec { padding: 12px 0; border-top: 1px solid var(--line); }
.mod-card > .rx-chead + .mod-sec, .mod-card > .mod-flash + .mod-sec, .mod-card > .hint + .mod-sec { border-top: 0; padding-top: 4px; }
.mod-rule-note { display: flex; align-items: flex-start; gap: 6px; margin: -2px 0 10px; color: var(--muted); font-size: 12px; }
.mod-rule-note i { margin-top: 2px; flex: none; }
.mod-sec-t { color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.mod-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.mod-role { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border-radius: 999px; background: var(--surface-3); font-size: 12.5px; font-weight: 600; }
.mod-role > i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mod-role form { display: inline-flex; margin: 0; }
.mod-role button { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.mod-role button:hover, .mod-role button:focus-visible { background: var(--red-soft); color: var(--red); }
.mod-role:not(:has(form)) { padding-right: 10px; }
.mod-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.mod-inline select, .mod-inline input { width: auto; min-width: 180px; flex: 1 1 180px; max-width: 320px; }
.mod-acts { display: grid; gap: 8px; }
.mod-act { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.mod-act summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; font-weight: 700; list-style: none; }
.mod-act summary::-webkit-details-marker { display: none; }
.mod-act summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.mod-act[open] summary::after { transform: rotate(-135deg); }
.mod-act form { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; margin: 0; }
.mod-act form select { flex: 0 1 220px; width: auto; }
.mod-act form input[name="reason"] { flex: 1 1 240px; width: auto; }
.mod-cases { display: grid; gap: 6px; }
.mod-case { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.mod-case-r { min-width: 0; overflow-wrap: anywhere; }
.mod-case-m { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mod-case-m .u-person { display: inline; }
.mod-bot { display: inline-flex; align-items: center; gap: 4px; color: var(--amber); font-weight: 600; }
.mod-ban-r { margin: 0; padding: 8px 10px; border-radius: var(--r-xs); background: var(--red-soft); color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.mod-state { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.mod-state > i { font-size: 26px; flex: none; }
.mod-state > div { flex: 1 1 260px; min-width: 0; }
.mod-state b { display: block; font-size: 15px; }
.mod-state small { color: var(--text-2); font-size: 12.5px; }
.mod-state form { margin: 0; }
.mod-state.calm > i { color: var(--green); }
.mod-state.off > i { color: var(--muted); }
.mod-state.alarm { border-color: color-mix(in srgb, var(--red) 45%, transparent); background: var(--red-soft); }
.mod-state.alarm > i { color: var(--red); }
.mod-perms { margin-bottom: 14px; border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.mod-rules { display: grid; gap: 2px; }
.mod-rule { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mod-rule:last-child { border-bottom: 0; }
.mod-rule > i { margin-top: 2px; color: var(--green); flex: none; }
.mod-rule.off > i { color: var(--muted); }
.mod-rule.off b { color: var(--muted); }
.mod-rule b { display: block; font-size: 13.5px; }
.mod-rule small { color: var(--text-2); font-size: 12.5px; }
.mod-inc-users summary { cursor: pointer; font-weight: 600; }
.mod-inc-users { font-size: 12.5px; line-height: 1.6; }
.mod-sample { font-family: inherit; overflow-wrap: anywhere; }
.mod-bans .u-person { display: inline-flex; align-items: center; gap: 8px; }
.mod-bans .u-person small { display: block; font-size: 11px; }
.mod-bans .mod-inline { margin: 0; flex-wrap: nowrap; }
.mod-bans .mod-inline input { min-width: 140px; }
@media (max-width: 760px) {
  .mod-case { grid-template-columns: auto 1fr; }
  .mod-case-m { grid-column: 1 / -1; white-space: normal; }
  .mod-bans .mod-inline { flex-wrap: wrap; }
  .mod-inline select, .mod-inline input, .mod-act form select, .mod-act form input[name="reason"] { flex-basis: 100%; max-width: none; }
}

.sec-block-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.sec-block-form select { width: auto; height: 30px; padding: 0 8px; font-size: 12px; }
.sec-ab { display: grid; gap: 12px; }
.sec-ab-row { display: flex; flex-wrap: wrap; gap: 12px; }
.sec-ab-row label { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; min-width: 200px; }
.sec-ab-row select { width: 220px; }
@media (max-width: 760px) { .sec-block-form select { max-width: 110px; } .sec-ab-row label, .sec-ab-row select { width: 100%; } }

/* ---------- 18. Адаптив ---------- */
@media (max-width: 1100px) {
  .rx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rx-stats .rx-stat:nth-child(2) { border-right: 0; }
  .rx-stats .rx-stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .u-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .u-kpi:nth-child(3) { border-right: 0; }
  .u-kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 1000px) {
  .apps-layout, .rx-app-layout, .rx-cols, .panel-grid { grid-template-columns: 1fr; }
  .music-add-form { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .rx-burger { display: inline-flex; }
  .rx-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 272px;
    max-width: 86vw;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-pop);
    background: var(--bg);
  }
  .rx-collapse { display: none; }
  body.rx.nav-open .rx-sidebar { transform: none; }
  .rx-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  body.rx.nav-open .rx-backdrop { opacity: 1; pointer-events: auto; }
  body.rx.nav-open { overflow: hidden; }
  .rx-topbar { padding: 0 14px; }
  .rx-content { padding: 18px 14px 32px; }
  .rx-crumb { display: none; }
  .two, .two-cards, .create-form-grid, .create-form-line, .u-search { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .rx-stats, .u-kpis { grid-template-columns: 1fr 1fr; }
  .u-kpi, .u-kpi:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .u-kpi:nth-child(2n) { border-right: 0; }
  .u-kpi:last-child { border-bottom: 0; }
  .rx-stat-num { font-size: 22px; }
  .rx-tright .rx-back-btn span { display: none; }
  .rx-app-summary { align-items: flex-start; }
  .rx-app-state { flex-direction: column; align-items: flex-end; }
  .reject { grid-template-columns: 1fr; }
  .audit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .music-now, .music-empty { grid-template-columns: 60px minmax(0, 1fr); gap: 12px; }
  .music-cover { width: 60px; height: 60px; }
  .music-player-controls { flex-wrap: wrap; }
  .fake-embed-head { grid-template-columns: 1fr; }
  .form-card-actions { grid-template-columns: 1fr; }
  .rec-app-row, .rx-rec-app-row { grid-template-columns: 40px minmax(0, 1fr); }
  .u-head { flex-wrap: wrap; }
  .u-head-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
  .u-bar { grid-template-columns: minmax(0, 1fr) 70px; }
  .u-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .rx-feed-row { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
