/* BlackDragon Platform 2.0 — стили. Сетка 8px, радиусы 10–14px, тонкие границы вместо теней. */

/* ───────────── Шрифты (локально, без внешних CDN) ───────────── */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(../fonts/inter-latin-wght-normal.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; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/manrope-cyrillic-wght-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/manrope-latin-wght-normal.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; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/jetbrains-mono-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-400-normal.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; }

/* ───────────── Токены: светлая тема (по умолчанию) и тёмная ───────────── */
:root, :root[data-theme='light'] {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;
  --surface-3: #E9EBEF;
  --border: #E4E7EC;
  --border-2: #D0D5DD;
  --text: #101318;
  --text-muted: #5B6472;
  --placeholder: #98A2B3;
  --accent: #8F6B2C;           /* золото клуба, затемнённое для текста на белом */
  --accent-hover: #765823;
  --accent-rgb: 176 138 62;    /* для подложек и обводок */
  --on-accent: #FFFFFF;
  --primary-bg: #111418;       /* основная кнопка — графит */
  --primary-text: #FFFFFF;
  --primary-hover: #2B2F37;
  --success: #1E7B4F;  --success-rgb: 30 123 79;
  --danger: #C0392B;   --danger-rgb: 192 57 43;   --danger-hover: #A93226;
  --warning: #A0640A;  --warning-rgb: 160 100 10;
  --silver: #5E6673;   --silver-rgb: 94 102 115;
  --hover: rgba(16, 24, 40, .04);
  --scroll: #C9CED6;
  --backdrop: rgba(16, 19, 24, .45);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-pop: 0 16px 40px -12px rgba(16, 24, 40, .22), 0 2px 6px rgba(16, 24, 40, .06);
  --top-bg: rgba(244, 245, 247, .86);
  --accent-soft: rgb(var(--accent-rgb) / .1);
  --accent-line: rgb(var(--accent-rgb) / .5);
  --theme-color: #F4F5F7;
  color-scheme: light;
}
:root:is([data-theme='dark'], [data-theme='night']) {
  --bg: #0B0C0F;
  --surface: #12141A;
  --surface-2: #181B22;
  --surface-3: #1D2029;
  --border: #23262F;
  --border-2: #2F3340;
  --text: #E8EAEE;
  --text-muted: #8B91A0;
  --placeholder: #5F6573;
  --accent: #C9A96A;
  --accent-hover: #D4B77E;
  --accent-rgb: 201 169 106;
  --on-accent: #0B0C0F;
  --primary-bg: #C9A96A;
  --primary-text: #0B0C0F;
  --primary-hover: #D4B77E;
  --success: #4FA37A;  --success-rgb: 79 163 122;
  --danger: #C95F5F;   --danger-rgb: 201 95 95;   --danger-hover: #D46F6F;
  --warning: #C9A14A;  --warning-rgb: 201 161 74;
  --silver: #C9CDD6;   --silver-rgb: 185 190 201;
  --hover: var(--hover);
  --scroll: var(--scroll);
  --backdrop: var(--backdrop);
  --shadow-1: none;
  --shadow-pop: 0 16px 40px -12px rgba(0, 0, 0, .6);
  --top-bg: rgba(11, 12, 15, .86);
  --accent-soft: rgb(var(--accent-rgb) / .08);
  --accent-line: rgb(var(--accent-rgb) / .45);
  --theme-color: #0B0C0F;
  color-scheme: dark;
}
:root {
  --font-ui: 'Inter', sans-serif;
  --font-head: 'Manrope', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --r-sm: 10px;
  --r: 12px;
  --r-lg: 16px;
  --side: 256px;
  --top: 60px;
}

/* ───────────── База ───────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font: 400 14px/1.55 var(--font-ui); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: 600; }
[hidden] { display: none !important; }
::selection { background: rgb(var(--accent-rgb) / .3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.i { flex: none; display: block; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.muted-text { color: var(--text-muted); }
.hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.label { font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: .02em; }
.eyebrow { font: 400 12px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.noscript { padding: 48px 16px; text-align: center; color: var(--text-muted); }
.hp, .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }
.only-mobile { display: none !important; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 14px; font-weight: 500; text-decoration: none; }
.link:hover { color: var(--accent-hover); }
.link-btn { justify-self: center; background: none; border: 0; color: var(--text-muted); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-2); }
.link-btn:hover { color: var(--text); }

/* ───────────── Логотип ───────────── */
.logo { display: inline-flex; align-items: center; }
.logo-img { height: 18px; width: auto; }
.logo-text { font: 700 14px/1 var(--font-head); letter-spacing: .16em; color: var(--text); }

