/* LEGITWORLD — ELITE CONTROL. Золото как металл, тёмно-синий как основа. */

@font-face { font-family: "Unbounded"; font-weight: 500; font-display: swap; src: url("../fonts/unbounded-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 500; font-display: swap; src: url("../fonts/unbounded-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("../fonts/unbounded-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("../fonts/unbounded-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("../fonts/manrope-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url("../fonts/manrope-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url("../fonts/manrope-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../fonts/manrope-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../fonts/manrope-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 700; font-display: swap; src: url("../fonts/manrope-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }

:root {
  --abyss: #070B16;
  --navy: #142142;
  --navy-2: #18264C;
  --deep: #1D2D5A;
  --line: #2E4278;
  --line-hi: rgba(226, 177, 60, .35);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, .04);
  --ivory: #EDE6D3;
  --steel: #8A9BC4;
  --steel-dim: #7A8AB3;
  --gold: #E2B13C;
  --gold-hi: #F6D77A;
  --gold-lo: #8C6A1E;
  --ember: #E5484D;
  --ember-solid: #D23B40;
  --jade: #4FB286;
  --display: "Unbounded", "Segoe UI", sans-serif;
  --text: "Manrope", "Segoe UI", system-ui, sans-serif;
  --r-emblem: 22px;
  --r-panel: 14px;
  --r-control: 10px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(34, 50, 95, .55), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(140, 106, 30, .12), transparent 60%),
    var(--abyss);
  background-attachment: fixed;
  color: var(--ivory);
  font: 400 15px/1.55 var(--text);
  font-feature-settings: "tnum" 1;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -.01em; line-height: 1.15; }
h1 { font-size: clamp(22px, 2.6vw, 30px); }
h2 { font-size: 19px; }
h3 { font-size: 15px; font-weight: 500; }
p { margin: 0; }
.muted { color: var(--steel); }
.small { font-size: 13px; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-control);
  border: 1px solid var(--line); background: var(--navy-2); color: var(--ivory);
  font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--deep); border-color: var(--line-hi); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #C9952A);
  border-color: var(--gold); color: #1A1305;
}
.btn-gold:hover { background: linear-gradient(180deg, #FBE29A, var(--gold-hi) 60%, var(--gold)); border-color: var(--gold-hi); }
.btn-danger { border-color: rgba(229, 72, 77, .55); color: #FFB3B5; }
.btn-danger:hover { background: rgba(229, 72, 77, .14); border-color: var(--ember); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--steel); }
.btn-ghost:hover { background: var(--navy-2); color: var(--ivory); border-color: var(--line); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-sm svg { width: 16px; height: 16px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--steel); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r-control);
  background: #0A1226; border: 1px solid var(--line); color: var(--ivory); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--steel-dim); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226, 177, 60, .15); }
textarea.input { min-height: 80px; resize: vertical; }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--steel); font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }
.form-error { color: #FF9EA1; font-size: 14px; min-height: 20px; }

/* ---------- экран входа ---------- */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
}
.auth-art {
  position: relative; padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between;
  border-right: 1px solid var(--line); overflow: hidden;
}
.auth-art::after {
  content: ""; position: absolute; inset: auto -20% -35% 20%; height: 70%;
  background: radial-gradient(closest-side, rgba(226, 177, 60, .16), transparent); pointer-events: none;
}
.auth-title { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -.02em; max-width: 14ch; }
.auth-title .gold { color: var(--gold); display: block; }
.auth-lead { color: var(--steel); max-width: 50ch; font-size: 16px; margin-top: 18px; }
.auth-points { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; color: var(--steel); font-size: 14px; line-height: 1.5; max-width: 58ch; }
.auth-points b { color: var(--ivory); font-weight: 600; }
.auth-points li { display: flex; gap: 10px; align-items: baseline; }
.auth-points li::before { content: ""; width: 6px; height: 6px; transform: rotate(45deg); background: var(--gold); flex: none; margin-top: 7px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: rgba(14, 23, 48, .55); }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #0A1226; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.auth-tabs button { border: 0; background: transparent; padding: 9px; border-radius: 9px; color: var(--steel); font-weight: 600; cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--deep); color: var(--ivory); box-shadow: inset 0 0 0 1px #2E4280; }
.auth-form { display: grid; gap: 14px; }
.code-input { font-family: var(--display); letter-spacing: .18em; text-transform: uppercase; font-size: 18px; text-align: center; }
.hint { font-size: 13px; color: var(--steel); background: #0A1226; border: 1px dashed var(--line); border-radius: var(--r-control); padding: 10px 12px; }
.hint b { color: var(--gold); font-weight: 600; }

/* ---------- бренд ---------- */
.brand { display: flex; align-items: center; gap: 12px; color: var(--ivory); }
.brand img { width: 40px; height: 40px; flex: none; display: block; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45)); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: .04em; line-height: 1; }
.brand-sub { display: block; font-family: var(--display); font-weight: 500; font-size: 10.5px; color: var(--gold); letter-spacing: .2em; margin-top: 5px; white-space: nowrap; }

