/* Панель семьи в стиле сайта Hoodlume: ночной фон, частицы, свечение за курсором, стекло.
   Акцент — фирменный цвет семьи (--brand). У клиентов Hoodlume сервер перекрашивает его на лету под цвет бренда. */
:root {
  --brand: #ff8a1f;
  --brand-hi: color-mix(in srgb, var(--brand) 62%, #ffffff);
  --brand-lo: color-mix(in srgb, var(--brand) 55%, #000000);
  --brand-ink: color-mix(in srgb, var(--brand) 18%, #0a0a0a);
  --brand-2: var(--brand-hi);
  --night: color-mix(in srgb, var(--brand) 5%, #07070d);
  --night-2: color-mix(in srgb, var(--brand) 12%, #0c0c16);
  --text: #eef0f6;
  --muted: color-mix(in srgb, var(--brand) 14%, #9a9cb4);
  --line: rgba(230, 236, 255, .10);
  --line-hi: rgba(230, 236, 255, .18);
  --glass: rgba(230, 236, 255, .042);
  --glass-2: rgba(230, 236, 255, .075);
  --tint: color-mix(in srgb, var(--brand) 14%, transparent);
  --tint-hi: color-mix(in srgb, var(--brand) 28%, transparent);
  --ok: #4ade80;
  --bad: #f87171;
  --warn: #fde047;
  --info: #93a5ff;
  --radius: 22px;
  --side-w: 264px;
  --ease: cubic-bezier(.22, .8, .2, 1);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wm: Impact, "Arial Black", "Franklin Gothic Heavy", sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  /* старые имена — их использует код страниц */
  --stroke: var(--line);
  --stroke-hi: var(--line-hi);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--night); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.locked { overflow: hidden; }
a { color: var(--brand-hi); text-decoration: none; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 15px; }
small, .muted { color: var(--muted); }
code { background: var(--tint); color: var(--brand-hi); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
[hidden] { display: none !important; }
::selection { background: var(--tint-hi); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(230, 236, 255, .12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--tint-hi); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Фон: свечение цвета семьи, частицы, шум, свет за курсором ---------- */
.bg { position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% -5%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 70%),
    radial-gradient(48% 42% at 105% 45%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 70%),
    radial-gradient(40% 40% at 40% 110%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%),
    var(--night); }
.bg::after { content: ""; position: absolute; inset: 0; opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
#fx { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
#glow { position: fixed; z-index: -1; left: 0; top: 0; width: 440px; height: 440px; margin: -220px 0 0 -220px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 20%, transparent) 0%, color-mix(in srgb, var(--brand) 9%, transparent) 36%, transparent 68%);
  opacity: 0; transition: opacity .5s ease; will-change: transform; }
#glow.on { opacity: 1; }

/* ---------- Поверхности ---------- */
.glass, .card, .stat, .side, .login-card, dialog, .toast {
  background: linear-gradient(150deg, var(--glass-2), var(--glass));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(230, 236, 255, .07), 0 24px 60px rgba(0, 0, 0, .35);
}
.side, dialog, .toast, .login-card { -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }

/* ---------- Подписи как на сайте ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--brand-hi); }
.wm { font-family: var(--wm); letter-spacing: 1px; text-transform: uppercase; font-weight: 400; }
em, .serif { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--brand-hi); }

/* ---------- Вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; border-radius: 28px; padding: 40px 32px 34px; text-align: center; animation: pageIn .8s var(--ease) both; }
.login-card h1 { font-size: 30px; line-height: 1.05; margin: 22px 0 8px; font-weight: 800; letter-spacing: -.02em; }
.login-card p { margin: 0 0 6px; }
.logo-img { width: 96px; height: 96px; border-radius: 26px; object-fit: cover; box-shadow: 0 0 60px color-mix(in srgb, var(--brand) 45%, transparent); }
.error { color: var(--bad); }

/* ---------- Каркас ---------- */
.shell { min-height: 100vh; }
.side { position: fixed; z-index: 40; left: 14px; top: 14px; bottom: 14px; width: var(--side-w); display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; background: linear-gradient(160deg, color-mix(in srgb, var(--night-2) 82%, transparent), color-mix(in srgb, var(--night) 78%, transparent)); }
.brand { display: flex; gap: 12px; align-items: center; padding: 18px 18px 16px; border-bottom: 1px solid var(--line); }
.brand img { width: 42px; height: 42px; border-radius: 13px; object-fit: cover; background: var(--glass-2); box-shadow: 0 0 28px color-mix(in srgb, var(--brand) 40%, transparent); flex: none; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand > div { min-width: 0; }
.brand b { display: block; font-family: var(--wm); font-weight: 400; font-size: 18px; letter-spacing: .8px; text-transform: uppercase; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; margin-top: 3px; }
nav { padding: 10px 10px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
nav a { position: relative; display: flex; align-items: center; gap: 10px; color: color-mix(in srgb, var(--text) 78%, var(--muted)); padding: 9px 14px; border-radius: 13px; cursor: pointer; transition: background .2s, color .2s; user-select: none; }
nav a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-hi); flex: none; transition: background .2s, box-shadow .2s, transform .3s var(--ease); }
nav a:hover { background: rgba(230, 236, 255, .05); color: var(--text); }
nav a:hover::before { background: var(--brand-hi); transform: scale(1.2); }
nav a.active { color: var(--text); background: linear-gradient(90deg, var(--tint-hi), color-mix(in srgb, var(--brand) 4%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent); }
nav a.active::before { background: var(--brand); box-shadow: 0 0 10px var(--brand); }
.nav-sep { font-size: 10.5px; text-transform: uppercase; letter-spacing: .22em; color: var(--muted); padding: 18px 14px 6px; }
.me { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.me img { width: 34px; height: 34px; border-radius: 50%; background: var(--glass-2); object-fit: cover; }
.me div { flex: 1; min-width: 0; }
.me b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { font-size: 11px; }
main { min-width: 0; margin-left: calc(var(--side-w) + 28px); }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: flex-end; gap: 14px; padding: 26px 32px 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--night) 94%, transparent) 55%, color-mix(in srgb, var(--night) 0%, transparent)); }
.top .heading { flex: 1; min-width: 0; }
.top h1 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.05; font-weight: 800; letter-spacing: -.025em; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.menu { display: none; }
#scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .25s; }
#view { padding: 6px 32px 56px; max-width: 1360px; }
#view.page { animation: pageIn .55s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Кнопки и поля ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 17px; border-radius: 13px; overflow: hidden;
  border: 1px solid var(--line-hi); background: var(--glass-2); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s, box-shadow .25s, border-color .2s; }
.btn:hover { background: rgba(230, 236, 255, .12); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-lo)); border-color: color-mix(in srgb, var(--brand) 70%, #ffffff 10%); color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 32px color-mix(in srgb, var(--brand) 40%, transparent); }
.btn.primary:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 14px 46px color-mix(in srgb, var(--brand) 60%, transparent); }
.btn.primary::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .3) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.4s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
.btn.ok { background: rgba(74, 222, 128, .14); border-color: rgba(74, 222, 128, .45); color: var(--ok); }
.btn.danger { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .45); color: var(--bad); }
.btn.small { height: 31px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn.wide { width: 100%; height: 48px; margin-top: 14px; font-size: 15px; border-radius: 15px; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 17px; cursor: pointer; padding: 5px 8px; border-radius: 9px; transition: background .2s, color .2s; }
.icon-btn:hover { color: var(--text); background: rgba(230, 236, 255, .08); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.link-btn:hover { color: var(--text); }
.danger-text:hover { color: var(--bad); }
input, select, textarea { width: 100%; background: rgba(0, 0, 0, .32); color: var(--text); border: 1px solid var(--line-hi); border-radius: 13px; padding: 10px 13px; font: inherit; transition: border-color .2s, box-shadow .2s, background .2s; }
input:hover, select:hover, textarea:hover { border-color: rgba(230, 236, 255, .26); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select option { background: #13131c; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: color-mix(in srgb, var(--brand) 75%, transparent); box-shadow: 0 0 0 4px var(--tint); background: rgba(0, 0, 0, .4); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brand); }
input[type="color"] { height: 42px; padding: 4px; cursor: pointer; }
label.field { display: flex; flex-direction: column; gap: 7px; }
label.field > span { font-size: 12.5px; color: var(--muted); font-weight: 550; }
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--muted); }
.help { margin: 2px 0 0; font-size: 12.5px; color: color-mix(in srgb, var(--text) 70%, var(--muted)); line-height: 1.5; padding-left: 11px; border-left: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); }

/* ---------- Раскладка ---------- */
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > .card + .card { margin-top: 0; }
.grid > div > .card + .card { margin-top: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { border-radius: var(--radius); padding: 18px 20px 16px; position: relative; overflow: hidden; transition: transform .3s var(--ease), border-color .3s; }
.stat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.stat::after { content: ""; position: absolute; width: 120px; height: 120px; right: -44px; top: -54px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 38%, transparent), transparent 70%); pointer-events: none; }
.stat small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.stat b { display: block; margin-top: 6px; font-size: 32px; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.stat b.stat-sm { font-size: 16px; font-weight: 700; letter-spacing: 0; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card { border-radius: var(--radius); min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card > header h2 { font-size: 15.5px; font-weight: 750; }
.card > .body { padding: 20px; }
.card > .body > :first-child { margin-top: 0; }
.card > .body > :last-child { margin-bottom: 0; }
.card > .body > p.hint { margin: 0 0 10px; }
.card + .card { margin-top: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer, .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.stack { display: grid; gap: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- Таблицы и списки ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid rgba(230, 236, 255, .05); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click td { transition: background .15s; }
tr.click:hover td { background: var(--tint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user img, .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--glass-2); flex: none; object-fit: cover; border: 1px solid var(--line); }
.user > div { min-width: 0; }
.user b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user small { display: block; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 11px; border-radius: 999px; background: rgba(230, 236, 255, .05); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .07); }
.pill.bad { color: var(--bad); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .07); }
.pill.warn { color: var(--warn); border-color: rgba(253, 224, 71, .35); background: rgba(253, 224, 71, .07); }
.pill.brand { color: var(--brand-hi); border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: var(--tint); }
.pill.info { color: var(--info); border-color: rgba(147, 165, 255, .4); background: rgba(147, 165, 255, .08); }
.role-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; padding: 5px; border-radius: 16px; background: rgba(230, 236, 255, .035); border: 1px solid var(--line); }
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px 15px; cursor: pointer; font: inherit; font-weight: 550; border-radius: 11px; white-space: nowrap; transition: color .2s, background .2s; }
.tabs button:hover { color: var(--text); background: rgba(230, 236, 255, .05); }
.tabs button.active { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-lo)); font-weight: 650; box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 35%, transparent); text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.tabs input, .tabs select { width: auto; }
.empty { text-align: center; color: var(--muted); padding: 38px 16px; }
.timeline { display: flex; flex-direction: column; }
.timeline .item { padding: 12px 0; border-bottom: 1px solid rgba(230, 236, 255, .05); }
.timeline .item:last-child { border-bottom: 0; }
.timeline .item small { display: block; }
.qa dt { font-size: 12px; color: var(--muted); }
.qa dd { margin: 3px 0 14px; white-space: pre-wrap; word-break: break-word; }
.chat .msg { display: flex; gap: 10px; padding: 9px 0; }
.chat .msg p { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.chat .msg.deleted p { text-decoration: line-through; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(230, 236, 255, .05); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 12px; font-size: 13px; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; }
.chip button:hover { color: var(--bad); }

/* ---------- Комментарии ---------- */
.comment-new, .comment { display: flex; gap: 12px; }
.comment-new { padding-bottom: 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.comment { padding: 12px 0; }
.comment-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.comment-text { margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.comment .avatar, .comment-new .avatar { width: 38px; height: 38px; }

/* ---------- Аудит и система ---------- */
.audit-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid rgba(230, 236, 255, .05); }
.audit-row:last-child { border-bottom: 0; }
.audit-details { margin-top: 6px; padding: 9px 12px; border-radius: 12px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); font-size: 13px; color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.audit-details div + div { margin-top: 3px; }
.action-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(230, 236, 255, .05); }
.action-row:last-child { border-bottom: 0; }
.action-row small { display: block; }

/* ---------- Конструктор анкет ---------- */
.guide { margin-bottom: 18px; padding: 15px 19px; border-radius: var(--radius); background: linear-gradient(135deg, var(--tint-hi), color-mix(in srgb, var(--brand) 3%, transparent)); border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent); }
.guide summary { cursor: pointer; font-weight: 650; }
.guide ol { margin: 10px 0 0; padding-left: 20px; }
.guide li + li { margin-top: 6px; }
.adv summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.adv[open] { width: 100%; }
.q-item { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: rgba(0, 0, 0, .22); }
.q-item header { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.q-item header b { flex: 1; }
.preview { background: #313338; color: #dbdee1; border-radius: 12px; padding: 14px; font-size: 14px; margin-top: 6px; }
.preview .v2 { border-left: 4px solid var(--brand); background: #2b2d31; border-radius: 8px; padding: 12px 14px; }
.preview .v2-banner { width: 100%; border-radius: 6px; display: block; margin-bottom: 10px; }
.preview .v2-emoji { width: 18px; height: 18px; vertical-align: -3px; }
.preview .v2 h4 { font-size: 16px; margin-bottom: 8px; color: #f2f3f5; }
.preview .v2 p { margin: 0 0 12px; white-space: pre-wrap; }
.preview .v2 .foot { font-size: 12px; color: #949ba4; margin-top: 10px; }
.preview .dbtn { display: inline-flex; align-items: center; gap: 6px; background: #5865f2; color: #fff; border-radius: 6px; padding: 6px 14px; font-size: 13px; font-weight: 500; }

/* ---------- Всплывающее ---------- */
.toast { position: fixed; bottom: 22px; right: 22px; z-index: 60; border-left: 3px solid var(--brand); border-radius: 16px; padding: 13px 17px; max-width: 420px; white-space: pre-line; background: color-mix(in srgb, var(--night-2) 92%, transparent); animation: toastIn .35s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }
dialog { color: var(--text); border-radius: 24px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: hidden; background: color-mix(in srgb, var(--night-2) 94%, transparent); }
dialog[open] { display: flex; flex-direction: column; animation: dlgIn .3s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog form { padding: 24px; overflow-y: auto; overscroll-behavior: contain; max-height: calc(100vh - 48px); }
dialog h2 { margin-bottom: 14px; font-size: 19px; }

/* ---------- Доступ ---------- */
.access-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(230, 236, 255, .05); }
.access-row:last-child { border-bottom: 0; }
.sec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sec { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--line); background: rgba(0, 0, 0, .22); cursor: pointer; transition: border-color .2s, background .2s; }
.sec:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 55%, transparent); background: var(--tint); }
.sec input { margin-top: 3px; }
.sec small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Система ---------- */
pre.log { margin: 4px 0 0; padding: 9px 11px; border-radius: 11px; background: rgba(0, 0, 0, .42); border: 1px solid var(--line); font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; color: color-mix(in srgb, var(--brand) 30%, #f1f1f1); }
.console-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.console-item { display: flex; flex-direction: column; gap: 4px; padding: 13px; border-radius: 16px; background: rgba(230, 236, 255, .03); border: 1px solid var(--line); }
.console-item .btn { align-self: flex-start; margin-top: 6px; }

/* ---------- Состав ---------- */
.card.squad { position: relative; }
.card.squad::before { content: ""; position: absolute; left: 22px; right: 22px; top: -1px; height: 2px; border-radius: 0 0 3px 3px; background: var(--sq, var(--brand)); box-shadow: 0 0 14px color-mix(in srgb, var(--sq, var(--brand)) 60%, transparent); pointer-events: none; }
.roster-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(230, 236, 255, .06); }
.roster-row:last-child { border-bottom: 0; }
.roster-row .user { flex: 1; min-width: 0; }
.roster-row select { width: auto; max-width: 190px; padding: 6px 30px 6px 9px; }
.roster-row .capt { opacity: .3; filter: grayscale(1); }
.roster-row .capt.on { opacity: 1; filter: none; }
.slotbar { height: 6px; border-radius: 6px; background: rgba(230, 236, 255, .08); overflow: hidden; margin: 2px 0 10px; }
.slotbar i { display: block; height: 100%; background: var(--sq, var(--brand)); border-radius: 6px; }
.bad-text { color: var(--bad); }

/* ---------- Оформление (Nest) ---------- */
.brand-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-opt { display: grid; gap: 8px; padding: 8px; border-radius: 16px; border: 2px solid var(--line); background: var(--glass); color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: border-color .2s, transform .2s var(--ease); }
.brand-opt img { width: 100%; border-radius: 11px; display: block; }
.brand-opt:hover { transform: translateY(-2px); }
.brand-opt.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--tint); cursor: default; }

/* ---------- Выговоры: выдача нескольким ---------- */
.warn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(230, 236, 255, .06); }
.warn-row:last-child { border-bottom: 0; }

/* ---------- Подписка Hoodlume ---------- */
.lic-banner { display: flex; align-items: center; gap: 14px; justify-content: space-between; margin: 0 32px 16px; padding: 13px 17px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); background: var(--tint); }
.lic-banner.bad { background: rgba(237, 66, 69, .16); border-color: rgba(237, 66, 69, .45); }
.lic-banner.info { background: rgba(88, 101, 242, .16); border-color: rgba(88, 101, 242, .45); }
.lic-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lic-head small { display: block; }
.lic-plan { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.lic-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.lic-mod { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 13px; background: rgba(230, 236, 255, .03); border: 1px solid rgba(230, 236, 255, .06); opacity: .5; }
.lic-mod.on { opacity: 1; border-color: color-mix(in srgb, var(--brand) 42%, transparent); }
.lic-mod span { width: 22px; text-align: center; font-weight: 700; color: var(--brand); }

/* ---------- Телефон и планшет ---------- */
@media (max-width: 1100px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .side { left: 8px; top: 8px; bottom: 8px; width: min(290px, calc(100vw - 48px)); transform: translateX(calc(-100% - 16px)); transition: transform .3s var(--ease); background: color-mix(in srgb, var(--night-2) 96%, transparent); }
  body.menu-open .side { transform: none; }
  body.menu-open #scrim { opacity: 1; pointer-events: auto; }
  main { margin-left: 0; }
  .menu { display: inline-flex; align-self: center; font-size: 20px; }
  .top { padding: 16px 16px 12px; align-items: center; }
  .top .eyebrow { display: none; }
  .top h1 { font-size: 21px; margin: 0; }
  #view { padding: 4px 16px 40px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .access-row { grid-template-columns: 1fr; }
  .sec-grid { grid-template-columns: 1fr; }
  .lic-banner { margin: 0 16px 12px; flex-wrap: wrap; }
  .warn-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 15px; }
  .stat b { font-size: 26px; }
  .card > header { padding: 14px 16px; flex-wrap: wrap; }
  .card > .body { padding: 16px; }
  .card { overflow-x: auto; }
  td { padding: 9px 8px; }
  td.num { white-space: nowrap; }
  .roster-row { flex-wrap: wrap; }
  .roster-row select { max-width: 100%; flex: 1; }
  .brand-pick { grid-template-columns: 1fr; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  #top-actions { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #fx, #glow { display: none; }
}

.owner-login { margin-top: 18px; text-align: left; } .owner-login summary { cursor: pointer; color: var(--muted); font-size: 13px; text-align: center; list-style: none; } .owner-login summary:hover { color: var(--text); }

:root{--brand:#FF6600}