/* ───────────── Кнопки ───────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--r-sm);
  font: 500 14px/1 var(--font-ui); white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), opacity .18s; }
.btn-sm { height: 32px; padding: 0 12px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary-bg); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--border-2); background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-outline { background: transparent; border-color: var(--accent-line); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn-danger { background: var(--danger); color: var(--on-accent); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-danger-ghost { background: transparent; border-color: rgb(var(--danger-rgb) / .35); color: var(--danger); }
.btn-danger-ghost:hover { background: rgb(var(--danger-rgb) / .08); }
.btn-link { height: auto; padding: 0; border: 0; background: none; color: var(--accent); }
.btn-link:hover { color: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-busy { opacity: .65; cursor: progress; }
.icon-btn { position: relative; flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-muted); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.drag { flex: none; width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-muted); cursor: grab; touch-action: none; }
.drag:hover { background: var(--hover); color: var(--text); }
.drag:active { cursor: grabbing; }
.is-sorting { user-select: none; cursor: grabbing; }
.is-dragging { border-color: var(--accent) !important; opacity: .9; }

/* ───────────── Поля ───────────── */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; align-content: start; }
.input { width: 100%; height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); font: 400 14px/1.5 var(--font-ui);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.input::placeholder { color: var(--placeholder); }
.input:hover { border-color: var(--border-2); }
.input:focus { outline: none; border-color: rgb(var(--accent-rgb) / .7); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .14); }
.input:disabled { opacity: .5; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select { cursor: pointer; }
.input-search { max-width: 360px; }
.form-msg { font-size: 14px; color: var(--danger); }
.form-msg:empty { display: none; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-section { padding-top: 16px; border-top: 1px solid var(--border); font: 600 12px/1.5 var(--font-head); color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-eye { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-muted); cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--surface-2); }
.code-input { text-align: center; font-size: 20px; letter-spacing: .32em; }
.mini-field { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.mini-field .input { width: auto; min-width: 128px; height: 36px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; }
.switch-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-ui { position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); transition: background-color .18s var(--ease), border-color .18s var(--ease); }
.switch-ui::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: transform .18s var(--ease), background-color .18s var(--ease); }
.switch-input:checked + .switch-ui { background: rgb(var(--accent-rgb) / .22); border-color: var(--accent-line); }
.switch-input:checked + .switch-ui::after { transform: translateX(16px); background: var(--accent); }
.switch-input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; position: relative; }
.swatch::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--c); }
.swatch[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg) inset; }
.seg { display: inline-flex; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); max-width: 100%; overflow-x: auto; }
.seg-full { display: flex; width: 100%; }
.seg-full .seg-btn { flex: 1; }
.seg-btn { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--text-muted); font: 500 14px/1 var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.tag-filter, .tags-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-filter { margin-bottom: 24px; }
.tag-toggle { height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--text-muted); font: 500 12px/1 var(--font-ui); cursor: pointer; transition: all .15s var(--ease); }
.tag-toggle:hover { color: var(--text); border-color: var(--border-2); }
.tag-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* Цветовые метки: только оттенки палитры */
.c-slate { --c: #8B91A0; }
.c-gold { --c: #C9A96A; }
.c-green { --c: #4FA37A; }
.c-red { --c: #C95F5F; }
.c-amber { --c: #C9A14A; }

/* ───────────── Метки, аватары, счётчики ───────────── */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font: 500 12px/1 var(--font-ui); white-space: nowrap; }
.chip-success { color: var(--success); background: rgb(var(--success-rgb) / .10); border-color: rgb(var(--success-rgb) / .28); }
.chip-warning { color: var(--warning); background: rgb(var(--warning-rgb) / .10); border-color: rgb(var(--warning-rgb) / .28); }
.chip-danger { color: var(--danger); background: rgb(var(--danger-rgb) / .10); border-color: rgb(var(--danger-rgb) / .28); }
.chip-accent { color: var(--accent); background: var(--accent-soft); border-color: rgb(var(--accent-rgb) / .32); }
.chip-level { color: var(--text); }
.badge, .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 400 12px/20px var(--font-mono); text-align: center; flex: none; }
.avatar { flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: 600 12px/1 var(--font-head); letter-spacing: .04em; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.is-icon { color: var(--accent); }

/* ───────────── Состояния ───────────── */
.skel-wrap { display: grid; gap: 12px; padding: 4px 0; }
.skel { height: 14px; border-radius: 6px; background: var(--surface-2); animation: pulse 1.6s ease-in-out infinite; }
.skel:nth-child(3n+2) { width: 86%; }
.skel:nth-child(3n) { width: 62%; }
.skel-wrap.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.skel-wrap.cards .skel { width: auto; height: 136px; border-radius: var(--r); }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.empty { display: grid; justify-items: center; gap: 8px; padding: 32px 16px; text-align: center; color: var(--text-muted); }
.empty-icon { width: 48px; height: 48px; margin-bottom: 4px; display: grid; place-items: center; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); }
.empty-icon.is-danger { color: var(--danger); }
.empty-title { color: var(--text); font-weight: 500; }
.empty-text { max-width: 360px; font-size: 14px; }
.empty .btn { margin-top: 8px; }

/* ───────────── Модальные окна, уведомления, панели ───────────── */
dialog.modal { width: 520px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0; background: none; color: var(--text); }
dialog.modal-wide { width: 840px; }
dialog.modal::backdrop { background: var(--backdrop); }
.modal-box { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); animation: rise .2s var(--ease) both; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 24px; border-bottom: 1px solid var(--border); }
.modal-title { flex: 1; font: 600 16px/1.4 var(--font-head); }
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 16px 24px; border-top: 1px solid var(--border); }
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 12px; min-width: 240px; max-width: 400px; padding: 12px 16px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface-2); font-size: 14px; animation: rise .2s var(--ease) both; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.toast-ok .i { color: var(--success); }
.toast-error { border-color: rgb(var(--danger-rgb) / .45); }
.toast-error .i { color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(4px); }
.pop { position: fixed; z-index: 120; width: 300px; max-width: calc(100vw - 16px); padding: 8px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r); animation: rise .16s var(--ease) both; }
.pop-title { padding: 8px 8px 4px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.pop-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.pop-row:hover { background: var(--surface-2); }
.pop-row > span:nth-child(2) { flex: 1; }
.pop-row .i { color: var(--text-muted); }
.pop-count { color: var(--accent); font-size: 12px; }
.pop-empty { padding: 16px 8px; text-align: center; font-size: 14px; color: var(--text-muted); }
.pop-user { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.pop-user-name { font-weight: 600; }
.pop-user-mail { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.search-big { height: 48px; font-size: 16px; margin-bottom: 16px; }
.search-res { display: grid; gap: 2px; min-height: 96px; align-content: start; }
.search-group { margin: 12px 0 4px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.search-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.search-item:hover { background: var(--surface-2); }
.search-item .i { color: var(--text-muted); }
.search-item-title { flex: 1; min-width: 0; }
.search-item-sub { font-size: 12px; color: var(--text-muted); }

/* ───────────── Экран входа ───────────── */
.auth { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: var(--bg); overflow: hidden; }
.auth-stars { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auth-center { position: relative; flex: 1; display: grid; place-items: center; padding: 48px 16px 24px; }
.auth-card { width: min(400px, 100%); padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); animation: rise .24s var(--ease) both; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-logo .logo-img { height: 22px; }
.auth-title { font: 600 20px/1.3 var(--font-head); text-align: center; }
.auth-sub { margin: 8px 0 24px; text-align: center; color: var(--text-muted); }
.auth .seg { margin-bottom: 24px; }
.auth-foot { position: relative; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.auth-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 14px; text-decoration: none; }
.auth-link:hover { color: var(--text); }
.forgot-text { text-align: center; }
.lang-btn { height: 32px; min-width: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: none; color: var(--text-muted); font: 400 12px/1 var(--font-mono); letter-spacing: .06em; cursor: pointer; transition: color .15s var(--ease), border-color .15s var(--ease); }
.lang-btn:hover { color: var(--text); border-color: var(--border-2); }
.status-screen { display: grid; justify-items: center; text-align: center; }
.status-icon { width: 56px; height: 56px; margin-bottom: 16px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); }
.status-pending { color: var(--warning); }
.status-rejected, .status-blocked { color: var(--danger); }
.status-who { margin: -8px 0 24px; font-size: 12px; color: var(--text-muted); }
.status-actions { display: grid; gap: 8px; width: 100%; }
.status-actions .btn { width: 100%; }

/* ───────────── Каркас: сайдбар, шапка, основная область ───────────── */
.side { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--side); display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); }
.side-head { height: var(--top); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.side-logo { display: inline-flex; text-decoration: none; }
.side-tag { padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px; font: 400 12px/1.4 var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-muted); font-weight: 500; text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav-label { flex: 1; }
.side-foot { flex: none; display: grid; gap: 12px; padding: 16px; border-top: 1px solid var(--border); }
.side-user { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.side-user:hover { background: var(--surface-2); }
.side-user-text { display: grid; min-width: 0; line-height: 1.4; }
.side-user-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta, .side-user-pay { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-pay.is-success { color: var(--success); }
.side-user-pay.is-warning { color: var(--warning); }
.side-user-pay.is-danger { color: var(--danger); }
.scrim { display: none; }
.shell { min-height: 100vh; margin-left: var(--side); display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 32px; background: var(--bg); border-bottom: 1px solid var(--border); }
.top-logo { text-decoration: none; }
.search { flex: 1; max-width: 440px; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text-muted); transition: border-color .15s var(--ease); }
.search:focus-within { border-color: rgb(var(--accent-rgb) / .6); }
.search-input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font-size: 14px; outline: none; }
.search-input::placeholder { color: var(--placeholder); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell-dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.top-user { padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 14px; }
.banner .i { color: var(--accent); }
.main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px 32px 48px; outline: none; }
.foot { padding: 24px 32px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.bnav { display: none; }

/* ───────────── Страницы и карточки ───────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head-text { min-width: 0; }
.page-title { font: 600 28px/1.2 var(--font-head); letter-spacing: -.01em; }
.page-sub { margin-top: 4px; color: var(--text-muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card { min-width: 0; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-title { flex: 1; min-width: 0; font: 600 16px/1.4 var(--font-head); }
.card-sub { margin-top: 2px; font-size: 14px; color: var(--text-muted); }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-hint { margin: -8px 0 16px; font-size: 12px; color: var(--text-muted); }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.stack-sm { display: grid; gap: 8px; align-content: start; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--text-muted); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--text); }

/* ───────────── Главная ───────────── */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; align-items: start; gap: 16px; }
.dash > .card { grid-column: span 12; }
.dash > .w-board, .dash > .w-news { grid-column: span 8; }
.dash > .w-inbox, .dash > .w-links { grid-column: span 4; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.welcome-main { min-width: 0; max-width: 560px; }
.welcome-title { margin: 4px 0; font: 600 20px/1.3 var(--font-head); }
.stats { display: flex; gap: 32px; flex-wrap: wrap; }
.stat dt { margin-bottom: 8px; font-size: 12px; color: var(--text-muted); }
.stat-num { font: 400 20px/1 var(--font-mono); color: var(--text); text-decoration: none; }
a.stat-num:hover { color: var(--accent); }
.next { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding: 16px; border: 1px solid rgb(var(--accent-rgb) / .3); border-radius: var(--r); background: rgb(var(--accent-rgb) / .05); }
.next-info { min-width: 0; }
.next-title { margin-top: 4px; font: 600 16px/1.4 var(--font-head); }
.next-when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; color: var(--text-muted); }
.next-count { display: grid; justify-items: end; gap: 4px; }
.countdown { font-size: 28px; line-height: 1.1; color: var(--text); }
.next-label { font-size: 12px; color: var(--text-muted); }
.board { display: grid; gap: 8px; }
.board-item { display: flex; align-items: flex-start; gap: 8px; padding: 12px 12px 12px 16px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--c, var(--border-2)); transition: border-color .18s var(--ease); }
.board-item.is-done { opacity: .6; }
.board-item.is-done .board-title { text-decoration: line-through; text-decoration-color: var(--text-muted); }
.board-main { flex: 1; min-width: 0; }
.board-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-title { font: 600 14px/1.5 var(--font-head); }
.board-body { margin-top: 4px; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.board-when { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.row-actions { display: flex; gap: 2px; margin-left: auto; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 12px; }
.notes > .empty { grid-column: 1 / -1; }
.note { display: flex; flex-direction: column; gap: 8px; min-height: 144px; padding: 8px 12px 12px; border: 1px solid var(--border); border-top: 3px solid var(--c); border-radius: var(--r); background: var(--surface-2); background: color-mix(in srgb, var(--c) 6%, var(--surface-2)); transition: border-color .18s var(--ease); }
.note-top { display: flex; align-items: center; justify-content: space-between; margin: 0 -4px; }
.note-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s var(--ease); }
.note:hover .note-actions, .note:focus-within .note-actions { opacity: 1; }
.note-body { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-date { font-size: 12px; color: var(--text-muted); }
.inbox { display: grid; gap: 2px; }
.list-label { margin: 8px 0 4px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.list-label:first-child { margin-top: 0; }
.inbox-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.inbox-row:hover { background: var(--surface-2); }
.inbox-text { flex: 1; min-width: 0; display: grid; }
.inbox-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-snippet { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-time { font-size: 12px; color: var(--text-muted); }
.qlinks { display: grid; gap: 2px; }
.qlink { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; }
.qlink:hover { background: var(--surface-2); }
.qlink-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--accent); }
.qlink-label { flex: 1; }
.qlink > .i:last-child { color: var(--text-muted); }

/* ───────────── Новости ───────────── */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(304px, 1fr)); gap: 16px; }
.news-grid > .empty { grid-column: 1 / -1; }
.news-card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: inherit; text-decoration: none; transition: border-color .18s var(--ease); }
.news-card:hover { border-color: var(--border-2); }
.news-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.news-card-body { display: grid; gap: 8px; padding: 16px 24px 24px; }
.news-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.meta-pin { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); }
.news-title { font: 600 16px/1.4 var(--font-head); }
.news-summary { color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-mini { display: grid; gap: 4px; }
.news-card.is-compact { border-color: transparent; border-radius: var(--r-sm); background: none; }
.news-card.is-compact:hover { background: var(--surface-2); }
.news-card.is-compact .news-card-body { gap: 4px; padding: 12px 8px; }
.news-card.is-compact .news-summary { -webkit-line-clamp: 2; }
.article { max-width: 760px; }
.article-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); }
.article-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.article-title { margin: 12px 0; font: 600 28px/1.25 var(--font-head); letter-spacing: -.01em; }
.article-lead { margin-bottom: 24px; font-size: 16px; color: var(--text-muted); }
.article-admin { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.prose { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 12px; }
.prose h3 { margin-top: 24px; font: 600 20px/1.3 var(--font-head); }
.prose h4 { margin-top: 16px; font: 600 16px/1.4 var(--font-head); }
.prose ul, .prose ol { padding-left: 24px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 4px; }
.prose li::marker { color: var(--text-muted); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }
.prose blockquote { padding-left: 16px; border-left: 2px solid var(--accent); color: var(--text-muted); }
.prose strong, .prose b { font-weight: 600; }

/* ───────────── Материалы и мероприятия ───────────── */
.mat-items { display: grid; gap: 8px; }
.mat { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.mat-sum { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.mat-sum::-webkit-details-marker { display: none; }
.mat-title { flex: 1; min-width: 0; font-weight: 500; }
.mat-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mat-sum > .i:last-child { color: var(--text-muted); transition: transform .18s var(--ease); }
.mat[open] .mat-sum > .i:last-child { transform: rotate(180deg); }
.mat-body { display: grid; gap: 16px; justify-items: start; padding: 0 16px 16px; }
.mat-body .prose { font-size: 14px; }
.events { display: grid; gap: 4px; }
.events.is-past { opacity: .7; }
.event { display: flex; gap: 16px; padding: 12px; border-radius: var(--r-sm); }
.event:hover { background: var(--surface-2); }
.event-date { flex: none; width: 56px; display: grid; justify-items: center; align-content: center; padding: 8px 0; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); }
.event-day { font-size: 20px; line-height: 1; }
.event-mon { margin-top: 4px; font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.event-main { min-width: 0; }
.event-title { font: 600 16px/1.4 var(--font-head); }
.event-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; color: var(--text-muted); }
.event-desc { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ───────────── Чат и личные сообщения ───────────── */
.card.chat { display: flex; flex-direction: column; height: calc(100dvh - 340px); min-height: 420px; padding: 0; overflow: hidden; }
.stream-box { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.stream-older { display: flex; margin: 8px auto; }
.stream { display: flex; flex-direction: column; }
.stream > .empty { margin: auto; }
.msg { position: relative; display: flex; gap: 12px; padding: 8px 12px; border-radius: var(--r-sm); }
.msg:hover { background: var(--surface-2); }
.msg.is-mention { background: rgb(var(--accent-rgb) / .06); box-shadow: inset 2px 0 0 var(--accent); }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-name { padding: 0; border: 0; background: none; color: var(--text); font: 600 14px/1.5 var(--font-ui); }
button.msg-name { cursor: pointer; }
button.msg-name:hover { color: var(--accent); }
.msg.is-mine .msg-name { color: var(--accent); }
.msg-time { font-size: 12px; color: var(--text-muted); }
.msg-text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-actions { position: absolute; top: 4px; right: 8px; display: flex; gap: 2px; border-radius: 8px; background: var(--surface-2); opacity: 0; transition: opacity .15s var(--ease); }
.msg-actions:empty { display: none; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-actions .icon-btn { width: 28px; height: 28px; }
.composer-wrap { padding: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.composer { display: flex; align-items: flex-end; gap: 8px; }
.composer-input { height: 40px; min-height: 40px; max-height: 160px; padding: 9px 12px; resize: none; }
.composer-side { display: flex; align-items: center; gap: 8px; }
.counter { font-size: 12px; color: var(--text-muted); }
.send-btn { width: 40px; padding: 0; }
.composer-note { margin-bottom: 8px; font-size: 12px; color: var(--text-muted); }
.composer-wrap.is-off .composer { opacity: .5; }
.read-mark { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 16px 8px; font-size: 12px; color: var(--text-muted); }
.dm { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; height: calc(100dvh - 160px); min-height: 480px; }
.dm-side { display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow: hidden; }
.dm-side .input-search { max-width: none; }
.dm-side-head { display: flex; align-items: center; justify-content: space-between; }
.dm-title { font: 600 20px/1.3 var(--font-head); }
.convs { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; margin: 0 -8px; }
.conv { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.conv:hover, .conv.active { background: var(--surface-2); }
.conv.active { box-shadow: inset 2px 0 0 var(--accent); }
.conv.is-inactive { opacity: .6; }
.conv-text { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { flex: none; font-size: 12px; color: var(--text-muted); }
.conv-last { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.is-unread .conv-name { font-weight: 600; }
.conv.is-unread .conv-last { color: var(--text); }
.dm-privacy { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.dm-privacy .i { margin-top: 2px; }
.card.dm-pane { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.dm-pane > .empty, .dm-pane > .skel-wrap { margin: auto; width: 100%; max-width: 420px; padding: 24px; }
.conv-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dm-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dm-head-text { flex: 1; min-width: 0; }
.dm-head-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-head-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-head-actions { display: flex; align-items: center; gap: 4px; }
.dm-back { display: none; }
.pick-list { display: grid; gap: 2px; max-height: 50vh; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); text-align: left; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick-text { display: grid; }
.pick-name { font-weight: 500; }
.pick-sub { font-size: 12px; color: var(--text-muted); }

/* ───────────── Участники и профиль ───────────── */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.members > .empty { grid-column: 1 / -1; }
.member { display: flex; flex-direction: column; gap: 16px; }
.member-top { display: flex; align-items: center; gap: 12px; }
.member-id { min-width: 0; }
.member-name { font: 600 16px/1.4 var(--font-head); }
.member-company { font-size: 14px; color: var(--text-muted); }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.member-about { flex: 1; font-size: 14px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.member-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.profile-card { display: grid; gap: 16px; }
.profile-top { display: flex; align-items: center; gap: 16px; }
.profile-name { font: 600 20px/1.3 var(--font-head); }
.profile-about { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kvs { display: grid; gap: 12px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.kv dt { font-size: 14px; color: var(--text-muted); }
.kv dd { text-align: right; overflow-wrap: anywhere; }
.kv-row { display: flex; align-items: center; gap: 12px; padding: 4px 0; }

/* ───────────── Поддержка ───────────── */
.contact { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.contact-icon { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgb(var(--accent-rgb) / .3); border-radius: var(--r); background: var(--accent-soft); color: var(--accent); }
.faqs { display: grid; gap: 8px; }
details.faq { border: 1px solid var(--border); border-radius: var(--r-sm); }
details.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; font-weight: 500; cursor: pointer; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .i { color: var(--text-muted); transition: transform .18s var(--ease); }
details.faq[open] summary .i { transform: rotate(180deg); }
details.faq p { padding: 0 16px 16px; color: var(--text-muted); white-space: pre-wrap; }
.ticket { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r); }
.ticket.card { padding: 24px; }
.ticket-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ticket-subj { flex: 1; min-width: 200px; font: 600 16px/1.4 var(--font-head); }
.ticket-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-answer { display: grid; gap: 4px; padding: 12px 16px; border-left: 2px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); }
.ticket-answer p:last-child { white-space: pre-wrap; }

/* ───────────── Админ-панель ───────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-muted); font-weight: 500; white-space: nowrap; text-decoration: none; }
.tab:hover { background: var(--surface); color: var(--text); }
.tab.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.req { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 24px; }
.req-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.req-name { font-weight: 600; }
.req-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); }
.req-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.table-wrap > .empty, .table-wrap > .skel-wrap { padding: 24px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-past { opacity: .6; }
.table-log td { vertical-align: top; }
.cell-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-name { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; font-weight: 500; }
.cell-name .nm { white-space: normal; overflow-wrap: anywhere; }
.cell-name > :not(.nm) { flex: none; }
.cell-sub { font-size: 12px; color: var(--text-muted); }
.cell-actions { text-align: right; white-space: nowrap; }
.quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw-code { display: block; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); font-size: 20px; letter-spacing: .06em; user-select: all; overflow-wrap: anywhere; }
.wlist { display: grid; gap: 8px; }
.wrow { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.cover-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cover-prev { width: 240px; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; padding: 8px; border: 1px dashed var(--border-2); border-radius: var(--r-sm); background: var(--bg); text-align: center; }
.cover-prev:has(img) { padding: 0; border-style: solid; }
.cover-prev img { width: 100%; height: 100%; object-fit: cover; }
.cover-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.rte { overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); transition: border-color .15s var(--ease); }
.rte:focus-within { border-color: rgb(var(--accent-rgb) / .6); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rte-btn { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--text-muted); cursor: pointer; }
.rte-btn:hover { background: var(--surface); color: var(--text); }
.rte-area { min-height: 224px; max-height: 50vh; overflow-y: auto; padding: 12px 16px; outline: none; }
.level-edit { display: grid; gap: 12px; padding: 12px 16px 16px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.level-edit legend { padding: 0 8px; font: 400 12px/1 var(--font-mono); color: var(--accent); }
.faq-edit { display: flex; align-items: flex-start; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.adm-sec .card-head { flex-wrap: wrap; }
.adm-items { display: grid; gap: 8px; }
.adm-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.adm-item { min-width: 0; }
.adm-item-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep { display: grid; gap: 12px; }
.rep.is-done { opacity: .7; }
.rep-head, .rep-author { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-body { padding: 12px 16px; border-left: 2px solid var(--danger); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* ───────────── Этап A: роли, метки, помощь, переписка, управление аккаунтами ───────────── */
.req-star { color: var(--accent); font-weight: 600; }
.req-note { margin-bottom: -4px; }
.form-meta { display: flex; justify-content: flex-end; margin-top: -8px; }
.center-block { margin: 0 auto 16px; }
[aria-invalid="true"] { border-color: rgb(var(--danger-rgb) / .7) !important; }
/* Системный значок роли (щит) — его нельзя повторить меткой */
.sys-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid rgb(var(--accent-rgb) / .45);
  background: rgb(var(--accent-rgb) / .12); color: var(--accent); font: 600 12px/1 var(--font-ui); white-space: nowrap; vertical-align: middle; }
.sys-badge .i { flex: none; }
/* Президент — сплошное золото, администратор — плотная золотая обводка: так значки не спутать с метками (у меток прозрачная заливка и нет щита) */
.sys-president { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.sys-admin { border-color: var(--accent); background: rgb(var(--accent-rgb) / .2); }
.sys-moderator { border-color: rgb(var(--silver-rgb) / .4); background: rgb(var(--silver-rgb) / .08); color: var(--silver); }
.sys-badge.is-compact { width: 20px; height: 20px; padding: 0; justify-content: center; }
.lbl { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2);
  color: var(--text-muted); font: 500 12px/1 var(--font-ui); white-space: nowrap; vertical-align: middle; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.msg-head .lbl, .msg-head .sys-badge { height: 20px; }
.conv-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.dm-head-name { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; overflow: hidden; }
/* Имя сокращается многоточием, значок роли и метки остаются на той же строке и не съезжают вниз */
.nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-name > :not(.nm), .dm-head-name > :not(.nm) { flex: none; }
.dm-head-name .sys-badge.is-compact { width: 18px; height: 18px; }
.profile-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cell-name .sys-badge.is-compact { width: 18px; height: 18px; }
.welcome-chips { margin-top: 12px; }
.pop-user-role { margin: 4px 0; }
.kv-note { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Экран входа: «← На сайт», помощь, 2FA */
.auth-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-muted); font-size: 14px; text-decoration: none; background: rgba(18, 20, 26, .6); transition: color .15s var(--ease), border-color .15s var(--ease); }
.auth-back:hover { color: var(--text); border-color: var(--border-2); }
.auth-card.is-wide { width: min(560px, 100%); }
.auth-help { display: flex; justify-content: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.auth-help .btn-link, .forgot-text .btn-link { font-size: 14px; }
.forgot-text { display: grid; gap: 8px; justify-items: center; text-align: center; }
.auth-foot { color: var(--text-muted); font-size: 12px; }
.totp-setup { display: grid; gap: 8px; padding: 16px; border: 1px solid rgb(var(--accent-rgb) / .35); border-radius: var(--r); background: rgb(var(--accent-rgb) / .05); }
.totp-t { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.totp-key { padding: 12px; border: 1px dashed var(--accent-line); border-radius: var(--r-sm); background: var(--bg); font-size: 16px; letter-spacing: .08em; text-align: center; user-select: all; overflow-wrap: anywhere; }
.cap { padding: 12px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface-2); }
.cap-input { max-width: 120px; text-align: center; font-size: 18px; }

/* Переписка заявителя с администрацией */
.thread-card { width: 100%; margin: 8px 0 24px; text-align: left; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.thread-title { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font: 600 14px/1.4 var(--font-head); }
.thread-title .i { color: var(--accent); }
.thread { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; padding: 12px 16px; }
.thread.is-admin-view { max-height: 360px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); }
.tmsg { max-width: 88%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.tmsg.is-mine { justify-self: end; border-color: rgb(var(--accent-rgb) / .3); background: rgb(var(--accent-rgb) / .06); }
.tmsg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-muted); }
.tmsg-head b { color: var(--text); font-weight: 600; }
.tmsg-text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.thread-card .composer-wrap { border-top: 1px solid var(--border); background: var(--surface); }
.status-screen .thread-card + .status-actions { margin-top: 0; }

/* Каркас: «← На сайт» в сайдбаре и верхней панели */
.side-site { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--text-muted); font-size: 14px; text-decoration: none; }
.side-site:hover { background: var(--surface-2); color: var(--text); }
.side-foot .side-tg { height: auto; min-height: 40px; padding: 8px 12px; white-space: normal; line-height: 1.25; text-align: center; }
.top-site { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text-muted); font-size: 14px; text-decoration: none; white-space: nowrap; flex: none; }
.top-site:hover { color: var(--text); border-color: var(--border-2); }
.warn-item { padding: 12px 16px; border-left: 2px solid var(--warning); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); }
.warn-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Карточка «Президент клуба» */
.dash > .w-head { grid-column: span 4; }
.head { display: grid; gap: 16px; }
.head-top { display: flex; align-items: center; gap: 16px; }
.head-id { min-width: 0; }
.head-name { font: 600 18px/1.3 var(--font-head); }
.head-role { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--accent); font-size: 14px; }
.head-rows { display: grid; gap: 4px; }
.head-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.head-row:hover { background: var(--surface-2); }
.head-row .i { color: var(--text-muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Сеансы */
.sess { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.sess.is-current { border-color: rgb(var(--accent-rgb) / .35); }
.sess-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); color: var(--text-muted); background: var(--bg); flex: none; }
.sess-dev { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }

/* Админ-панель: список, массовые действия, карточка */
.cb { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.cell-cb { width: 40px; text-align: center; }
.cell-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cell-chips:empty { display: none; }
.table tr.is-flag td:first-child { box-shadow: inset 2px 0 0 var(--warning); }
.mass { position: sticky; top: calc(var(--top) + 8px); z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px;
  border: 1px solid rgb(var(--accent-rgb) / .4); border-radius: var(--r); background: var(--surface); }
.mass-n { color: var(--accent); font-size: 14px; }
.mass-grp { display: inline-flex; align-items: center; gap: 6px; }
.mass .input { width: auto; height: 32px; }
.mass-days { width: 80px !important; }
.card-user { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.card-user-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.card-pane { min-height: 160px; }
.seg-scroll { width: 100%; }
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface-2); font-size: 14px; color: var(--text-muted); }
.notice .i { flex: none; color: var(--text-muted); }
.notice-warn { border-color: rgb(var(--warning-rgb) / .4); color: var(--text); }
.notice-warn .i { color: var(--warning); }
.notice-danger { border-color: rgb(var(--danger-rgb) / .4); color: var(--text); }
.notice-danger .i { color: var(--danger); }
.warn-row { display: grid; gap: 4px; justify-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.label-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.label-opt { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; }
.label-row { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.label-prev { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-3); }
.is-ok { color: var(--success) !important; }
.is-bad { color: var(--danger) !important; }
.field-end { align-content: end; }
.appeal { display: grid; gap: 8px; }
.appeal.is-done { opacity: .7; }
.appeal-last { padding: 8px 12px; border-left: 2px solid var(--border-2); color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Права участника: строки «право — настройка — итог» */
.perm-list { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.perm-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) 120px; align-items: center; gap: 8px 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 14px; }
.perm-row:first-child { border-top: 0; }
.perm-head { padding-block: 12px; font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.perm-row .input { height: 36px; }
.perm-eff { justify-self: start; }
.table-matrix th, .table-matrix td { padding: 8px 10px; }
.table-matrix tbody th, .table-matrix thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.table-matrix tbody tr:hover th { background: var(--surface-2); }
.table-matrix thead th { font-size: 11px; letter-spacing: .02em; text-transform: none; white-space: normal; min-width: 72px; }
.table-matrix tbody th { text-align: left; font-size: 14px; font-weight: 500; color: var(--text); text-transform: none; letter-spacing: 0; white-space: nowrap; }

/* ───────────── Этап B: мессенджер, вложения, голосовые ───────────── */
.dm-side-actions { display: flex; align-items: center; gap: 4px; }
.convs .list-label { margin: 8px 8px 2px; }
.conv-none { padding: 8px; }
.avatar-level { font: 600 12px/1 var(--font-mono); letter-spacing: 0; }
.conv-muted { flex: none; display: inline-flex; color: var(--text-muted); }
.count.is-quiet { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border-2); }
.count-at { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.mx-stream { gap: 2px; padding: 4px 4px 8px; }
.mx-msg { position: relative; display: flex; align-items: flex-end; gap: 8px; max-width: 100%; padding: 2px 4px; border-radius: var(--r-sm); }
.mx-msg.is-mine { flex-direction: row-reverse; }
.mx-msg.is-flash .mx-bubble { box-shadow: 0 0 0 2px var(--accent); }
.mx-bubble { position: relative; max-width: min(560px, 82%); min-width: 0; padding: 8px 12px 6px; border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; background: var(--surface-2); }
.mx-msg.is-mine .mx-bubble { border-radius: 14px 14px 4px 14px; border-color: rgb(var(--accent-rgb) / .28); background: rgb(var(--accent-rgb) / .08); }
.mx-msg.is-mention .mx-bubble { box-shadow: inset 2px 0 0 var(--accent); }
.mx-msg.is-del .mx-bubble { background: transparent; border-style: dashed; }
.mx-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; min-width: 0; }
.mx-head .msg-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mx-head .msg-name:hover { color: var(--accent); }
.mx-head > :not(.msg-name) { flex: none; }
.mx-head .lbl { height: 18px; font-size: 11px; }
.mx-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.mx-text.is-deleted { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-style: italic; font-size: 14px; }
.mx-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.mention { color: var(--accent); font-weight: 500; }
.mention.is-me { padding: 0 3px; border-radius: 4px; background: var(--accent-soft); }
.mx-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.mx-meta .msg-time { font-size: 11px; }
.mx-ed { font-style: italic; }
.mx-tick { display: inline-flex; color: var(--text-muted); }
.mx-tick.is-read { color: var(--accent); }
.mx-quote { display: grid; gap: 1px; width: 100%; margin-bottom: 6px; padding: 4px 8px; border: 0; border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0; background: var(--hover); color: var(--text); text-align: left; cursor: pointer; font-size: 13px; }
.mx-quote-name { color: var(--accent); font-weight: 600; font-size: 12px; }
.mx-quote-text { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mx-rx-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid var(--border-2); border-radius: 999px; background: var(--bg); color: var(--text-muted); font-size: 12px; cursor: pointer; }
.mx-rx-chip.is-me { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.mx-more { flex: none; width: 28px; height: 28px; align-self: center; opacity: 0; transition: opacity .15s var(--ease); }
.mx-msg:hover .mx-more, .mx-msg:focus-within .mx-more { opacity: 1; }
.mx-menu { display: grid; gap: 2px; }
.mx-rx-pick { display: flex; justify-content: space-between; gap: 2px; padding: 2px 2px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.mx-rx-pick .icon-btn.is-on { color: var(--accent); background: var(--accent-soft); }
.pop-row.is-danger, .pop-row.is-danger .i { color: var(--danger); }
.mx-sys { display: flex; justify-content: center; padding: 6px 0; }
.mx-sys span { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); font-size: 12px; text-align: center; }
.mx-new { display: flex; align-items: center; gap: 12px; margin: 8px 0; color: var(--accent); font-size: 12px; }
.mx-new::before, .mx-new::after { content: ''; flex: 1; height: 1px; background: var(--accent-line); }
.mx-pinbar { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 16px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font-size: 13px; }
.mx-pinbar .i { color: var(--accent); flex: none; }
.mx-pin-label { flex: none; color: var(--accent); font-weight: 600; }
.mx-pin-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.stream-box.is-drop { outline: 2px dashed var(--accent-line); outline-offset: -8px; }
/* Вложения в сообщении */
.mx-files { display: grid; gap: 6px; margin: 2px 0 4px; }
.mx-imgs { display: grid; gap: 4px; }
.mx-imgs.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mx-img { display: block; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--bg); cursor: zoom-in; }
.mx-img img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: cover; }
.mx-video { display: block; width: 100%; max-width: 480px; max-height: 360px; border-radius: 10px; background: #000; }
.mx-doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--bg); color: var(--text); text-decoration: none; }
.mx-doc:hover { border-color: var(--accent-line); }
.mx-doc-ic { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--accent); }
.mx-doc-text { flex: 1; min-width: 0; display: grid; }
.mx-doc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mx-doc-size { font-size: 11px; color: var(--text-muted); }
.mx-doc > .i { color: var(--text-muted); flex: none; }
.vp { display: flex; align-items: center; gap: 8px; min-width: 220px; max-width: 360px; }
.vp audio { display: none; }
.vp-play { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.vp-bar { flex: 1; min-width: 60px; accent-color: var(--accent); }
.vp-time { flex: none; font-size: 11px; color: var(--text-muted); min-width: 34px; }
.vp-speed { flex: none; height: 24px; padding: 0 6px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 11px; cursor: pointer; }
.lb { display: grid; place-items: center; }
.lb-img { max-width: 100%; max-height: 72vh; border-radius: 8px; }
/* Поле ввода: ответ, вложения, запись голоса */
.mx-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 6px 6px 10px; border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--surface-2); font-size: 13px; }
.mx-bar > .i { color: var(--accent); flex: none; }
.mx-bar-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.mx-bar-text b { color: var(--text); font-weight: 600; }
.mx-bar .icon-btn { width: 28px; height: 28px; }
.mx-atts { display: grid; gap: 6px; margin-bottom: 8px; }
.mx-att { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.mx-att > .i { color: var(--text-muted); flex: none; }
.mx-att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-att-size { flex: none; font-size: 11px; color: var(--text-muted); }
.mx-att-prog { flex: none; width: 64px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.mx-att-bar { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s var(--ease); }
.mx-att.is-done .mx-att-bar { background: var(--success); }
.mx-att.is-err { border-color: rgb(var(--danger-rgb) / .5); }
.mx-att.is-err .mx-att-bar { background: var(--danger); width: 100%; }
.mx-att .icon-btn { width: 28px; height: 28px; }
.mx-attach { flex: none; width: 40px; height: 40px; }
.mx-rec { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
.mx-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s steps(2, start) infinite; }
.mx-rec-time { color: var(--text-muted); font-size: 12px; }
.mx-rec .vp { flex: 1; max-width: none; }
@keyframes blink { to { visibility: hidden; } }
.gm-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.gm-row .icon-btn { width: 32px; height: 32px; }
.pick .cb { pointer-events: none; }
.pick.is-on { background: var(--accent-soft); }
.fs-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.fs-bar { display: block; height: 100%; background: var(--accent); }
.fs-bar.is-warn { background: var(--danger); }
@media (hover: none) { .mx-more { display: none; } }
@media (max-width: 640px) {
  .mx-bubble { max-width: 86%; }
  .mx-msg > .avatar { display: none; }
  .vp { min-width: 0; }
  .composer .mx-attach { width: 36px; }
}

/* ───────────── Этап C: доски объявлений, уведомления, полноэкранная переписка ───────────── */
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.pop { overflow-y: auto; }
.pop.is-sheet { left: 8px; right: 8px; width: auto; max-width: none; border-radius: var(--r-lg); }
.pop.is-sheet .mx-rx-pick { justify-content: space-between; }
.toast-msg { cursor: pointer; }
.toast-msg span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mx-ask { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 8px; padding: 12px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; color: var(--text); }
.mx-ask > .i { color: var(--accent); }
.mx-ask > span { flex: 1 1 160px; min-width: 0; }
.mx-ask-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.mx-ad { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 6px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: rgb(var(--accent-rgb) / .06); color: var(--text); font-size: 13px; text-decoration: none; }
.mx-ad .i { flex: none; margin-top: 2px; color: var(--accent); }
a.mx-ad:hover { border-color: var(--accent); }
.mx-adbar .i { color: var(--accent); }

.ad-warn { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-sm); background: var(--surface); color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.ad-warn .i { flex: none; margin-top: 2px; color: var(--accent); }
.ad-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ad-bar > .select { width: auto; min-width: 200px; }
.ad-tabs { flex: 0 1 auto; width: auto; }
.lbl-short { display: none; }
.ad-card { -webkit-tap-highlight-color: transparent; }
.ad-fbtn { display: none; }
.ad-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ad-filters > .input-search { flex: 1 1 240px; max-width: none; }
.ad-filters > .select { width: auto; min-width: 150px; flex: 0 1 auto; }
.ad-prange { display: flex; align-items: center; gap: 6px; }
.ad-pin { width: 110px; }
.ad-cur { width: 64px; padding-right: 24px; }
.ads { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ad-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: inherit; text-decoration: none; transition: border-color .18s var(--ease); }
.ad-card:hover { border-color: var(--border-2); }
.ad-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ad-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow: hidden; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-thumb.is-sm { flex: none; width: 96px; aspect-ratio: 1; border: 1px solid var(--border); border-radius: var(--r-sm); }
.ad-noimg { color: var(--text-muted); opacity: .6; }
.ad-thumb-n { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(11, 12, 15, .7); color: #fff; font-size: 12px; }
.ad-card-body { display: grid; gap: 6px; padding: 14px 16px 16px; min-width: 0; }
.ad-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ad-price { font: 700 17px/1.3 var(--font-head); color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-title { font: 600 15px/1.35 var(--font-head); color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ad-text { font-size: 13px; line-height: 1.5; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ad-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text-muted); }
.ad-meta > span + span::before { content: '·'; margin-right: 10px; opacity: .6; }
.ad-by { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 4px; font-size: 13px; color: var(--text); }
.ad-by .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-more { display: flex; justify-content: center; margin-top: 16px; }
.ad-more .btn[hidden] { display: none; }

.ad-view { display: grid; gap: 16px; }
.ad-view-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ad-view-grid > .ad-view-main:only-child { grid-column: 1 / -1; }
.ad-view-main { display: grid; gap: 10px; min-width: 0; }
.ad-view-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-view-title { margin: 0; font: 600 20px/1.3 var(--font-head); overflow-wrap: anywhere; }
.ad-view-price { margin: 0; font: 700 22px/1.2 var(--font-head); color: var(--accent); }
.ad-view-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.ad-author { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.ad-author .grow { min-width: 0; }
.ad-gallery { display: grid; gap: 8px; min-width: 0; }
.ad-big-btn { display: block; padding: 0; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); overflow: hidden; cursor: zoom-in; }
.ad-big { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.ad-thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.ad-tb { flex: none; width: 64px; height: 64px; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); cursor: pointer; opacity: .7; }
.ad-tb.is-on { border-color: var(--accent); opacity: 1; }
.ad-tb img { width: 100%; height: 100%; object-fit: cover; }
.ad-notice { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface-2); font-size: 13px; line-height: 1.5; }
.ad-notice .i { flex: none; margin-top: 2px; }
.ad-notice.is-warn .i { color: var(--warning, #D9B45A); }
.ad-notice.is-danger .i { color: var(--danger); }
.ad-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; width: 100%; }
.ad-mod { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.ad-mod .list-label { display: flex; align-items: center; gap: 6px; }
.ad-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-ph, .ad-ph-add { position: relative; width: 96px; height: 96px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.ad-ph img { width: 100%; height: 100%; object-fit: cover; }
.ad-ph.is-up, .ad-ph.is-err { display: grid; place-items: center; }
.ad-ph.is-err { border-color: var(--danger); color: var(--danger); }
.ad-ph-pct { font-size: 13px; color: var(--text-muted); }
.ad-ph-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; background: rgba(11, 12, 15, .7); color: #fff; }
.ad-ph-add { display: grid; place-content: center; justify-items: center; gap: 4px; padding: 6px; border-style: dashed; color: var(--text-muted); font: 500 12px/1.2 var(--font-ui); text-align: center; cursor: pointer; }
.ad-ph-add:hover { border-color: var(--accent); color: var(--text); }
.ad-price-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 12px; align-items: end; }
.ad-neg { padding-bottom: 8px; }
.field-count { justify-self: end; font-size: 12px; }
.cols-side { grid-template-columns: minmax(0, 1fr) 340px; }
.aad-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; margin-bottom: 12px; }
.aad-main .grow { min-width: 0; display: grid; gap: 6px; }
.aad-title { margin: 0; font: 600 15px/1.35 var(--font-head); overflow-wrap: anywhere; }
.aad-text { margin: 0; font-size: 13px; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.aad-by { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 0; font-size: 13px; }
.aad-cat { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 14px; }
.aad-cat.is-off { opacity: .6; }
.aad-lvl { width: auto; min-width: 180px; flex: 0 1 auto; }
.toolbar > .input-search + .aad-lvl { margin-left: 0; }
.fs-push { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; color: var(--text-muted); }
.fs-push .i { flex: none; margin-top: 2px; color: var(--accent); }
.fs-push.is-warn .i { color: var(--warning); }

/* Телефон: открытая переписка — на весь экран между верхней панелью и нижним меню; с клавиатурой — до её края. */
@media (max-width: 960px) {
  body.mx-full { overflow: hidden; }
  body.mx-full .banner, body.mx-full .foot { display: none; }
  body.mx-full .main-messages { padding: 0; }
  body.mx-full .dm { position: fixed; left: 0; right: 0; top: var(--top); bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 25; height: auto; min-height: 0; gap: 0; }
  body.mx-full .card.dm-pane { border: 0; border-radius: 0; }
  body.mx-full .composer-wrap { padding-bottom: 8px; }
  body.mx-full.kb-open .bnav { display: none; }
  body.mx-full.kb-open .dm { top: calc(var(--vvt, 0px) + var(--top)); bottom: auto; height: calc(var(--vvh, 100dvh) - var(--top)); }
  .cols-side { grid-template-columns: minmax(0, 1fr); }
  .ad-view-grid { grid-template-columns: minmax(0, 1fr); }
  .dm:not(.has-conv) { height: auto; min-height: 0; } /* список чатов на телефоне — обычной прокруткой страницы */
  .bnav-item > span:not(.badge) { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 380px) {
  .bnav .bnav-item { font-size: 10.5px; gap: 3px; letter-spacing: -.02em; }
  .bnav .bnav-item > span:not(.badge) { padding: 0; }
}
@media (max-width: 640px) {
  .ads { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ad-card { flex-direction: row; }
  .ad-thumb { flex: none; width: 112px; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--border); }
  .ad-card-body { padding: 12px; gap: 4px; }
  .ad-price { font-size: 15px; }
  .ad-title { font-size: 14px; }
  .ad-text { display: none; }
  .ad-by { display: none; }
  .ad-bar { gap: 8px; }
  .ad-tabs { flex: 1 1 100%; width: 100%; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
  .ad-bar > .select { flex: 1 1 auto; min-width: 0; }
  .ad-fbtn { display: inline-flex; }
  .ad-filters { display: none; }
  .ad-filters.is-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ad-filters.is-open > .input-search, .ad-filters.is-open > .ad-prange { grid-column: 1 / -1; }
  .ad-filters > .select { min-width: 0; width: 100%; }
  .ad-prange .ad-pin { flex: 1; width: auto; min-width: 0; }
  .ad-price-row { grid-template-columns: minmax(0, 1fr) 100px; }
  .ad-price-row > .ad-neg { grid-column: 1 / -1; padding: 0; }
  .ad-foot > .btn { flex: 1 1 auto; }
  .aad-main { gap: 12px; }
  .ad-thumb.is-sm { width: 64px; }
  .ad-ph, .ad-ph-add { width: 84px; height: 84px; }
}

/* ───────────── Адаптив ───────────── */
@media (max-width: 1100px) {
  .dash > .w-board, .dash > .w-news { grid-column: span 12; }
  .dash > .w-head { grid-column: span 6; }
  .dash > .w-inbox, .dash > .w-links { grid-column: span 6; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .side { width: 288px; transform: translateX(-100%); transition: transform .22s var(--ease); }
  body.drawer-open { overflow: hidden; }
  body.drawer-open .side { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
  body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .shell { margin-left: 0; padding-bottom: 64px; }
  .top { padding: 0 8px 0 4px; }
  .search { display: none; }
  .only-mobile { display: inline-grid !important; }
  a.only-mobile { display: inline-flex !important; }
  .main { padding: 24px 16px 32px; }
  .banner { padding: 12px 16px; }
  .foot { padding: 16px; }
  .page-title { font-size: 20px; }
  .bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: 64px; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); }
  .bnav-item { position: relative; flex: 1; display: grid; justify-items: center; align-content: center; gap: 4px; border: 0; background: none; color: var(--text-muted); font: 500 12px/1 var(--font-ui); text-decoration: none; cursor: pointer; }
  .bnav-item.active { color: var(--accent); }
  .bnav-item .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; line-height: 18px; }
  .toasts { left: 16px; right: 16px; bottom: 80px; }
  .toast { max-width: none; }
  .counter { display: none; }
  .dm { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 200px); min-height: 400px; }
  .dm.has-conv .dm-side { display: none; }
  .dm:not(.has-conv) .dm-pane { display: none; }
  .dm-back { display: inline-grid; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .top-site { width: 36px; padding: 0; justify-content: center; }
  .top-site span { display: none; }
  .mass { top: calc(var(--top) + 4px); }
  .card.chat { height: calc(100dvh - 360px); min-height: 360px; }
  .note-actions, .msg-actions { opacity: 1; }
  .msg-actions { position: static; background: none; }
  .card { padding: 16px; }
  .next-count { justify-items: start; }
}
@media (max-width: 640px) {
  .dash > .card { grid-column: span 12 !important; }
  .auth-top { padding: 12px 16px; }
  .tmsg { max-width: 100%; }
  .card-user { align-items: flex-start; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats { gap: 24px; }
  .input-search { max-width: none; }
  .toolbar > .input-search { flex: 1 1 100%; }
  .auth-card { padding: 24px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }
  .cover-prev { width: 100%; }
  .req { padding: 16px; }
  .dm-head { padding: 8px 8px 8px 4px; gap: 8px; }
  .dm-head-actions .btn { width: 36px; padding: 0; }
  .dm-head-actions .btn span { display: none; }
  /* Фильтры участников — сетка в две колонки */
  .toolbar.wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: end; }
  .toolbar.wrap > .input-search, .toolbar.wrap > .switch { grid-column: 1 / -1; }
  .toolbar.wrap > .grow { display: none; }
  .mini-field { display: grid; gap: 4px; min-width: 0; }
  .mini-field .input { width: 100%; min-width: 0; }
  /* Права: название и итог сверху, выбор снизу */
  .perm-head { display: none; }
  .perm-head + .perm-row { border-top: 0; }
  .perm-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
  .perm-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .perm-eff { justify-self: end; }
  .table-matrix tbody th { white-space: normal; min-width: 132px; max-width: 160px; }
  /* Таблицы админ-панели — карточками: главное поле сверху, остальные строками «подпись — значение» */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody { display: block; width: 100%; }
  .table-cards tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .table-cards td { display: block; min-width: 0; padding: 0; border: 0; }
  .table-cards td.cell-cb { grid-column: 1; grid-row: 1; width: auto; text-align: left; }
  .table-cards td.cell-main { grid-column: 1 / 3; grid-row: 1; }
  .table-cards tr:has(> .cell-cb) td.cell-main { grid-column: 2; }
  .table-cards td.cell-actions { grid-column: 3; grid-row: 1; display: flex; justify-content: flex-end; gap: 4px; }
  .table-cards td[data-l] { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
  .table-cards tr:has(> .cell-cb) td[data-l] { grid-column: 2 / -1; }
  .table-cards td[data-l]::before { content: attr(data-l); flex: none; color: var(--text-muted); font: 400 12px/1.4 var(--font-ui); }
  .table-cards .cell-actions .btn span { display: none; }
  .table-cards .cell-actions .btn { width: 36px; padding: 0; }
  /* Разделы материалов: название на всю ширину, кнопки строкой ниже */
  .adm-sec .card-head > .grow { flex: 1 1 calc(100% - 44px); min-width: 0; }
}
@media (hover: none) {
  .note-actions, .msg-actions { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ═════════════ 2.4: светлая тема по умолчанию, современный деловой стиль ═════════════
   Графитовая основная кнопка, золото клуба — только как акцент (активный раздел, значки, счётчики).
   Без моноширинных подписей и подписей заглавными буквами; цифры — табличные цифры Inter. */
:root { --input-bg: #FFFFFF; }
:root:is([data-theme='dark'], [data-theme='night']) { --input-bg: #0B0C0F; }
html { background: var(--bg); }
body { font-size: 14.5px; }
.mono { font-family: var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.pw-code, .totp-key, .code-input { font-family: var(--font-mono); }
.eyebrow { font: 600 12px/1.5 var(--font-ui); text-transform: none; letter-spacing: 0; }
.pop-title, .list-label, .search-group, .form-section, .table th, .perm-head { text-transform: none; letter-spacing: 0; font-weight: 600; font-family: var(--font-ui); font-size: 12.5px; }
.badge, .count { font: 600 11.5px/20px var(--font-ui); }
.side-tag { font: 500 11px/1.4 var(--font-ui); text-transform: none; letter-spacing: .02em; }
.lang-btn { font: 600 12px/1 var(--font-ui); letter-spacing: .04em; }
.stat-num { font: 600 22px/1 var(--font-head); letter-spacing: -.01em; }
.level-edit legend { font: 600 12px/1 var(--font-ui); }
.event-day { font: 600 20px/1 var(--font-head); }
.event-mon { text-transform: none; letter-spacing: 0; font-weight: 600; }

/* Логотип: тёмные буквы в светлой теме, светлые — в тёмной */
.logo-for-dark { display: none !important; }
:root:is([data-theme='dark'], [data-theme='night']) .logo-for-light { display: none !important; }
:root:is([data-theme='dark'], [data-theme='night']) .logo-for-dark { display: block !important; }
.logo-img { height: 18px; width: auto; }
.logo-text.logo-for-dark { display: none; }

/* Поверхности */
.card, .table-wrap, .news-card, .perm-list, .modal-box, .pop, .auth-card { box-shadow: var(--shadow-1); }
.pop { box-shadow: var(--shadow-pop); border-color: var(--border); border-radius: 14px; padding: 6px; }
.pop-row { border-radius: 10px; padding: 9px 10px; }
.modal-box { box-shadow: var(--shadow-pop); border-radius: 18px; }
dialog.modal::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
.card { border-radius: 16px; }
.card-title { font: 650 16px/1.4 var(--font-head); letter-spacing: -.005em; }
.page-title { font: 700 30px/1.15 var(--font-head); letter-spacing: -.02em; }
.page-sub { font-size: 15px; }
.input { background: var(--input-bg); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .16); }
.btn { border-radius: 10px; font-weight: 600; letter-spacing: -.005em; }
.btn-secondary { background: var(--surface); border-color: var(--border-2); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-2); }
:root:is([data-theme='dark'], [data-theme='night']) .btn-secondary { background: var(--surface-2); border-color: var(--border); }
:root:is([data-theme='dark'], [data-theme='night']) .btn-secondary:hover { background: var(--surface-3); }
.btn-outline { border-color: var(--border-2); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn-danger { color: #fff; }
.seg { background: var(--surface-2); border-color: transparent; padding: 3px; border-radius: 12px; }
.seg-btn { height: 34px; border-radius: 9px; font-weight: 600; }
.seg-btn[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border); }
:root:is([data-theme='dark'], [data-theme='night']) .seg { background: var(--surface); border-color: var(--border); }
:root:is([data-theme='dark'], [data-theme='night']) .seg-btn[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-2); }
.chip { background: var(--surface-2); border-color: var(--border); }
.chip-level { background: rgb(var(--accent-rgb) / .1); border-color: rgb(var(--accent-rgb) / .3); color: var(--accent); }
.avatar { border-color: var(--border); background: var(--surface-2); font-family: var(--font-ui); }
:root[data-theme='light'] .avatar { background: linear-gradient(180deg, #F6F1E6, #EADFC8); border-color: #E2D5BA; color: #6E5220; }
.toast { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-pop); }
.empty-icon { border-radius: 14px; background: var(--surface-2); }
.table th { color: var(--text-muted); background: var(--surface-2); }
:root:is([data-theme='dark'], [data-theme='night']) .table th { background: transparent; }
.table tbody tr:hover { background: var(--hover); }

/* Каркас: светлый сайдбар, верхняя панель с размытием */
.side { background: var(--surface); }
.side-head { height: var(--top); padding: 0 20px; border-bottom-color: transparent; }
.side-head .logo-img { height: 17px; }
.nav { padding: 8px 12px 12px; gap: 2px; }
.nav-item { height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text-muted); font-weight: 550; font-size: 14.5px; }
.nav-item .i { color: var(--text-muted); transition: color .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active .i { color: var(--accent); }
.nav-item.active::before { left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; }
.side-foot { border-top-color: var(--border); gap: 8px; padding: 12px; }
.side-user { padding: 8px; border-radius: 12px; }
.top { height: var(--top); background: var(--top-bg); backdrop-filter: saturate(1.4) blur(12px); border-bottom-color: var(--border); padding: 0 32px; }
.top-site { border-color: var(--border-2); background: var(--surface); }
:root:is([data-theme='dark'], [data-theme='night']) .top-site { background: transparent; border-color: var(--border); }
.icon-btn { border-radius: 10px; }
.icon-btn:hover { background: var(--surface-2); }
.bell-dot { border-color: var(--bg); }
.main { padding: 36px 32px 56px; }
.foot { border-top-color: var(--border); }
.banner { background: rgb(var(--accent-rgb) / .08); border-bottom-color: rgb(var(--accent-rgb) / .2); }
.sw-mini { position: relative; flex: none; width: 34px; height: 20px; border-radius: 10px; background: var(--border-2); transition: background-color .2s; }
.sw-mini::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.sw-mini.is-on { background: var(--accent); }
.sw-mini.is-on::after { transform: translateX(14px); }

/* Главная: приветствие и статистика */
.w-welcome { background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 55%, rgb(var(--accent-rgb) / .08) 100%); }
.welcome-title { font: 700 22px/1.25 var(--font-head); letter-spacing: -.015em; }
.stat dt { font-weight: 500; }
.qlink-icon { border-radius: 10px; background: rgb(var(--accent-rgb) / .1); border-color: rgb(var(--accent-rgb) / .22); }
.next { border-color: rgb(var(--accent-rgb) / .28); background: rgb(var(--accent-rgb) / .06); border-radius: 14px; }
.countdown { font: 700 28px/1.1 var(--font-head); letter-spacing: -.01em; }
.news-card { border-radius: 16px; }
.news-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-pop); }
.board-item { background: var(--surface); }
:root:is([data-theme='dark'], [data-theme='night']) .board-item { background: var(--surface-2); }
.note { background: color-mix(in srgb, var(--c) 8%, var(--surface)); }

/* Значки ролей в светлой теме */
.sys-badge { border-color: rgb(var(--accent-rgb) / .45); background: rgb(var(--accent-rgb) / .12); }
.sys-moderator { border-color: rgb(var(--silver-rgb) / .4); background: rgb(var(--silver-rgb) / .1); }
:root[data-theme='light'] .lbl { background: var(--surface); }
.sys-badge.sys-president { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.sys-badge.sys-admin { border-color: var(--accent); background: rgb(var(--accent-rgb) / .18); color: var(--accent); }
.bnav .bnav-item > span:not(.badge) { overflow: visible; text-overflow: clip; }

@media (max-width: 960px) {
  .top { padding: 0 16px; }
  .main { padding: 24px 16px 96px; }
}
@media (max-width: 640px) {
  .bnav .bnav-item { font-size: 11px; letter-spacing: -.015em; }
}

/* Торги: выбор уровней в окне объявления и в модерации (админ-панель и /platform/trading) */
.lv-pick { display: grid; gap: 10px; }
.lv-boxes { display: grid; gap: 6px; }
.lv-box { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.lv-box:has(input:checked) { border-color: var(--accent); background: rgb(var(--accent-rgb) / .07); }
.lv-box input { width: 18px; height: 18px; accent-color: var(--accent); }
.lv-box-l { font-weight: 700; min-width: 26px; }
.lv-box-n { color: var(--text-muted); font-size: 14px; }
.lv-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { height: 30px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 15px; background: var(--surface); color: var(--text); font: 600 12.5px/1 var(--font-ui); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }


/* ═════════════════════ 2.5: логотип «Око дракона», поля, выбор темы, админ-панель, тема «Стекло» ═════════════════════ */

/* Логотип: знак + название; цвета знака зависят от темы */
.logo { gap: 9px; color: var(--text); text-decoration: none; }
.logo-eye { display: block; flex: none; }
.logo-eye .eye-s1 { stop-color: var(--eye-1); }
.logo-eye .eye-s2 { stop-color: var(--eye-2); }
.logo-eye .eye-s3 { stop-color: var(--eye-3); }
.logo-name { font: 750 16px/1 var(--font-head); letter-spacing: -.015em; white-space: nowrap; }
:root, :root[data-theme='light'], :root[data-theme='glass'] { --eye-1: #DDB96F; --eye-2: #A9823C; --eye-3: #6F5220; }
:root:is([data-theme='dark'], [data-theme='night']) { --eye-1: #F2D995; --eye-2: #C9A25A; --eye-3: #8A6528; }
.auth-logo .logo-name { font-size: 19px; color: #F2F3F5; }
.auth-logo .logo-eye { width: 36px; height: 28px; }
.side-head .logo-name { font-size: 15.5px; }

/* Поля ввода: заметная граница и лёгкая подложка — поле видно сразу, даже на белом окне */
:root, :root[data-theme='light'] { --field-border: #C9CFD8; --input-bg: #FBFBFC; }
:root:is([data-theme='dark'], [data-theme='night']) { --field-border: #343947; --input-bg: #0B0C0F; }
.input { border-color: var(--field-border); background: var(--input-bg); }
.input:hover { border-color: #AEB6C2; }
:root:is([data-theme='dark'], [data-theme='night']) .input:hover { border-color: #444A5A; }
.input:focus { background: var(--surface); }
.ad-desc { min-height: 150px; }

/* Выбор темы */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.theme-opt { display: grid; gap: 8px; padding: 8px 8px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font: 600 13.5px/1.2 var(--font-ui); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.theme-opt:hover { border-color: var(--border-2); }
.theme-opt.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .18); }
.theme-name { display: inline-flex; align-items: center; gap: 6px; padding: 0 2px; }
.theme-prev { position: relative; display: grid; grid-template-columns: 30% 1fr; grid-template-rows: 1fr 1fr; gap: 5px; height: 64px; padding: 6px; border-radius: 9px; overflow: hidden; }
.theme-prev i { display: block; border-radius: 5px; }
.theme-prev i:first-child { grid-row: 1 / -1; }
.th-light .theme-prev { background: #F1F2F5; } .th-light .theme-prev i { background: #FFFFFF; box-shadow: 0 0 0 1px #E4E7EC; }
.th-dark .theme-prev { background: #0B0C0F; } .th-dark .theme-prev i { background: #1A1D24; }
.th-glass .theme-prev { background: #E6E8EC url(glass-bg-m.webp) center / cover; }
.th-glass .theme-prev i { background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.theme-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.theme-seg .theme-opt { display: flex; justify-content: center; padding: 7px 4px; border: 0; border-radius: 9px; background: none; font-size: 12.5px; color: var(--text-muted); }
.theme-seg .theme-opt.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border); }
:root:is([data-theme='dark'], [data-theme='night']) .theme-seg .theme-opt.is-on { background: var(--surface-3); }
.pop-theme { padding: 6px 8px 8px; }
.pop-label { padding: 2px 2px 6px; font-size: 12px; color: var(--text-muted); }

/* Заявки: уровень, оплата, срок — и сразу «Подтвердить» */
.req-setup { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.req-fields { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.req-fields .mini-field .input { min-width: 150px; }
.req-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.req-days .label { margin-right: 4px; }
.req-until { margin-left: 4px; }
.chip-btn.is-on { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-text); }
.chip-btn.is-on:hover { color: var(--primary-text); }
.row-acts { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.row-acts .btn-secondary { padding: 0 10px; }
.subtabs { display: inline-flex; gap: 2px; margin-bottom: 14px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.subtab { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 9px; color: var(--text-muted); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.subtab:hover { color: var(--text); }
.subtab.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--border); }
:root:is([data-theme='dark'], [data-theme='night']) .subtab.is-on { background: var(--surface-3); }
.subtabs-d { margin: -6px 0 14px; max-width: 760px; }
@media (max-width: 860px) {
  .req-fields .mini-field { flex: 1 1 140px; }
  .req-fields .mini-field .input { width: 100%; min-width: 0; }
  .row-acts { justify-content: flex-start; }
}

/* ───────────── Тема «Стекло»: матовые полупрозрачные панели над светлым проработанным фоном ───────────── */
:root[data-theme='glass'] {
  --bg: #E7E9ED;
  --surface: rgba(255, 255, 255, .58);
  --surface-2: rgba(255, 255, 255, .5);
  --surface-3: rgba(255, 255, 255, .78);
  --border: rgba(24, 32, 48, .1);
  --border-2: rgba(24, 32, 48, .18);
  --text: #0E1116;
  --text-muted: #474E5B;
  --placeholder: #7A8290;
  --accent: #7E5D22;
  --accent-hover: #664A19;
  --accent-rgb: 150 112 46;
  --on-accent: #FFFFFF;
  --primary-bg: #12151A;
  --primary-text: #FFFFFF;
  --primary-hover: #2A2E36;
  --success: #17704A;  --success-rgb: 23 112 74;
  --danger: #B3362A;   --danger-rgb: 179 54 42;   --danger-hover: #9A2C22;
  --warning: #8F5A08;  --warning-rgb: 143 90 8;
  --silver: #4E5664;   --silver-rgb: 78 86 100;
  --hover: rgba(255, 255, 255, .45);
  --scroll: rgba(24, 32, 48, .22);
  --backdrop: rgba(214, 218, 226, .42);
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .75), 0 1px 2px rgba(20, 28, 45, .04), 0 12px 32px -16px rgba(20, 28, 45, .22);
  --shadow-pop: inset 0 1px 0 rgba(255, 255, 255, .8), 0 28px 64px -20px rgba(20, 28, 45, .38);
  --top-bg: rgba(255, 255, 255, .42);
  --accent-soft: rgb(var(--accent-rgb) / .12);
  --accent-line: rgb(var(--accent-rgb) / .5);
  --field-border: rgba(24, 32, 48, .16);
  --input-bg: rgba(255, 255, 255, .72);
  --glass-edge: rgba(255, 255, 255, .72);
  --glass-blur: blur(24px) saturate(1.7);
  --theme-color: #E7E9ED;
  color-scheme: light;
}
/* Фон — отдельным слоем под всем (без background-attachment: fixed — он ломается на iPhone) */
:root[data-theme='glass'] { background: #E7E9ED; }
:root[data-theme='glass'] body { background: transparent; }
:root[data-theme='glass'] body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: #E7E9ED url(glass-bg.webp) center / cover no-repeat; pointer-events: none; }
@media (max-width: 860px) { :root[data-theme='glass'] body::before { background-image: url(glass-bg-m.webp); } }
/* Стеклянные поверхности */
:root[data-theme='glass'] :is(.side, .top, .card, .table-wrap, .modal-box, .pop, .bnav, .news-card, .ad-card, .toast, .board-item, .perm-list, .banner, .composer-wrap,
  .seg, .subtabs, .theme-seg, .req-setup, .tr-top, .tr-card, .tr-warn, .tr-grid > .empty, .search, .top-site, .ad-warn, .mx-pinbar) {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-color: var(--glass-edge);
}
:root[data-theme='glass'] .side { background: rgba(255, 255, 255, .44); border-right: 1px solid var(--glass-edge); box-shadow: inset -1px 0 0 rgba(24, 32, 48, .05); }
:root[data-theme='glass'] .top { background: rgba(255, 255, 255, .34); border-bottom-color: var(--glass-edge); }
:root[data-theme='glass'] .card, :root[data-theme='glass'] .table-wrap, :root[data-theme='glass'] .news-card { background: rgba(255, 255, 255, .56); box-shadow: var(--shadow-1); }
:root[data-theme='glass'] .modal-box { background: rgba(250, 251, 252, .86); }
:root[data-theme='glass'] .pop { background: rgba(250, 251, 252, .82); }
:root[data-theme='glass'] dialog.modal::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
:root[data-theme='glass'] .nav-item.active, :root[data-theme='glass'] .nav-item:hover { background: rgba(255, 255, 255, .62); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 2px rgba(20, 28, 45, .06); }
:root[data-theme='glass'] .btn-secondary { background: rgba(255, 255, 255, .62); border-color: var(--glass-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 2px rgba(20, 28, 45, .06); }
:root[data-theme='glass'] .btn-secondary:hover { background: rgba(255, 255, 255, .82); }
:root[data-theme='glass'] .table th { background: rgba(255, 255, 255, .35); }
:root[data-theme='glass'] .table tbody tr:hover { background: rgba(255, 255, 255, .4); }
:root[data-theme='glass'] .bnav { background: rgba(255, 255, 255, .55); border-top-color: var(--glass-edge); }
:root[data-theme='glass'] .toast { background: rgba(250, 251, 252, .86); }
:root[data-theme='glass'] .seg-btn[aria-selected="true"], :root[data-theme='glass'] .theme-seg .theme-opt.is-on, :root[data-theme='glass'] .subtab.is-on { background: rgba(255, 255, 255, .85); }
:root[data-theme='glass'] .chip { background: rgba(255, 255, 255, .55); border-color: rgba(24, 32, 48, .1); }
:root[data-theme='glass'] .avatar { background: rgba(255, 255, 255, .7); border-color: var(--glass-edge); }
:root[data-theme='glass'] .side-tag { background: rgba(255, 255, 255, .55); border-color: var(--glass-edge); }
:root[data-theme='glass'] .theme-opt:not(.theme-seg .theme-opt) { background: rgba(255, 255, 255, .55); }
/* Без поддержки размытия — плотнее, чтобы текст оставался читаемым */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme='glass'] { --surface: rgba(255, 255, 255, .9); --surface-2: rgba(246, 247, 249, .92); }
  :root[data-theme='glass'] .side, :root[data-theme='glass'] .card, :root[data-theme='glass'] .table-wrap, :root[data-theme='glass'] .top { background: rgba(255, 255, 255, .9); }
}
:root[data-theme='glass'] html { background: #E7E9ED; }
.row-acts { flex-wrap: nowrap; gap: 4px; }
.row-acts .btn-secondary { height: 30px; padding: 0 9px; font-size: 12.5px; white-space: nowrap; }
.cell-name { white-space: nowrap; }
@media (max-width: 860px) { .row-acts { flex-wrap: wrap; } }
@media (max-width: 380px) { .top-logo .logo-name { display: none; } }
/* 2.6: поле описания объявления. Раньше у него был класс карточки «ad-text» (обрезка текста в 2 строки и скрытие на узких экранах) —
   в части браузеров поле схлопывалось в ноль. Теперь свой класс. */
textarea.ad-desc { display: block; width: 100%; height: 170px; min-height: 120px; max-height: 420px; resize: vertical; }

/* ───────────── Админ-панель → «Нагрузка» (2.6) ───────────── */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; }
:root:is([data-theme='dark'], [data-theme='night']) { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; }
.ld-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ld-stat { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.ld-stat-v { font: 600 26px/1.15 var(--font-head); color: var(--text); font-variant-numeric: tabular-nums; }
.ld-stat-l { margin-top: 2px; font-size: 14px; color: var(--text); }
.ld-stat .hint { margin-top: 2px; font-size: 12px; }
.ch { display: block; width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-grid.is-base { stroke: var(--border-2); }
.ch-ax { fill: var(--text-muted); font-size: 11px; }
.ch rect.s-1 { fill: var(--viz-1); } .ch rect.s-2 { fill: var(--viz-2); } .ch rect.s-3 { fill: var(--viz-3); }
.ch-hit { fill: transparent; }
.ch-hit:hover { fill: var(--text); fill-opacity: .06; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-muted); }
.ch-key { display: inline-flex; align-items: center; gap: 6px; }
.ch-sw { width: 10px; height: 10px; border-radius: 3px; }
.ch-sw.s-1 { background: var(--viz-1); } .ch-sw.s-2 { background: var(--viz-2); } .ch-sw.s-3 { background: var(--viz-3); }
.ld-kinds { display: grid; gap: 8px; margin-top: 6px; }
.ld-kind { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; }
.ld-kind-track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ld-kind-bar { display: block; height: 100%; border-radius: 4px; background: var(--viz-1); }
.ld-kind-v { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-clean { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ld-clean .hint { flex: 1; margin: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) {
  .ld-kind { grid-template-columns: 90px minmax(0, 1fr); }
  .ld-kind-v { grid-column: 2; }
  .ld-clean { flex-direction: column; align-items: stretch; }
}

/* Входящий звонок, пока открыта платформа или Торги */
.call-hint { position: fixed; z-index: 900; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: min(460px, calc(100vw - 24px));
  padding: 8px 8px 8px 14px; border-radius: 14px; background: linear-gradient(90deg, #3C6FE0, #8148EC); color: #fff; box-shadow: 0 10px 30px rgba(20, 30, 60, .3); animation: call-hint-in .3s cubic-bezier(.25, 1, .5, 1); }
.call-hint-ic { display: grid; place-items: center; flex: none; }
.call-hint-t { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-hint-go { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 14px; border-radius: 10px; background: #3CC35A; color: #fff; font-weight: 600; text-decoration: none; }
.call-hint-go:hover { background: #33B34F; }
@keyframes call-hint-in { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .call-hint { animation: none; } }

/* ───────────── 2.7: тема «Тёмное стекло» — тёмные матовые панели над ночным космосом ─────────────
   Все правила тёмной темы действуют и здесь (:is(dark, night)); ниже — только прозрачность, размытие и фиолетовые акценты.
   Фон: слой .bd-space (холст со звёздами, common-js) поверх глубокого градиента; без JS — только градиент. */
:root[data-theme='night'] {
  --bg: #07060C;
  --surface: rgba(22, 17, 38, .58);
  --surface-2: rgba(30, 24, 52, .52);
  --surface-3: rgba(44, 36, 74, .7);
  --border: rgba(190, 170, 255, .12);
  --border-2: rgba(190, 170, 255, .2);
  --text: #ECEAF5;
  --text-muted: #A9A3C2;
  --placeholder: #7C7699;
  --accent: #B9A3FF;
  --accent-hover: #CBB9FF;
  --accent-rgb: 185 163 255;
  --on-accent: #120E22;
  --primary-bg: #8E70F2;
  --primary-text: #FFFFFF;
  --primary-hover: #9D82F5;
  --hover: rgba(185, 163, 255, .08);
  --scroll: rgba(185, 163, 255, .22);
  --backdrop: rgba(6, 4, 14, .55);
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .05), 0 18px 40px -22px rgba(0, 0, 0, .8);
  --shadow-pop: inset 0 1px 0 rgba(255, 255, 255, .06), 0 28px 64px -20px rgba(0, 0, 0, .85);
  --top-bg: rgba(14, 11, 26, .5);
  --accent-soft: rgb(var(--accent-rgb) / .12);
  --accent-line: rgb(var(--accent-rgb) / .5);
  --field-border: rgba(190, 170, 255, .2);
  --input-bg: rgba(10, 8, 20, .55);
  --glass-edge: rgba(190, 170, 255, .14);
  --glass-blur: blur(22px) saturate(1.4);
  --theme-color: #07060C;
  --eye-1: #F2D995; --eye-2: #C9A25A; --eye-3: #8A6528;
  color-scheme: dark;
}
:root[data-theme='night'], :root[data-theme='night'] html { background: #07060C; }
:root[data-theme='night'] body { background: transparent; }
:root[data-theme='night'] body::before { content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(60% 50% at 78% 18%, rgba(98, 54, 170, .28), transparent 70%), radial-gradient(55% 45% at 12% 85%, rgba(58, 32, 120, .32), transparent 70%),
    radial-gradient(35% 30% at 40% 45%, rgba(130, 70, 200, .1), transparent 70%), linear-gradient(180deg, #08060F 0%, #0B0817 55%, #060510 100%); }
.bd-space { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
:root[data-theme='night'] :is(.side, .top, .card, .table-wrap, .modal-box, .pop, .bnav, .news-card, .ad-card, .toast, .board-item, .perm-list, .banner, .composer-wrap,
  .seg, .subtabs, .theme-seg, .req-setup, .tr-top, .tr-card, .tr-warn, .tr-grid > .empty, .search, .top-site, .ad-warn, .mx-pinbar, .ld-stat) {
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-color: var(--glass-edge);
}
:root[data-theme='night'] .side { background: rgba(14, 11, 26, .5); border-right: 1px solid var(--glass-edge); }
:root[data-theme='night'] .top { background: rgba(12, 9, 22, .42); border-bottom-color: var(--glass-edge); }
:root[data-theme='night'] .card, :root[data-theme='night'] .table-wrap, :root[data-theme='night'] .news-card, :root[data-theme='night'] .ld-stat { background: rgba(22, 17, 38, .56); box-shadow: var(--shadow-1); }
:root[data-theme='night'] .modal-box { background: rgba(20, 16, 34, .9); }
:root[data-theme='night'] .pop, :root[data-theme='night'] .toast { background: rgba(22, 18, 38, .88); }
:root[data-theme='night'] dialog.modal::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
:root[data-theme='night'] .nav-item.active, :root[data-theme='night'] .nav-item:hover { background: rgba(185, 163, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
:root[data-theme='night'] .nav-item.active { color: var(--text); }
:root[data-theme='night'] .btn-secondary { background: rgba(40, 32, 68, .6); border-color: var(--glass-edge); }
:root[data-theme='night'] .btn-secondary:hover { background: rgba(56, 45, 94, .75); }
:root[data-theme='night'] .table th { background: rgba(30, 24, 52, .45); }
:root[data-theme='night'] .table tbody tr:hover { background: rgba(185, 163, 255, .06); }
:root[data-theme='night'] .bnav { background: rgba(14, 11, 26, .62); border-top-color: var(--glass-edge); }
:root[data-theme='night'] .seg-btn[aria-selected="true"], :root[data-theme='night'] .theme-seg .theme-opt.is-on, :root[data-theme='night'] .subtab.is-on { background: rgba(70, 56, 120, .7); }
:root[data-theme='night'] .chip { background: rgba(40, 32, 68, .55); border-color: var(--glass-edge); }
:root[data-theme='night'] .theme-opt:not(.theme-seg .theme-opt) { background: rgba(22, 17, 38, .6); }
:root[data-theme='night'] .input:hover { border-color: rgba(190, 170, 255, .34); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme='night'] { --surface: rgba(20, 16, 34, .94); --surface-2: rgba(28, 22, 46, .95); }
  :root[data-theme='night'] .side, :root[data-theme='night'] .card, :root[data-theme='night'] .table-wrap, :root[data-theme='night'] .top { background: rgba(20, 16, 34, .94); }
}
.th-night .theme-prev { background: radial-gradient(60% 60% at 75% 25%, rgba(120, 70, 200, .5), transparent 70%), #0A0814; }
.th-night .theme-prev::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(1px 1px at 20% 30%, #E8DDFF, transparent), radial-gradient(1px 1px at 70% 60%, #C9B6FF, transparent), radial-gradient(1.5px 1.5px at 45% 80%, #fff, transparent), radial-gradient(1px 1px at 85% 20%, #B9A3FF, transparent), radial-gradient(1px 1px at 10% 75%, #D6C8FF, transparent); }
.th-night .theme-prev i { position: relative; z-index: 1; background: rgba(30, 24, 52, .55); box-shadow: inset 0 0 0 1px rgba(190, 170, 255, .2); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.theme-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.theme-seg { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 560px) { .theme-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.theme-note { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }

/* 2.7: идущие конференции на доске клуба */
.board-confs { display: grid; gap: 10px; margin-bottom: 14px; }
.board-conf { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgb(var(--success-rgb) / .4); background: rgb(var(--success-rgb) / .07); }
.board-conf-ic { position: relative; flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--success); color: #fff; }
.board-conf-ic i { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgb(var(--success-rgb) / .5); animation: bconf 1.8s ease-out infinite; }
@keyframes bconf { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.board-conf-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.board-conf-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--success); }
.board-conf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.board-conf-t { font: 700 16px/1.3 var(--font-head); color: var(--text); overflow-wrap: anywhere; }
.board-conf-d { font-size: 13.5px; color: var(--text-muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.board-conf-lv { font-size: 12.5px; color: var(--text-muted); }
.board-conf-go { flex: none; align-self: center; }
@media (max-width: 560px) { .board-conf { flex-wrap: wrap; } .board-conf-go { width: 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .board-conf-ic i { animation: none; } }

/* 2.7: технические работы */
.badge.is-warn { background: var(--warning); color: #fff; font-weight: 800; }
.mt-state { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgb(var(--success-rgb) / .1); color: var(--success); font-weight: 600; }
.mt-state.is-on { background: rgb(var(--warning-rgb) / .14); color: var(--warning); }
.maint-until { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: #C9CFDA; font-size: 14px; }

/* 2.7: фото профиля поверх инициалов */
.avatar { position: relative; overflow: hidden; }
.avatar .av-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar.has-img .avatar-t { visibility: hidden; }

/* 2.7: профиль — шапка с фото и разделы */
.avatar-xl { width: 96px; height: 96px; font-size: 30px; }
.prof-hero { display: flex; align-items: center; gap: 22px; padding: 22px 24px; margin-bottom: 16px; border-radius: 18px; border: 1px solid var(--border);
  background: radial-gradient(120% 140% at 0% 0%, rgb(var(--accent-rgb) / .12), transparent 55%), var(--surface); box-shadow: var(--shadow-1); }
:root:is([data-theme='glass'], [data-theme='night']) .prof-hero { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-color: var(--glass-edge); }
.prof-ava { position: relative; flex: none; }
.prof-ava .avatar { width: 112px; height: 112px; font-size: 34px; border: 3px solid var(--surface); box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .35); }
.prof-ava-edit { position: absolute; right: 2px; bottom: 2px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-bg); color: var(--primary-text); border: 3px solid var(--surface); cursor: pointer; }
.prof-ava-edit:hover { background: var(--primary-hover); }
.prof-hero-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.prof-name { font: 750 24px/1.2 var(--font-head); letter-spacing: -.01em; overflow-wrap: anywhere; }
.prof-sub { color: var(--text-muted); font-size: 14px; overflow-wrap: anywhere; }
.prof-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prof-ava-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.prof-av-note { margin: 0; font-size: 12.5px; }
.prof-hero-side { align-self: flex-start; }
.prof-sec-t { display: inline-flex; align-items: center; gap: 10px; }
.prof-sec-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
@media (max-width: 720px) {
  .prof-hero { flex-direction: column; align-items: center; text-align: center; padding: 20px 16px; }
  .prof-chips, .prof-ava-acts { justify-content: center; }
  .prof-hero-side { align-self: center; }
}
.crop { display: grid; gap: 14px; justify-items: center; }
.crop-frame { position: relative; width: 300px; height: 300px; max-width: 100%; border-radius: 14px; overflow: hidden; touch-action: none; }
.crop-frame::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 14px; box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, .0); background: radial-gradient(circle at center, transparent 149px, rgba(0, 0, 0, .45) 150px); }
.crop-cv { width: 300px; height: 300px; display: block; cursor: grab; }
.crop-cv:active { cursor: grabbing; }
.crop-z { display: flex; align-items: center; gap: 10px; width: 300px; max-width: 100%; color: var(--text-muted); }
.crop-zoom { flex: 1; accent-color: var(--accent); }

/* 2.7: страница входа на телефоне — окно было сдвинуто вправо: длинная подпись «Заявка на вступление» растягивала сетку шире экрана */
.auth > * { min-width: 0; max-width: 100%; }
.auth-center { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.auth-card { min-width: 0; max-width: 100%; box-sizing: border-box; }
.seg-full .seg-btn { min-width: 0; white-space: normal; line-height: 1.2; text-align: center; padding-left: 8px; padding-right: 8px; }
@media (max-width: 380px) { .auth-card { padding: 20px 16px; } .auth-center { padding-left: 12px; padding-right: 12px; } }