/* ---------- каркас кабинета ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: 68px 1fr; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: rgba(7, 11, 22, .82); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 30;
}
.topbar .spacer { flex: 1; }
.menu-toggle { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--navy); }
.user-chip img, .user-chip .avatar-fallback { width: 32px; height: 32px; border-radius: 50%; }
.user-chip .name { font-weight: 600; font-size: 14px; padding-right: 6px; }
.avatar-fallback { display: grid; place-items: center; background: var(--deep); color: var(--gold); font-family: var(--display); font-size: 13px; }

.sidebar { border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 68px; height: calc(100vh - 68px); overflow: auto; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--steel); font-weight: 600; font-size: 14px; border: 1px solid transparent; transition: color .15s, background .15s;
}
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover { color: var(--ivory); background: var(--navy); }
.nav-link[aria-current="page"] { color: var(--ivory); background: var(--navy-2); border-color: var(--line); }
.nav-link[aria-current="page"] svg { color: var(--gold); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: rgba(229, 72, 77, .18); color: #FFB3B5; font-size: 12px; text-align: center; }

.main { padding: 28px clamp(16px, 3vw, 40px) 64px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin-top: 6px; }

.panel { background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 20px; box-shadow: var(--highlight), var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 18px; }
.grid-hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: stretch; }
.grid-hero > .grid-2x2 { grid-auto-rows: 1fr; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 18px; }

/* ---------- жетон модератора (главный элемент) ---------- */
.emblem {
  position: relative; overflow: hidden; border-radius: var(--r-emblem);
  padding: 22px 24px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center;
  background:
    linear-gradient(135deg, rgba(246, 215, 122, .07), transparent 40%),
    linear-gradient(160deg, #13204A, #0C1430 70%);
  border: 1px solid rgba(226, 177, 60, .45);
  box-shadow: 0 0 0 1px rgba(7, 11, 22, .9) inset, 0 30px 60px -36px rgba(226, 177, 60, .35);
}
.emblem::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(246, 215, 122, .18) 48%, transparent 60%);
  transform: translateX(-120%);
}
.emblem.shine::before { animation: sheen 1.6s var(--ease) .25s 1 both; }
@keyframes sheen { to { transform: translateX(120%); } }
.hexframe {
  width: 96px; height: 106px; flex: none; position: relative;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, var(--gold-hi), var(--gold) 45%, var(--gold-lo));
  display: grid; place-items: center;
}
.hexframe-inner {
  width: 86px; height: 96px; clip-path: inherit; background: #0B1330; display: grid; place-items: center; overflow: hidden;
}
.hexframe-inner img { width: 64px; height: 64px; image-rendering: pixelated; }
.hexframe-inner .avatar-fallback { width: 74px; height: 74px; border-radius: 12px; font-size: 26px; }
.emblem-name { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.05; overflow-wrap: anywhere; }
.emblem-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; color: var(--steel); font-size: 14px; }
.emblem-meta b { color: var(--ivory); font-weight: 600; }
.plate {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 8px; white-space: nowrap;
  font-family: var(--display); font-weight: 500; font-size: 13px; letter-spacing: .02em; color: #1B1406;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, #B98827);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(0, 0, 0, .18);
}
.plate svg { width: 16px; height: 16px; }
.plate.expired { background: linear-gradient(180deg, #3A4670, #26315A); color: var(--steel); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.plate.none { background: transparent; color: var(--steel); border: 1px dashed var(--line); box-shadow: none; font-family: var(--text); font-weight: 600; }
.trust { display: grid; gap: 6px; align-content: start; }
.trust-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--steel); }
.trust-row b { color: var(--ivory); font-family: var(--display); font-weight: 500; }
.segments { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.segments i { height: 8px; border-radius: 2px; background: #1C2A55; }
.segments i.on { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.segments.low i.on { background: linear-gradient(180deg, #FF8A8D, var(--ember)); }
.restriction { margin-top: 12px; display: inline-flex; gap: 8px; align-items: center; color: #FFB3B5; font-size: 13px; }

/* ---------- показатели ---------- */
.stat { background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 18px; box-shadow: var(--highlight); display: grid; gap: 2px; align-content: start; transition: border-color .15s; }
.stat:hover { border-color: var(--line-hi); }
.stat-value { font-family: var(--display); font-weight: 700; font-size: 32px; line-height: 1.1; }
.stat-label { color: var(--steel); font-size: 14px; }
.stat-sub { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--steel); }
.stat-sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.stat.clean .stat-value, .stat-sub.clean { color: var(--jade); }
.stat.hot { border-color: rgba(229, 72, 77, .45); }
.stat.hot .stat-value, .stat-sub.hot { color: #FF8A8D; }
.stat-sub.calm { color: var(--steel); }
.stat-sub.info { color: var(--steel-dim); font-weight: 500; }
.stat-sub.info::before { background: var(--gold); }
.stat.clean { background: linear-gradient(180deg, rgba(79, 178, 134, .07), transparent 60%), var(--navy); }

/* ---------- шкала предупреждений ---------- */
.emblem-body { display: grid; gap: 16px; min-width: 0; }
.emblem-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; }
.emblem-gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.wmeter { display: grid; gap: 6px; align-content: start; }
.wmeter-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--steel); }
.wmeter-row b { color: var(--ivory); font-family: var(--display); font-weight: 500; }
.wmeter-cells { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.wmeter-cells i { height: 8px; border-radius: 2px; background: #1C2A55; }
.wmeter.some .wmeter-cells i.on { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.wmeter.high .wmeter-cells i.on, .wmeter.full .wmeter-cells i.on { background: linear-gradient(180deg, #FF8A8D, var(--ember)); }
.wmeter-note { font-size: 12.5px; color: var(--steel-dim); }
.wmeter.clean .wmeter-note { color: var(--jade); }
.wmeter.high .wmeter-note, .wmeter.full .wmeter-note { color: #FF9EA1; }
.wmeter:not(.compact) .wmeter-cells i { height: 12px; border-radius: 3px; }
.wmeter:not(.compact) .wmeter-row b { font-size: 18px; }
.warn-summary { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); gap: 28px; align-items: center; }
.warn-facts { display: grid; gap: 6px; }
.warn-facts b { color: var(--ivory); font-weight: 600; }
.sub.burn { color: var(--gold); }

/* ---------- лента событий ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(34, 50, 95, .6); align-items: start; }
.feed li:first-child { border-top: 0; padding-top: 2px; }
.feed .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--deep); color: var(--steel); }
.feed .ico svg { width: 17px; height: 17px; }
.feed .ico.warning { color: var(--gold); background: rgba(226, 177, 60, .12); }
.feed .ico.ban, .feed .ico.mute { color: #FF9EA1; background: rgba(229, 72, 77, .12); }
.feed .ico.unban, .feed .ico.unmute, .feed .ico.pardon { color: var(--jade); background: rgba(79, 178, 134, .12); }
.feed .ico.donate { color: var(--gold-hi); background: rgba(246, 215, 122, .12); }
.feed-title { font-weight: 600; font-size: 14px; }
.feed-details { color: var(--steel); font-size: 13px; overflow-wrap: anywhere; }
.feed time { color: var(--steel-dim); font-size: 12px; white-space: nowrap; }
@media (min-width: 1200px) {
  .feed.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 36px; }
  .feed.wide li:nth-child(2) { border-top: 0; padding-top: 2px; }
}

/* ---------- статусы ---------- */
.status { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.active { color: #FF9EA1; background: rgba(229, 72, 77, .12); border-color: rgba(229, 72, 77, .3); }
.status.expired { color: var(--steel); background: rgba(138, 155, 196, .08); border-color: rgba(138, 155, 196, .18); }
.status.removed { color: var(--jade); background: rgba(79, 178, 134, .1); border-color: rgba(79, 178, 134, .28); }
.status.ok { color: var(--jade); background: rgba(79, 178, 134, .1); border-color: rgba(79, 178, 134, .28); }
.status.pending { color: var(--gold); background: rgba(226, 177, 60, .1); border-color: rgba(226, 177, 60, .3); }
.status.fail { color: #FF9EA1; background: rgba(229, 72, 77, .12); border-color: rgba(229, 72, 77, .3); }

/* ---------- фильтры и таблицы ---------- */
.filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; margin-bottom: 12px; align-items: end; }
.filters.with-selects { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(140px, 210px)) auto; }
.filters-sub { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; min-height: 34px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: #0A1226; border: 1px solid var(--line); border-radius: var(--r-control); padding: 3px; gap: 2px; min-height: 42px; }
.segmented button { border: 0; background: transparent; color: var(--steel); padding: 0 12px; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.segmented button:hover { color: var(--ivory); }
.segmented button[aria-checked="true"] { background: var(--deep); box-shadow: inset 0 0 0 1px #2E4280; }
.segmented button[aria-checked="true"] { color: var(--gold-hi); }
.bulk-bar {
  position: sticky; top: 78px; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 14px; border-radius: var(--r-panel); background: var(--deep); border: 1px solid rgba(226, 177, 60, .45);
  box-shadow: var(--shadow); font-weight: 600; animation: pop .16s var(--ease);
}
th.pick, td.pick { width: 44px; padding-right: 0; }
.pick input { accent-color: var(--gold); width: 17px; height: 17px; cursor: pointer; vertical-align: middle; }
.is-loading .table-wrap { opacity: .55; transition: opacity .15s; }
.act.warn { color: #FF9EA1; }
.input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.75) sepia(.6) saturate(4) hue-rotate(5deg); cursor: pointer; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--steel); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { color: var(--ivory); border-color: var(--line-hi); }
.chip[aria-pressed="true"] { color: #1B1406; background: var(--gold); border-color: var(--gold); }
.table-wrap { overflow-x: auto; border-radius: var(--r-panel); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--steel); font-size: 13px; padding: 12px 14px; background: var(--navy-2); white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid rgba(34, 50, 95, .7); vertical-align: top; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(22, 36, 77, .45); }
.sub { display: block; color: var(--steel); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--steel); font-size: 14px; }
.empty { padding: 36px 20px; text-align: center; color: var(--steel); display: grid; gap: 6px; justify-items: center; }
.empty b { color: var(--ivory); font-family: var(--display); font-weight: 500; }
.empty-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  color: var(--jade); background: rgba(79, 178, 134, .12); box-shadow: 0 0 0 6px rgba(79, 178, 134, .05); }
.empty-ico svg { width: 22px; height: 22px; }

/* ---------- донат ---------- */
.donate-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.donate-hero {
  border-radius: var(--r-emblem); padding: 26px; position: relative; overflow: hidden;
  background: radial-gradient(500px 220px at 100% 0, rgba(246, 215, 122, .18), transparent 70%), linear-gradient(160deg, #13204A, #0C1430);
  border: 1px solid rgba(226, 177, 60, .45);
}
.donate-hero.expired { border-color: var(--line); filter: saturate(.6); }
.donate-name { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.05; color: var(--gold-hi); margin-top: 14px; }
.donate-hero.expired .donate-name { color: var(--steel); }
.ring { width: 140px; height: 140px; }
.facts { display: grid; gap: 0; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(34, 50, 95, .7); }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--steel); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- графики ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: rgba(34, 50, 95, .8); stroke-width: 1; }
.chart .axis { fill: var(--steel-dim); font-size: 11px; font-family: var(--text); }
.chart rect.bar { transition: opacity .15s; }
.chart rect.bar:hover { opacity: .8; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--steel); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .c-warn { background: var(--gold); }
.legend .c-ban { background: var(--ember); }
.legend .c-mute { background: #6E86D6; }

/* ---------- уведомления ---------- */
.bell { position: relative; }
.bell .dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--ember); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.popover {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(380px, 92vw); z-index: 40;
  background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9);
  padding: 14px; transform-origin: top right; animation: pop .16s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } }
.popover ul { list-style: none; margin: 8px 0; padding: 0; max-height: 340px; overflow: auto; }
.popover li { padding: 10px 4px; border-top: 1px solid rgba(34, 50, 95, .7); font-size: 14px; }
.popover li:first-child { border-top: 0; }
.popover time { display: block; color: var(--steel-dim); font-size: 12px; }

/* ---------- окна, тосты ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(3, 6, 14, .72); display: grid; place-items: center; padding: 16px; z-index: 60; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--navy); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 16px; animation: pop .18s var(--ease); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 10px; z-index: 80; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: var(--deep); border: 1px solid #2E4280; box-shadow: var(--shadow); font-size: 14px; animation: pop .18s var(--ease); }
.toast.ok { border-color: rgba(79, 178, 134, .55); }
.toast.err { border-color: rgba(229, 72, 77, .6); }

/* ---------- админ-панель ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; color: var(--steel); padding: 10px 14px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ivory); }
.tabs button[aria-selected="true"] { color: var(--ivory); border-bottom-color: var(--gold); }
.search-box { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--navy); border: 1px solid var(--line); border-radius: 12px; z-index: 20; overflow: hidden; box-shadow: var(--shadow); }
.suggest button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; background: transparent; border: 0; border-top: 1px solid rgba(34, 50, 95, .6); cursor: pointer; text-align: left; }
.suggest button:first-child { border-top: 0; }
.suggest button:hover, .suggest button.active { background: var(--deep); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--deep); color: var(--steel); }
.tag.gold { background: rgba(226, 177, 60, .14); color: var(--gold); }
.actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.queue-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(34, 50, 95, .7); font-size: 14px; }
.queue-item:first-child { border-top: 0; }

/* ---------- скелетоны ---------- */
.bone { display: block; border-radius: 6px; background: linear-gradient(90deg, #121D3C 0%, #1A2850 45%, #121D3C 90%); background-size: 220% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.sk-head { gap: 10px; width: min(520px, 100%); }
.sk-h1 { height: 26px; width: 70%; }
.sk-line { height: 12px; width: 100%; }
.w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; }
.sk-num { height: 30px; width: 46px; margin-bottom: 6px; }
.stat .sk-line { margin-top: 6px; }
.sk-emblem { border-color: var(--line); }
.sk-emblem .stack { gap: 12px; }
.sk-hex { width: 96px; height: 106px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); border-radius: 0; }
.sk-bar { height: 8px; width: 100%; }
.sk-feed { display: grid; gap: 14px; margin-top: 18px; }
.sk-feed-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; }
.sk-feed-row .stack { gap: 8px; }
.sk-ico { width: 34px; height: 34px; border-radius: 10px; }
.sk-block { height: 200px; margin-top: 16px; }
.sk-block.short { height: 140px; }
.sk-filters { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; margin-bottom: 18px; }
.sk-input, .sk-seg { height: 42px; border-radius: var(--r-control); }
.sk-table { display: grid; padding: 4px 16px; background: var(--navy); }
.sk-row { display: grid; grid-template-columns: 1fr 2.4fr 1fr 90px; gap: 18px; padding: 16px 0; border-top: 1px solid rgba(34, 50, 95, .6); align-items: center; }
.sk-row:first-child { border-top: 0; }
.sk-cell { height: 12px; width: 100% !important; }
.sk-pill { height: 22px; border-radius: 999px; }

/* ---------- аккаунт: устройства и восстановление ---------- */
.devices { list-style: none; margin: 14px 0 0; padding: 0; display: grid; }
.devices li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(34, 50, 95, .6); }
.devices li:first-child { border-top: 0; }
.dev-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--deep); color: var(--steel); }
.devices li.current .dev-ico { color: var(--gold); background: rgba(226, 177, 60, .12); }
.dev-ico svg { width: 20px; height: 20px; }
.dev-name { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note-top { margin-top: 14px; }
.link-btn { justify-self: center; border: 0; background: none; color: var(--gold); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.link-btn:hover { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- кнопки по смыслу ----------
   золото — основное действие (войти, сохранить), красная заливка — наказание,
   зелёный — снять наказание / вернуть, красный контур — осторожно (удалить, выйти везде) */
.btn-punish { background: var(--ember-solid); border-color: var(--ember-solid); color: #fff; }
.btn-punish:hover { background: #E04449; border-color: #FF7A7E; }
.btn-jade { background: rgba(79, 178, 134, .1); border-color: rgba(79, 178, 134, .5); color: #8EE0BB; }
.btn-jade:hover { background: rgba(79, 178, 134, .2); border-color: var(--jade); }

/* Загрузка на кнопке: спиннер вместо текста, размер кнопки не меняется */
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; opacity: 1; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-gold.is-busy::after { border-color: rgba(26, 19, 5, .25); border-top-color: #1A1305; }
.btn-sm.is-busy::after { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Вкладки второго уровня (внутри профиля игрока) — таблетками, как фильтры */
.tabs.pills { border-bottom: 0; gap: 6px; margin-bottom: 18px; }
.tabs.pills button { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; margin: 0; font-size: 13px; }
.tabs.pills button:hover { border-color: var(--line-hi); }
.tabs.pills button[aria-selected="true"] { background: var(--deep); color: var(--gold-hi); border-color: var(--line-hi); }

/* Плашка доната: свой металл для каждого ранга */
/* D.MODER — золото (базовая .plate), D.ADMIN — платина, SPONSOR — изумруд, SECOND — рубин, FIRST — обсидиан с золотом */
.plate.platinum {
  background: linear-gradient(115deg, #F6F9FF 0%, #C6D4F4 28%, #FFFFFF 48%, #AFC0E8 70%, #E2E9FB 100%); color: #121C36;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 0 rgba(0, 0, 0, .14), 0 0 22px -6px rgba(198, 212, 244, .8);
}
.plate.emerald {
  background: linear-gradient(180deg, #7FE3B4, #2FA672 60%, #1D7550); color: #04170E;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(0, 0, 0, .2), 0 0 20px -8px rgba(79, 178, 134, .9);
}
.plate.ruby {
  background: linear-gradient(180deg, #FF8C95, #D8304A 60%, #9C1730); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(0, 0, 0, .22), 0 0 20px -8px rgba(229, 72, 77, .9);
}
.plate.obsidian {
  background: linear-gradient(160deg, #2A2F3D, #0B0D14 70%); color: var(--gold-hi);
  box-shadow: 0 0 0 1px var(--gold), inset 0 1px 0 rgba(246, 215, 122, .35), 0 0 24px -6px rgba(226, 177, 60, .75);
}
.plate.obsidian svg { color: var(--gold); }
.donate-hero.platinum .donate-name { color: #E2E9FB; }
.donate-hero.emerald .donate-name { color: #7FE3B4; }
.donate-hero.ruby .donate-name { color: #FF8C95; }
.donate-hero.platinum { border-color: rgba(198, 212, 244, .5); }
.donate-hero.emerald { border-color: rgba(79, 178, 134, .55); }
.donate-hero.ruby { border-color: rgba(216, 48, 74, .55); }
.stat.info .stat-value { color: var(--gold); }

/* Пустые состояния: иконка и мягкий акцент */
.empty { border: 1px dashed var(--line); border-radius: var(--r-panel); background: radial-gradient(420px 160px at 50% 0, rgba(138, 155, 196, .06), transparent 70%); }
.panel .empty { border: 0; background: none; }
.empty-ico.neutral { color: var(--steel); background: rgba(138, 155, 196, .1); box-shadow: 0 0 0 6px rgba(138, 155, 196, .04); }

/* ---------- адаптивность ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-hero, .donate-card, .actions-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 22px; gap: 18px; }
  .auth-points { display: none; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: 68px; left: 0; bottom: 0; height: auto; width: 270px; z-index: 50; background: var(--abyss);
    transform: translateX(-102%); transition: transform .22s var(--ease); box-shadow: 20px 0 50px -20px rgba(0, 0, 0, .9);
  }
  .sidebar.open { transform: none; }
  .user-chip .name { display: none; }
  .filters, .filters.with-selects { grid-template-columns: 1fr 1fr; }
  .filters .field.grow, .filters .field:last-child { grid-column: 1 / -1; }
  .filters.simple .field.grow { grid-column: auto; }
  .segmented { display: flex; }
  .segmented button { flex: 1; padding: 0 6px; }
  .warn-summary { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .brand-name { font-size: 14px; }
}
@media (max-width: 560px) {
  .grid-2, .form-row { grid-template-columns: minmax(0, 1fr); }
  .grid-4, .grid-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .user-chip { display: none; }
  .brand img { width: 34px; height: 34px; }
  .brand-sub { letter-spacing: .12em; font-size: 9.5px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 24px; }
  .emblem { grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 18px; align-items: start; }
  .emblem-gauges { grid-template-columns: minmax(0, 1fr); gap: 14px; grid-column: 1 / -1; }
  .emblem-body { display: contents; }
  .emblem-top { flex-direction: column; gap: 10px; }
  .restriction { grid-column: 1 / -1; }
  .hexframe { width: 76px; height: 84px; }
  .hexframe-inner { width: 68px; height: 76px; }
  .hexframe-inner img { width: 50px; height: 50px; }
  .filters.simple { grid-template-columns: minmax(0, 1fr); }
  .sk-filters { grid-template-columns: minmax(0, 1fr); }
  .sk-row { grid-template-columns: 1fr 1fr; }
  .devices li { grid-template-columns: 40px minmax(0, 1fr); }
  .devices li > .btn { grid-column: 2; justify-self: start; }
  .bulk-bar { top: 74px; }
  .table-wrap td.pick { grid-template-columns: minmax(0, 1fr); }
  .main { padding-top: 20px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-sub { letter-spacing: .2em; }
  td, th { padding: 10px; }
  .filters > .btn { grid-column: 1 / -1; }
  /* Таблицы истории — карточками с подписями полей */
  .table-wrap { border: 0; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 6px 14px; margin-bottom: 10px; }
  .table-wrap td { border-top: 1px solid rgba(34, 50, 95, .6); padding: 9px 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .table-wrap td:first-child { border-top: 0; }
  .table-wrap td::before { content: attr(data-label); color: var(--steel-dim); font-size: 13px; }
  .table-wrap td:not([data-label])::before, .table-wrap td[data-label=""]::before { content: none; }
  .table-wrap td[data-label=""], .table-wrap td:not([data-label]) { grid-template-columns: minmax(0, 1fr); }
  tbody tr:hover { background: var(--navy); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bone { background: #16224A; }
}

/* Выпадающие списки в стиле темы (своя стрелка вместо системной) */
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E2B13C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
select.input option { background: var(--navy); color: var(--ivory); }

/* Переключатель «Выданные мной / Полученные» над историей */
.mode-switch { margin-bottom: 16px; }
.mode-switch .segmented button { padding: 0 16px; font-size: 14px; }

/* Источники данных в админке */
.tag.red { background: rgba(229, 72, 77, .14); color: #FF9EA1; }
.tag.green { background: rgba(79, 178, 134, .14); color: #8EE0BB; }
.sources { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; }
.sources li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid rgba(46, 66, 120, .55); }
.sources li:first-child { border-top: 0; }
.src-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: var(--jade); box-shadow: 0 0 0 4px rgba(79, 178, 134, .12); }
.sources li.miss .src-dot { background: var(--ember); box-shadow: 0 0 0 4px rgba(229, 72, 77, .14); }
.src-name { font-weight: 600; }
.sources code { font-size: 12.5px; color: var(--ivory); background: #0A1226; padding: 1px 6px; border-radius: 5px; }
.err-text { color: #FF9EA1; }
pre.cmd { margin: 12px 0; padding: 12px 14px; border-radius: var(--r-control); background: #0A1226; border: 1px solid var(--line);
  color: var(--gold-hi); font-size: 13px; line-height: 1.7; overflow-x: auto; white-space: pre; }

/* ================= сообщения: чат донатеров, поддержка, друзья ================= */
.nav-link { position: relative; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--ember-solid); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1;
}
.nav-badge[hidden] { display: none; }

.chat {
  display: flex; flex-direction: column; min-height: 460px; height: calc(100vh - 230px); height: calc(100dvh - 230px);
  background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--highlight), var(--shadow); overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--navy-2); }
.chat-head-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 12px; scrollbar-color: #2E4278 transparent; }
.chat-list { display: flex; flex-direction: column; }
.chat-more { display: flex; justify-content: center; padding: 6px 0 10px; }
.chat-empty { padding: 40px 18px; }
.chat-empty .empty { border: 0; background: none; }

.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 18px 6px; color: var(--steel-dim); font-size: 12px; font-weight: 600; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.msg { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; padding: 7px 18px 3px; }
.msg.grouped { padding-top: 1px; }
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg.mine .msg-name { color: var(--gold-hi); }
.msg-ava img, .msg-ava .avatar-fallback { width: 36px; height: 36px; border-radius: 10px; }
.msg-gutter { display: flex; justify-content: center; }
.msg-gutter time { opacity: 0; font-size: 10.5px; color: var(--steel-dim); padding-top: 3px; }
.msg:hover .msg-gutter time { opacity: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 1px; }
.msg-name { font-weight: 700; font-size: 14.5px; }
.msg-head time { font-size: 11.5px; color: var(--steel-dim); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 14.5px; }
.msg-body.deleted { color: var(--steel-dim); font-style: italic; font-size: 13px; }
.msg-del {
  align-self: start; opacity: 0; border: 0; background: var(--deep); color: var(--steel); width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer; transition: opacity .12s;
}
.msg-del svg { width: 15px; height: 15px; }
.msg:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
.msg-del:hover { color: #FF9EA1; background: rgba(229, 72, 77, .15); }
@media (hover: none) { .msg-del { opacity: .7; } }
.msg-system { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 10px 18px; font-size: 13px; color: var(--steel); }
.msg-system span { background: var(--navy-2); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; text-align: center; }
.msg-system time { font-size: 11px; color: var(--steel-dim); }

/* плашка ранга у ника */
.rank { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; line-height: 1.3;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1A1305; }
.rank.platinum { background: linear-gradient(115deg, #F6F9FF, #C6D4F4 45%, #FFFFFF 60%, #B9CCEB); color: #121C36; }
.rank.emerald { background: linear-gradient(180deg, #7FE3B4, #2FA672); color: #04170E; }
.rank.ruby { background: linear-gradient(180deg, #FF8C95, #D8304A); color: #fff; }
.rank.obsidian { background: #0B0D14; color: var(--gold-hi); box-shadow: inset 0 0 0 1px var(--gold); }
.rank.admin { background: rgba(138, 155, 196, .16); color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(138, 155, 196, .35); }

.chat-composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--navy-2); position: relative; }
textarea.input.chat-input { flex: 1; resize: none; height: 44px; min-height: 44px; max-height: 180px; line-height: 1.45; padding-top: 11px; padding-bottom: 11px; }
.chat-send { width: 44px; height: 44px; padding: 0; flex: none; }
.chat-send svg { width: 19px; height: 19px; }
.chat-counter { position: absolute; right: 72px; bottom: 18px; font-size: 11.5px; color: var(--steel-dim); }
.chat-readonly { padding: 16px 18px; border-top: 1px solid var(--line); background: var(--navy-2); color: var(--steel); font-size: 14px; text-align: center; }

.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--steel); font-weight: 600; font-size: 14px; text-decoration: none; }
.back-link:hover { color: var(--gold-hi); }
.back-link svg { width: 17px; height: 17px; }
.ticket-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-top b { font-size: 16px; }

/* обращения */
.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticket {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit;
  background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-panel); box-shadow: var(--highlight);
}
.ticket:hover { border-color: var(--line-hi); }
.ticket.unread { border-color: rgba(226, 177, 60, .55); }
.ticket-main { display: grid; gap: 4px; min-width: 0; }
.ticket-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-ico, .cat-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--deep); color: var(--steel); }
.ticket-ico svg, .cat-ico svg { width: 21px; height: 21px; }
.ticket-ico.appeal, .cat-ico.appeal { color: #FF9EA1; background: rgba(229, 72, 77, .12); }
.ticket-ico.question, .cat-ico.question { color: var(--gold); background: rgba(226, 177, 60, .12); }
.ticket-ico.feedback, .cat-ico.feedback { color: #8EE0BB; background: rgba(79, 178, 134, .12); }
.cat-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat-card {
  display: grid; gap: 8px; justify-items: start; text-align: left; padding: 16px; border-radius: var(--r-panel); cursor: pointer;
  background: #0A1226; border: 1px solid var(--line); color: var(--ivory); font: inherit;
}
.cat-card:hover { border-color: var(--line-hi); }
.cat-card[aria-checked="true"] { border-color: var(--gold); background: rgba(226, 177, 60, .06); box-shadow: 0 0 0 3px rgba(226, 177, 60, .12); }
.note { padding: 12px 14px; border-radius: var(--r-control); background: #0A1226; border: 1px dashed var(--line); color: var(--steel); font-size: 14px; }
.appeal-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 18px;
  border-bottom: 1px solid var(--line); background: rgba(229, 72, 77, .05);
}
.appeal-card b { display: block; margin: 2px 0; }

/* друзья */
.add-friend { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 12px; }
.friends { list-style: none; margin: 6px 0 0; padding: 0; display: grid; }
.friend { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid rgba(46, 66, 120, .55); }
.friend:first-child { border-top: 0; }
.friend-ava { position: relative; display: inline-block; }
.friend-ava img, .friend-ava .avatar-fallback { width: 40px; height: 40px; border-radius: 12px; }
.friend-ava.on::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 3px var(--navy); }
.friend-main { display: grid; gap: 3px; min-width: 0; }
.friend-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.online { color: var(--jade); font-size: 13px; font-weight: 600; }
.requests { border-color: rgba(226, 177, 60, .45); }

@media (max-width: 860px) {
  .chat { height: calc(100dvh - 150px); min-height: 360px; }
  .chat-page .page-head p { display: none; }
  .chat-page .page-head { margin-bottom: 12px; }
  .cat-cards { grid-template-columns: minmax(0, 1fr); }
  .appeal-card { grid-template-columns: minmax(0, 1fr); }
  .msg { padding-left: 12px; padding-right: 12px; gap: 10px; }
  .friend { grid-template-columns: 40px minmax(0, 1fr); }
  .friend > .presets { grid-column: 2; }
  .ticket { grid-template-columns: 42px minmax(0, 1fr); }
  .ticket > .pill, .ticket > span:last-child { grid-column: 2; justify-self: start; }
  .add-friend { grid-template-columns: minmax(0, 1fr); }
}

/* Плитки «выдано»: работа модератора — нейтрально-золотой акцент, без «тревожного» красного */
.stat.work .stat-value { color: var(--ivory); }
.stat-sub.work { color: var(--gold); }
.priv-check { margin: 6px 0 14px; padding-top: 14px; border-top: 1px solid rgba(46, 66, 120, .55); }
.priv-check h3 { font-size: 15px; margin: 0 0 4px; }
.note.diag { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; overflow-wrap: anywhere; }
