/* Палитра Discord */
:root {
  --bg-rail: #1e1f22;
  --bg-top: #1e1f22;
  --bg-side: #2b2d31;
  --bg-main: #313338;
  --bg-card: #2b2d31;
  --bg-input: #1e1f22;
  --bg-hover: #35373c;
  --bg-active: #404249;
  --text: #dbdee1;
  --text-strong: #f2f3f5;
  --muted: #949ba4;
  --faint: #6d6f78;
  --blurple: #5865f2;
  --blurple-hover: #4752c4;
  --green: #23a55a;
  --green-hover: #1a8b4a;
  --red: #da373c;
  --red-hover: #a12828;
  --link: #00a8fc;
  --radius: 8px;
  --top-h: 52px;
  font-synthesis: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text);
  font: 15px/1.4 "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--text-strong); margin: 0; font-weight: 700; }
h1 { font-size: 24px; }
h2 { font-size: 16px; margin-bottom: 4px; }
code { font-family: Consolas, "Andale Mono", monospace; background: var(--bg-input); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button { font: inherit; }

/* ---------- верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 16px;
  background: var(--bg-top);
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.topbar-left { display: flex; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-strong); font-weight: 700; font-size: 18px; text-decoration: none !important; }
.brand b, .hero h1 b { color: var(--blurple); font-weight: 800; }
.brand-mark, .hero-mark, .rail-icon.home {
  display: grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, var(--blurple), #eb459e);
}
.brand-mark { width: 26px; height: 26px; border-radius: 7px; font-size: 15px; }
.topbar-right { display: flex; justify-content: flex-end; align-items: center; gap: 18px; }
.top-link { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.top-link svg { color: var(--blurple); }
.top-link:hover { color: var(--text-strong); text-decoration: none; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 4px; display: none; }
.icon-btn:hover { color: var(--text-strong); background: var(--bg-hover); }

.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--text-strong);
  cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.user-chip:hover { background: var(--bg-hover); }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; }
.dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: #111214; border-radius: var(--radius); padding: 6px; box-shadow: 0 8px 16px rgba(0,0,0,.35);
}
.user-menu.open .dropdown { display: block; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 4px;
  color: var(--text); background: none; border: 0; cursor: pointer; font-size: 14px; text-decoration: none;
}
.dropdown a:hover, .dropdown button:hover { background: var(--blurple); color: #fff; }
.dropdown form { margin: 0; }
.dropdown .danger-text { color: #f23f43; }
.dropdown .danger-text:hover { background: var(--red); color: #fff; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--blurple); color: #fff; border: 0; border-radius: 4px;
  padding: 0 16px; height: 38px; font-weight: 500; font-size: 14px; cursor: pointer;
  text-decoration: none !important; transition: background .17s; white-space: nowrap;
}
.btn:hover { background: var(--blurple-hover); }
.btn.big { height: 44px; padding: 0 24px; font-size: 16px; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.secondary { background: #4e5058; }
.btn.secondary:hover { background: #6d6f78; }
.btn.green { background: var(--green); }
.btn.green:hover { background: var(--green-hover); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: var(--red-hover); }
.btn.link { background: none; color: var(--text); }
.btn.link:hover { text-decoration: underline; background: none; }

/* ---------- каркас панели ---------- */
.app { display: flex; height: calc(100vh - var(--top-h)); }

.rail {
  width: 72px; flex: 0 0 72px; background: var(--bg-rail);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 0; overflow-y: auto; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-item { position: relative; display: block; width: 72px; display: flex; justify-content: center; text-decoration: none !important; }
.rail-icon {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; background: var(--bg-main); color: var(--text-strong);
  font-weight: 600; font-size: 15px; transition: border-radius .15s, background .15s, color .15s;
}
.rail-item:hover .rail-icon, .rail-item.active .rail-icon { border-radius: 16px; }
.rail-item:hover .rail-icon:not(img):not(.home):not(.add) { background: var(--blurple); color: #fff; }
.rail-icon.add { color: var(--green); }
.rail-item:hover .rail-icon.add { background: var(--green); color: #fff; }
.rail-pill {
  position: absolute; left: 0; top: 50%; width: 4px; height: 0; margin-top: 0;
  background: #fff; border-radius: 0 4px 4px 0; transition: height .15s, margin-top .15s;
}
.rail-item:hover .rail-pill { height: 20px; margin-top: -10px; }
.rail-item.active .rail-pill { height: 40px; margin-top: -20px; }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: #35363c; flex: 0 0 2px; }

.sidebar {
  width: 280px; flex: 0 0 280px; overflow-y: auto; padding: 12px 10px 24px;
  background: var(--bg-side);
  border-radius: 12px 0 0 0;
  scrollbar-width: thin; scrollbar-color: #1a1b1e transparent;
}
.sidebar-guild {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 20px 10px; margin-bottom: 8px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(88,101,242,.18), transparent);
}
.sidebar-guild img, .sidebar-guild .noicon { width: 72px; height: 72px; border-radius: 50%; }
.sidebar-guild-name { color: var(--text-strong); font-weight: 700; font-size: 16px; word-break: break-word; }

.nav-section { margin-top: 12px; }
.nav-section summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 4px; padding: 6px 8px;
  color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary:hover { color: var(--text); }
.chev { transition: transform .15s; }
.nav-section[open] .chev { transform: rotate(90deg); }
.nav-item {
  display: flex; align-items: center; gap: 10px; margin: 2px 0; padding: 8px 10px; border-radius: 4px;
  color: var(--muted); font-weight: 500; text-decoration: none !important;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--bg-active); color: #fff; }
.nav-icon { width: 20px; text-align: center; }

.content { flex: 1; overflow-y: auto; padding: 32px 40px 24px; display: flex; flex-direction: column; }
.content > form.settings-form { flex: 1 0 auto; display: flex; flex-direction: column; }
.content > * { max-width: 1000px; }

/* ---------- обычные страницы ---------- */
.page { max-width: 1100px; margin: 0 auto; padding: 32px 20px 64px; }
.page.narrow { max-width: 860px; }
.page-head { margin-bottom: 20px; }
.page-head p { margin: 6px 0 0; }
.page-head.center { text-align: center; }

.hero { text-align: center; padding: 56px 0 40px; }
.hero-mark { width: 88px; height: 88px; border-radius: 24px; font-size: 44px; margin: 0 auto 20px; box-shadow: 0 10px 30px rgba(88,101,242,.35); }
.hero-mark.err { background: var(--red); box-shadow: none; }
.hero h1 { font-size: 44px; margin-bottom: 12px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 auto 28px; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature { background: var(--bg-card); border-radius: var(--radius); padding: 20px; }
.feature span { font-size: 28px; }
.feature h3 { margin: 10px 0 6px; font-size: 16px; }
.feature p { color: var(--muted); margin: 0; font-size: 14px; }

/* ---------- карточки и формы ---------- */
.card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; flex-shrink: 0; }
.card > h2 + p, .card .muted.small { margin-top: 2px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.count { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 6px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; border-left: 4px solid; }
.alert.ok { background: rgba(35,165,90,.12); border-color: var(--green); }
.alert.err { background: rgba(218,55,60,.12); border-color: var(--red); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 14px; }
.field {
  display: flex; flex-direction: column; gap: 8px; margin-top: 14px;
  color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.form-grid .field { margin-top: 0; }
input, select, textarea {
  width: 100%; background: var(--bg-input); color: var(--text); border: 0; border-radius: 4px;
  padding: 10px; font: inherit; font-size: 15px; text-transform: none; letter-spacing: normal; font-weight: 400;
  outline: none; transition: box-shadow .1s;
}
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 2px var(--blurple); }
textarea { resize: vertical; min-height: 90px; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
select { cursor: pointer; }
.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row-form .field { margin-top: 14px; }
.row-form .grow { flex: 1 1 260px; }
.row-form > .btn { margin-bottom: 1px; }
.stack-form .field { margin-top: 14px; }
.stack-form > div:last-child { margin-top: 16px; }
.prefix-input { display: flex; align-items: center; background: var(--bg-input); border-radius: 4px; }
.prefix-input span { padding-left: 10px; color: var(--muted); font-size: 15px; font-weight: 600; text-transform: none; }
.prefix-input input { padding-left: 4px; }
.prefix-input:focus-within { box-shadow: 0 0 0 2px var(--blurple); }
.prefix-input input:focus { box-shadow: none; }

/* переключатель в стиле Discord */
.switch { position: relative; width: 40px; height: 24px; flex: 0 0 40px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.slider { position: absolute; inset: 0; background: #80848e; border-radius: 12px; transition: background .2s; }
.slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 2px var(--blurple); }

.lang-options { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.lang-option {
  display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 1 1 200px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--bg-input); border: 2px solid transparent;
  color: var(--text-strong); font-weight: 600;
}
.lang-option input { width: auto; accent-color: var(--blurple); }
.lang-option:has(input:checked) { border-color: var(--blurple); background: rgba(88,101,242,.12); }
.lang-flag { font-size: 22px; }

/* плашка несохранённых изменений */
.savebar {
  position: sticky; bottom: 0; z-index: 40; margin: auto auto 0; flex: 0 0 auto;
  width: min(720px, 100%);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: var(--radius);
  background: #111214; color: var(--text-strong); font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transform: translateY(24px); opacity: 0; pointer-events: none; transition: transform .25s ease, opacity .25s;
}
.savebar.show { transform: none; opacity: 1; pointer-events: auto; }
.savebar-actions { display: flex; gap: 8px; }

/* ---------- списки ---------- */
.list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px;
  background: rgba(0,0,0,.08);
}
.list-row:hover { background: var(--bg-hover); }
.list-row form { margin: 0 0 0 auto; }
.role { color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.price { color: var(--text-strong); font-weight: 600; }
.cmd-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cmd-name { color: #c9cdfb; background: rgba(88,101,242,.15); font-weight: 600; align-self: flex-start; }
.cmd-response { color: var(--text); font-size: 14px; white-space: pre-wrap; word-break: break-word; max-height: 4.2em; overflow: hidden; }
.empty { text-align: center; padding: 28px 0 12px; font-size: 32px; }
.empty p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* топ */
.top-row { gap: 14px; }
.place { width: 28px; text-align: center; font-weight: 800; color: var(--muted); }
.place-1 { color: #f0b232; } .place-2 { color: #c0c4cc; } .place-3 { color: #cd7f32; }
.avatar { width: 36px; height: 36px; border-radius: 50%; }
.top-name { flex: 1; color: var(--text-strong); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-meta { display: flex; flex-direction: column; align-items: flex-end; min-width: 76px; }
.top-meta b { color: var(--text-strong); font-size: 14px; }
.top-meta small { color: var(--faint); font-size: 11px; text-transform: uppercase; }
.top-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.top-head img { width: 72px; height: 72px; border-radius: 50%; }
.top-head p { margin: 4px 0 0; }

/* обзор */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--bg-card); border-radius: var(--radius); padding: 16px; }
.stat-value { color: var(--text-strong); font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; margin-top: 4px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.quick-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-card); color: var(--text); text-decoration: none !important; transition: background .15s;
}
.quick-card:hover { background: var(--bg-hover); }
.quick-card span { font-size: 24px; }
.quick-card b { display: block; color: var(--text-strong); }
.quick-card small { color: var(--muted); }

/* выбор сервера */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.guild-card {
  position: relative; overflow: hidden; background: var(--bg-card); border-radius: var(--radius);
  padding: 0 16px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  color: var(--text); text-decoration: none !important; transition: transform .15s, box-shadow .15s;
}
.guild-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.guild-banner {
  width: calc(100% + 32px); height: 70px; margin-bottom: -36px;
  background: var(--blurple) center/cover; filter: blur(18px) brightness(.7); transform: scale(1.3);
}
.guild-card img, .guild-card .noicon { position: relative; width: 72px; height: 72px; border-radius: 50%; border: 4px solid var(--bg-card); }
.guild-card .name { font-weight: 700; color: var(--text-strong); word-break: break-word; }
.guild-card.nobot img, .guild-card.nobot .noicon { filter: grayscale(1); opacity: .6; }
.noicon { display: grid; place-items: center; background: var(--blurple); color: #fff; font-weight: 700; font-size: 20px; }

/* страница команд */
.search { max-width: 420px; margin: 18px auto 0; display: block; }
.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  background: var(--bg-card); color: var(--muted); border: 0; border-radius: 999px;
  padding: 7px 16px; cursor: pointer; font-weight: 600; font-size: 14px;
}
.tab:hover { color: var(--text-strong); background: var(--bg-hover); }
.tab.active { background: var(--blurple); color: #fff; }
.cmd-row .cmd-name { flex: 0 0 auto; }

/* ---------- адаптив ---------- */
.nav-backdrop { display: none; }
@media (max-width: 960px) {
  .icon-btn.menu-toggle { display: block; }
  .top-link span { display: none; }
  .user-chip span { display: none; }
  .rail, .sidebar {
    position: fixed; top: var(--top-h); bottom: 0; z-index: 25;
    transform: translateX(-110%); transition: transform .2s;
  }
  .rail { left: 0; }
  .sidebar { left: 72px; border-radius: 0; transform: translateX(calc(-100% - 80px)); }
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; }
  .brand { justify-self: start; }
  .topbar-right { gap: 12px; }
  body.nav-open .rail, body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: var(--top-h) 0 0 0; background: rgba(0,0,0,.5); z-index: 20; }
  .content { padding: 20px 16px 16px; }
  .brand span:last-child { font-size: 16px; }
  .top-meta:nth-of-type(n+3) { display: none; }
}

/* ---------- админка ---------- */
:root { --chart: #6f7af4; --chart-hover: #8c95f7; --grid: #3a3c42; }
.rail-icon.admin { color: #f0b232; }
.rail-item:hover .rail-icon.admin, .rail-item.active .rail-icon.admin { background: #f0b232; color: #1e1f22; }
.admin-badge { background: linear-gradient(135deg, #f0b232, #eb459e) !important; color: #fff; }
.admin-head { background: linear-gradient(180deg, rgba(240,178,50,.16), transparent); }
.stat-hint { color: var(--faint); font-size: 12px; margin-top: 6px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.two-col > .card { margin-bottom: 16px; }

.status-card { display: flex; align-items: center; gap: 14px; }
.status-card b { color: var(--text-strong); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.status-dot.on { background: var(--green); box-shadow: 0 0 0 4px rgba(35,165,90,.2); }
.status-dot.off { background: #80848e; box-shadow: 0 0 0 4px rgba(128,132,142,.2); }
.status-meta { display: flex; flex-direction: column; align-items: flex-end; margin-left: 24px; }
.status-card > div:not(.status-meta) { flex: 1; }
.status-meta small { color: var(--faint); font-size: 11px; text-transform: uppercase; }

/* столбчатая диаграмма */
.chart { position: relative; margin-top: 8px; }
.chart-plot { position: relative; height: 200px; margin-left: 44px; }
.chart-grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--grid); }
.chart-grid span { position: absolute; right: calc(100% + 8px); top: -8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; padding: 0 1px; cursor: default; outline: none; border-radius: 4px; }
.chart-col.hover, .chart-col:focus-visible { background: rgba(255,255,255,.04); }
.chart-bar { width: 100%; background: var(--chart); border-radius: 4px 4px 0 0; min-height: 2px; transition: background .1s; }
.chart-bar.zero { min-height: 0; }
.chart-col.hover .chart-bar { background: var(--chart-hover); }
.chart-x { display: flex; margin: 6px 0 0 44px; }
.chart-x span { flex: 1; color: var(--muted); font-size: 11px; text-align: center; white-space: nowrap; overflow: visible; }
.chart-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%); pointer-events: none;
  background: #111214; border-radius: 6px; padding: 6px 10px; box-shadow: 0 4px 12px rgba(0,0,0,.4);
  display: none; flex-direction: column; align-items: center; white-space: nowrap; z-index: 5;
}
.chart-tip.show { display: flex; }
.chart-tip b { color: var(--text-strong); font-size: 13px; }
.chart-tip span { color: var(--muted); font-size: 12px; }
.chart-table { margin-top: 12px; }
.chart-table summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.chart-table table { margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.chart-table td, .chart-table th { padding: 3px 16px 3px 0; text-align: left; color: var(--text); }
.chart-table th { color: var(--muted); font-weight: 600; }

/* горизонтальные полосы */
.hbars { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.hbar-row { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: 12px; }
.hbar-row .cmd-name { justify-self: start; }
.hbar-track { height: 10px; }
.hbar { height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; }
.hbar-value { color: var(--text-strong); font-weight: 600; text-align: right; font-size: 14px; }

.econ { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.econ > div { background: rgba(0,0,0,.12); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.econ span { font-size: 22px; }
.econ b { color: var(--text-strong); font-size: 18px; overflow-wrap: anywhere; }
.econ small { color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 600; }
.small-icon { font-size: 13px; }

/* таблица серверов */
.table-tools { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.table-tools .search { margin: 0; max-width: 360px; }
.check-inline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; cursor: pointer; }
.check-inline input { width: auto; accent-color: var(--blurple); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase;
  padding: 8px; border-bottom: 1px solid var(--grid); cursor: pointer; user-select: none; white-space: nowrap;
}
.data-table th:hover { color: var(--text-strong); }
.data-table th[data-dir="asc"]::after { content: " ▲"; }
.data-table th[data-dir="desc"]::after { content: " ▼"; }
.data-table td { padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,.04); white-space: nowrap; }
.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table .num { text-align: right; }
.data-table tr.inactive { opacity: .5; }
.g-cell { display: flex; align-items: center; gap: 10px; }
.g-cell img, .g-cell .noicon { width: 32px; height: 32px; border-radius: 50%; font-size: 12px; flex: 0 0 32px; }
.g-name { color: var(--text-strong); font-weight: 600; }
.g-id { color: var(--faint); font-size: 12px; font-family: Consolas, monospace; }
.tag { background: #4e5058; color: var(--text); font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 600; margin-left: 4px; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } .hbar-row { grid-template-columns: 110px 1fr 44px; } }

.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.content > .wide { max-width: 1400px; }

/* ---------- уведомления для посетителей ---------- */
body.app-layout { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
body.app-layout .app { flex: 1; min-height: 0; height: auto; }
.announcements { flex: 0 0 auto; }
.announcement {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 8px 48px; position: relative;
  color: #fff; font-weight: 500; font-size: 14px; text-align: center;
}
.ann-info { background: var(--blurple); }
.ann-success { background: var(--green); }
.ann-warning { background: #f0b232; color: #1e1f22; }
.ann-danger { background: var(--red); }
.ann-text { overflow-wrap: anywhere; }
.ann-link {
  flex: 0 0 auto; color: inherit; border: 1px solid currentColor; border-radius: 4px;
  padding: 2px 10px; font-weight: 600; font-size: 13px; text-decoration: none !important;
}
.ann-link:hover { background: rgba(255,255,255,.15); }
.ann-warning .ann-link:hover { background: rgba(0,0,0,.08); }
.ann-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: inherit; opacity: .8; cursor: pointer; padding: 4px; border-radius: 4px; display: flex;
}
.ann-close:hover { opacity: 1; background: rgba(0,0,0,.12); }

.ann-preview-wrap { margin: 8px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.ann-preview-wrap .announcement { border-radius: var(--radius); }
.char-count { align-self: flex-end; color: var(--faint); font-size: 12px; font-weight: 500; text-transform: none; }
#ann-form .row-between { margin-top: 16px; }
#ann-form .row-between b { color: var(--text-strong); }

.ann-row { align-items: flex-start; gap: 12px; }
.ann-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 10px; }
.ann-row-main { flex: 1; min-width: 0; }
.ann-row-text { color: var(--text-strong); overflow-wrap: anywhere; }
.ann-row-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 4px; }
.ann-row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ann-row-actions form { margin: 0; }
.badge-status { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: #4e5058; color: var(--text); }
.badge-status.st-live { background: rgba(35,165,90,.2); color: #57d28f; }
.badge-status.st-scheduled { background: rgba(240,178,50,.18); color: #f0b232; }

/* ---------- подписка ---------- */
:root { --gold: #f0b232; }
.plan-badge { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg-active); color: var(--muted); text-decoration: none; }
.plan-badge:hover { color: var(--text-strong); text-decoration: none; }
.plan-badge.on { background: rgba(240,178,50,.16); color: var(--gold); }
.prem-tag { font-size: 11px; font-weight: 700; color: var(--gold); margin-left: 6px; text-transform: uppercase; }
.limit-note { font-size: 13px; color: var(--muted); background: var(--bg-input); border-radius: 6px; padding: 8px 12px; margin: -4px 0 12px; }
.limit-note a { color: var(--gold); font-weight: 600; }
select:disabled { opacity: .55; cursor: not-allowed; }

.prem-hero { display: flex; align-items: center; gap: 20px; border: 1px solid transparent; }
.prem-hero.on { border-color: rgba(240,178,50,.35); background: linear-gradient(120deg, rgba(240,178,50,.10), var(--bg-card) 60%); }
.prem-star { font-size: 40px; width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-input); filter: grayscale(1); opacity: .6; }
.prem-hero.on .prem-star { filter: none; opacity: 1; background: rgba(240,178,50,.15); }
.prem-hero-text { flex: 1; min-width: 0; }
.prem-hero-text h2 { margin: 0 0 4px; }
.prem-hero-text p { margin: 0; }

.plan-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plan-table th { text-align: center; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 0 8px 10px; }
.plan-table td { padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.05); text-align: center; color: var(--text-strong); font-weight: 600; }
.plan-table td:first-child { text-align: left; color: var(--text); font-weight: 400; }
.plan-table td.no { color: var(--faint); }
.plan-table .prem-col { color: var(--gold); }
.plan-table td.yes { color: #57d28f; }

.steps { margin: 0 0 16px; padding-left: 20px; line-height: 1.7; }
code.copy { cursor: pointer; }
code.copy.copied::after { content: " ✓"; color: #57d28f; }

.chip-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip-option { position: relative; }
.chip-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.chip-option span { display: inline-block; padding: 7px 14px; border-radius: 999px; background: var(--bg-input); color: var(--text); font-weight: 500; cursor: pointer; border: 1px solid transparent; }
.chip-option input:checked + span { background: rgba(240,178,50,.16); color: var(--gold); border-color: rgba(240,178,50,.5); }
.chip-option input:focus-visible + span { outline: 2px solid var(--link); }

.prem-row { gap: 12px; }
.prem-main { flex: 1; min-width: 0; }
.prem-name { color: var(--text-strong); font-weight: 600; }
.prem-until { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hist-row { align-items: flex-start; gap: 10px; }
.hist-icon { width: 20px; text-align: center; color: var(--gold); }
@media (max-width: 700px) { .prem-hero { flex-direction: column; text-align: center; } .prem-until { align-items: flex-start; } }
