/* dashboard.html — панель управления Flux Bot. Стиль Flux: тёмный фон, градиент фиолетовый → синий, Manrope. */
:root {
  --bg: #07080c;
  --panel: #0e1017;
  --panel-2: #141722;
  --line: #20243a;
  --text: #eef0f7;
  --muted: #8a90a6;
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --sky: #38bdf8;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #38bdf8 100%);
  --ok: #34d399;
  --warn: #f59e0b;
  --err: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(900px 500px at 75% -10%, rgba(99, 102, 241, .14), transparent 70%), var(--bg);
  color: var(--text);
  font: 14px/1.5 "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.err { color: var(--err); }
[hidden] { display: none !important; }

.app { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: 100vh; padding: 12px; }

/* ---------- боковая панель ---------- */
.side { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side-head { padding: 20px 22px 6px; font-size: 17px; }
.side-search { display: flex; gap: 8px; padding: 12px 16px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; }
.search.big { height: 48px; margin: 18px 0 6px; padding: 0 16px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--muted); position: relative; transition: color .15s, border-color .15s; }
.icon-btn:hover { color: var(--text); border-color: #343a58; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }
.side-scroll { flex: 1; overflow-y: auto; padding: 4px 10px 14px; scrollbar-width: thin; scrollbar-color: #262b44 transparent; }
.side-cap { padding: 16px 12px 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.side-empty { padding: 14px 22px; color: var(--muted); font-size: 13px; }
.srv { width: 100%; display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 14px; text-align: left; transition: background .15s; }
.srv:hover { background: var(--panel-2); }
.srv b { display: block; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv small { color: var(--muted); font-size: 12px; }
.srv span { min-width: 0; }
.gi { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; flex: none; }
.gi-txt { display: grid; place-items: center; background: linear-gradient(135deg, #2a2f4a, #1b1f31); color: #c9ccff; font-weight: 800; font-size: 15px; }
.gi.lg { width: 48px; height: 48px; border-radius: 50%; }
.gi.xl { width: 96px; height: 96px; border-radius: 28px; font-size: 30px; }
.side-guild { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.side-guild b { flex: 1; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-guild > svg { color: var(--muted); }
.nav-i, .nav-s { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-align: left; color: #d4d7e6; font-weight: 600; font-size: 15px; transition: background .15s, color .15s; }
.nav-i:hover, .nav-s:hover { background: var(--panel-2); color: #fff; }
.nav-i.on, .nav-s.on { background: linear-gradient(90deg, rgba(124, 108, 255, .22), rgba(124, 108, 255, .06)); color: #fff; box-shadow: inset 2px 0 0 var(--violet); }
.nav-i.on svg:first-child { color: #a99bff; }
.nav-i.dim span { opacity: .5; }
.nav-i span { flex: 1; }
.nav-i em { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 8px; border-radius: 99px; background: var(--grad); color: #fff; }
.nav-i .chev { color: var(--muted); }
.nav-sub { display: none; padding: 2px 0 6px 18px; border-left: 1px solid var(--line); margin-left: 21px; }
.nav-sub.open { display: block; }
.nav-s { font-size: 14px; padding: 8px 12px; }
.nav-s svg { width: 16px; height: 16px; }
.side-back { margin: 0 10px 12px; padding: 10px 12px; border-radius: 12px; text-align: left; color: var(--muted); font-weight: 600; }
.side-back:hover { background: var(--panel-2); color: var(--text); }

/* ---------- шапка ---------- */
.main-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(90deg, rgba(139, 92, 246, .08), rgba(56, 189, 248, .04)), var(--panel); }
.top-note { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }
.top-note b { color: #c4b5fd; }
.top-right { display: flex; align-items: center; gap: 10px; }
.burger { display: none; }
.lang { display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 8px; border-radius: 12px; color: var(--muted); }
.flag-ru { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(#fff 33%, #2563eb 33% 66%, #ef4444 66%); }
.me { position: relative; }
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; flex: none; }
.me-menu { position: absolute; right: 0; top: 48px; z-index: 30; min-width: 210px; padding: 12px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.me-menu b { padding: 0 8px; }
.me-menu small { padding: 0 8px 8px; color: var(--muted); }
.me-menu a, .me-menu button { padding: 8px; border-radius: 10px; text-align: left; font-weight: 600; }
.me-menu a:hover, .me-menu button:hover { background: rgba(255, 255, 255, .05); }
.me-menu button { color: var(--err); }

/* ---------- основная часть ---------- */
.main { flex: 1; overflow-y: auto; min-height: 0; padding: 28px 18px 120px; scrollbar-width: thin; scrollbar-color: #262b44 transparent; }
.loading { text-align: center; color: var(--muted); padding: 120px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 700; transition: transform .15s, filter .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(99, 102, 241, .8); }
.btn.ghost { background: var(--panel-2); border: 1px solid var(--line); }
.btn.warn { border: 1px solid rgba(245, 158, 11, .5); color: #fbbf24; background: rgba(245, 158, 11, .08); }
.btn.big { height: 52px; padding: 0 26px; font-size: 15px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg.dc { fill: currentColor; stroke: none; width: 20px; height: 20px; }

.hello { max-width: 560px; margin: 8vh auto 0; text-align: center; padding: 44px 32px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); }
.hello-logo { width: 72px; height: 72px; border-radius: 20px; box-shadow: 0 16px 50px -12px rgba(124, 108, 255, .8); }
.hello h1 { margin-top: 22px; font-size: 30px; letter-spacing: -.03em; }
.hello p { margin-top: 10px; color: #c3c7d8; }
.hello-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 26px 0 16px; }
.hello small { color: var(--muted); font-size: 12.5px; }

.pick { min-height: calc(100vh - 230px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; position: relative; }
.wave-hand { font-size: 110px; line-height: 1; transform-origin: 70% 80%; animation: wave 2.4s ease-in-out infinite; filter: drop-shadow(0 18px 40px rgba(124, 108, 255, .35)); }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .wave-hand { animation: none; } }
.pill { padding: 10px 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; font-size: 16px; }
.tip { position: absolute; bottom: -80px; color: var(--muted); font-size: 13px; max-width: 640px; }
.pick h2 { font-size: 26px; }

.page { max-width: 1060px; margin: 0 auto; }
.page h1 { font-size: 34px; letter-spacing: -.03em; line-height: 1.15; }
.mod-res { margin-top: 8px; padding: 6px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; }
.mod-res button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-align: left; }
.mod-res button:hover { background: rgba(255, 255, 255, .04); }
.mod-res small { display: block; color: var(--muted); font-size: 12.5px; }
.mod-res p { padding: 10px 12px; }
.pro { margin-top: 18px; display: flex; gap: 20px; align-items: center; padding: 24px 26px; border-radius: 20px; border: 1px solid #2c2852; background: linear-gradient(120deg, rgba(139, 92, 246, .16), rgba(56, 189, 248, .06)), var(--panel); }
.pro > div { flex: 1; }
.pro b { font-size: 18px; }
.pro p { margin-top: 6px; color: #c3c7d8; max-width: 620px; }
.pro img { width: 92px; height: 92px; border-radius: 26px; opacity: .9; box-shadow: 0 20px 60px -10px rgba(124, 108, 255, .8); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chips span { padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.notice { margin-top: 16px; display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 18px; border: 1px solid rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .05); }
.notice > span { font-size: 24px; }
.notice > div { flex: 1; }
.notice em { font-style: normal; font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(245, 158, 11, .15); color: #fbbf24; margin-left: 6px; }
.notice p { color: #c3c7d8; font-size: 13px; margin-top: 4px; }
.cap { margin: 28px 0 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.recent { display: flex; flex-wrap: wrap; gap: 8px; }
.recent button { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; }
.recent button:hover { border-color: #3a3f66; }
.recent svg { width: 16px; height: 16px; color: #a99bff; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mcard { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-align: left; transition: border-color .2s, transform .2s; }
.mcard:hover { border-color: #4a4380; transform: translateY(-2px); }
.mcard-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(124, 108, 255, .14); color: #b4a8ff; margin-bottom: 6px; }
.mcard b { font-size: 16px; }
.mcard small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.mcard em { margin-top: 8px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.mcard em.on { color: var(--ok); }
.mcard.mod { cursor: default; }
.mcard.mod:hover { transform: none; }
.mod-top { width: 100%; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mod-top .mcard-ic { margin-bottom: 0; }
.mod-top .tg { margin-left: auto; }
.mcard em.badge { margin-top: 0; color: #fff; }
.badge { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 8px; border-radius: 99px; background: var(--grad); color: #fff; }
.mcard.mod small { flex: 1; }
.mcard.mod .btn { margin-top: 10px; }
.changes { display: flex; flex-direction: column; gap: 6px; }
.changes > div { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.changes > div > span:nth-child(3) { flex: 1; color: var(--muted); }
.changes time { color: var(--muted); font-size: 12.5px; }

/* ---------- страница модуля ---------- */
.ph { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ph > div { flex: 1; }
.ph p { margin-top: 4px; max-width: 760px; }
.ph-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 12px 34px -12px rgba(99, 102, 241, .9); }
.ph-ic svg { width: 24px; height: 24px; }
.sec { margin-top: 14px; padding: 22px 24px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.sec-h { display: flex; gap: 16px; align-items: flex-start; }
.sec-h > div { flex: 1; }
.sec h3 { font-size: 17px; }
.sec .muted { margin-top: 4px; font-size: 13px; }
.fields { margin-top: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.f { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.f-lab { font-size: 13px; font-weight: 700; color: #c9ccdd; }
.f-lab small { color: var(--muted); font-weight: 600; }
.f-tg { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.f-tg.locked { opacity: .8; }
.in { width: 100%; height: 42px; padding: 0 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font: 500 14px "Manrope", sans-serif; outline: none; transition: border-color .15s; }
textarea.in { height: auto; padding: 10px 12px; resize: vertical; }
input[type="color"].in { padding: 4px; cursor: pointer; }
.in:focus { border-color: var(--violet); }
.pref { display: flex; align-items: center; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.pref:focus-within { border-color: var(--violet); }
.pref i { font-style: normal; color: var(--muted); padding-left: 12px; font-weight: 700; }
.pref .in { border: 0; background: none; padding-left: 6px; }
.vars, .cnt { color: var(--muted); font-size: 11.5px; }
/* переменные — нажатием вставляются в текст */
.vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.vars button { padding: 3px 9px; border-radius: 8px; background: rgba(124, 108, 255, .12); border: 1px solid rgba(124, 108, 255, .3); color: #c4b5fd; font: 600 12px ui-monospace, Consolas, monospace; }
.vars button:hover { background: rgba(124, 108, 255, .25); }
/* значок «?» с подсказкой */
.q { position: relative; display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 6px; border-radius: 50%; background: #23284a; color: #b9b2ff; font: 800 11px "Manrope", sans-serif; font-style: normal; cursor: help; vertical-align: 1px; flex: none; }
.q:hover, .q.open, .q:focus { background: var(--grad); color: #fff; outline: none; }
.tip-pop { position: fixed; z-index: 80; width: max-content; padding: 10px 12px; border-radius: 12px; background: #161a2b; border: 1px solid #3a3f66; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); color: #e3e5f0; font: 500 12.5px/1.5 "Manrope", sans-serif; pointer-events: none; animation: tipin .12s ease-out; }
@keyframes tipin { from { opacity: 0; transform: translateY(-3px); } }
.sec h3 .q { vertical-align: 2px; }
.sec h3 svg { width: 17px; height: 17px; vertical-align: -3px; color: #a99bff; }
/* кнопки действий страницы */
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 6px; }
.btn.subtle { color: var(--muted); }
/* команды */
.cmd-count { margin: 4px 0 4px; font-size: 13px; }
.cmd-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.cmd { border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.cmd.dim .cmd-row > code, .cmd.dim .cmd-d { opacity: .5; }
.cmd-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.cmd-row code { font: 700 14px ui-monospace, Consolas, monospace; color: #c4b5fd; min-width: 150px; }
.cmd-d { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.cmd-d small { color: var(--muted); font: 500 12px ui-monospace, Consolas, monospace; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.cmd-cfg { margin: 0; padding: 4px 12px 14px; border-top: 1px solid var(--line); }
/* всплывающее окно предпросмотра */
#modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(4, 5, 10, .7); backdrop-filter: blur(4px); }
.modal-card { width: min(560px, 100%); max-height: 86vh; overflow: auto; padding: 18px 20px 22px; border-radius: 20px; background: var(--panel); border: 1px solid #343a66; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); display: flex; flex-direction: column; gap: 12px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; }
.modal-h button { width: 32px; height: 32px; border-radius: 10px; font-size: 20px; color: var(--muted); }
.modal-h button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.modal-card .embed { margin-top: 0; max-width: none; }
.embed-foot { display: block; margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.embed .danger { color: var(--err); font-weight: 700; }
.fake-btn { padding: 7px 14px; border-radius: 8px; background: #2b2f45; font-weight: 700; font-size: 13px; }
.cnt { align-self: flex-end; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 42px; padding: 6px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.tags span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 9px; background: rgba(124, 108, 255, .16); color: #d4ceff; font-weight: 600; font-size: 13px; }
.tags span button { width: 20px; height: 20px; border-radius: 6px; color: var(--muted); }
.tags span button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.tags input { flex: 1; min-width: 140px; background: none; border: 0; outline: none; color: var(--text); font: inherit; padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks button { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; font-size: 13px; color: #c9ccdd; }
.checks button.on { background: var(--grad); border-color: transparent; color: #fff; }
.rows { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.f:has(.rows), .f:has(.tags), .f:has(textarea), .f:has(.checks) { grid-column: 1 / -1; }
.rows-h, .rows-r { display: grid; grid-template-columns: repeat(var(--cols), 1fr) 36px; gap: 8px; align-items: center; }
.rows-h span { font-size: 12px; color: var(--muted); font-weight: 700; }
.rows-del { width: 36px; height: 36px; border-radius: 10px; color: var(--muted); font-size: 18px; }
.rows-del:hover { background: rgba(248, 113, 113, .1); color: var(--err); }
.rows .btn { align-self: flex-start; }
.tg { width: 48px; height: 28px; border-radius: 99px; background: #262a40; position: relative; flex: none; transition: background .2s; }
.tg i { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #9aa0b8; transition: transform .2s, background .2s; }
.tg.on { background: var(--grad); }
.tg.on i { transform: translateX(20px); background: #fff; }
.tg.big { width: 58px; height: 32px; }
.tg.big i { width: 24px; height: 24px; }
.tg.big.on i { transform: translateX(26px); }
.tg[disabled] { cursor: not-allowed; }
.off { opacity: .45; pointer-events: none; filter: saturate(.6); }
.off-note { margin-top: 14px; text-align: center; color: var(--muted); }
.cmds { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.cmds code { font: 700 14px ui-monospace, Consolas, monospace; color: #c4b5fd; }
.embed { margin-top: 12px; padding: 14px 16px; border-radius: 6px 12px 12px 6px; background: #1d2030; border-left: 4px solid var(--c, #7c6cff); max-width: 520px; }
.embed b { font-size: 15px; }
.embed p { margin-top: 6px; color: #cfd2e2; white-space: pre-wrap; }
.embed img { margin-top: 10px; max-width: 100%; border-radius: 8px; }

/* ---------- панель «несохранённые изменения» и уведомления ---------- */
.savebar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 20px; border-radius: 16px; background: #10131d; border: 1px solid #39407a; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: rise .2s ease-out; width: min(640px, calc(100vw - 24px)); }
.savebar span { flex: 1; font-weight: 700; }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 50; padding: 12px 20px; border-radius: 12px; background: #1a1d2c; border: 1px solid #3a3f66; font-weight: 700; }

/* ---------- телефон ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; padding: 8px; }
  .side { position: fixed; z-index: 35; inset: 8px auto 8px 8px; width: min(320px, calc(100vw - 16px)); transform: translateX(-110%); transition: transform .25s; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
  body.side-open .side { transform: none; }
  .burger { display: grid; }
  .top-note { font-size: 11.5px; }
  .main { padding: 20px 6px 120px; }
  .page h1 { font-size: 26px; }
  .fields { grid-template-columns: 1fr; }
  .pro { flex-direction: column; align-items: flex-start; }
  .pro img { display: none; }
  .notice { flex-direction: column; align-items: flex-start; }
  .rows-h { display: none; }
  .rows-r { grid-template-columns: 1fr 36px; }
  .rows-r > :not(.rows-del) { grid-column: 1; }
  .rows-r > .rows-del { grid-column: 2; grid-row: 1; }
  .tip { position: static; margin-top: 30px; }
  .wave-hand { font-size: 84px; }
}

/* ---------- удобная настройка ---------- */
/* выбор канала/роли из списка */
.chpick { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.chpick > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chpick:hover { border-color: #3a4070; }
.chpick.empty .pk-ph { color: var(--muted); font-weight: 500; }
.pk-chev { width: 16px; height: 16px; flex: none; color: var(--muted); margin-left: auto; }
.pk-ic { font-style: normal; color: var(--muted); font-weight: 800; width: 18px; text-align: center; flex: none; }
.rdot { width: 11px; height: 11px; border-radius: 50%; background: var(--rc, #94a3b8); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc, #94a3b8) 20%, transparent); }
.tags span { gap: 6px; }
.tags span .pk-ic { width: auto; }
.tag-add { height: 30px; padding: 0 12px; border-radius: 9px; border: 1px dashed #3a4070; color: #b9b2ff; font-weight: 700; font-size: 13px; }
.tag-add:hover { background: rgba(124, 108, 255, .12); border-style: solid; }
.picker { position: fixed; z-index: 85; display: flex; flex-direction: column; max-height: min(380px, 70vh); padding: 8px; border-radius: 16px; background: #131627; border: 1px solid #3a3f66; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); animation: tipin .12s ease-out; }
.picker .search { flex: none; }
.pk-list { flex: 1; overflow: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 1px; }
.pk-cat { padding: 10px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pk-i { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 10px; border-radius: 10px; text-align: left; font-weight: 600; font-size: 14px; }
.pk-i span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-i:hover, .pk-i:focus-visible { background: rgba(124, 108, 255, .14); outline: none; }
.pk-i.on { background: rgba(124, 108, 255, .2); color: #e4dfff; }
.pk-ok { color: #b9b2ff; }
.pk-new { color: #b9b2ff; }
.pk-none { color: var(--muted); }
.pk-empty { padding: 12px 10px; color: var(--muted); font-size: 13px; }
.pk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 2px 0; margin-top: 6px; border-top: 1px solid var(--line); }
.pk-foot small { color: var(--muted); }
/* что изменено и что нужно заполнить */
.f { position: relative; border-radius: 12px; }
.f.changed > .f-lab::after { content: "изменено"; margin-left: 8px; padding: 1px 7px; border-radius: 99px; background: rgba(124, 108, 255, .18); color: #c4b5fd; font-size: 10.5px; font-weight: 800; vertical-align: 1px; }
.f-tg.changed { border-color: rgba(124, 108, 255, .55); }
.f.need .chpick, .f.need .in { border-color: rgba(245, 158, 11, .7); }
.need-note { color: var(--warn); font-size: 12px; font-weight: 600; }
.req { color: var(--warn); margin-left: 3px; }
.f.flash { animation: flash 2s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px rgba(139, 92, 246, .8), 0 0 30px rgba(139, 92, 246, .4); } 100% { box-shadow: 0 0 0 3px transparent; } }
.need-bar { display: flex; gap: 14px; align-items: flex-start; margin: 8px 0 4px; padding: 14px 18px; border-radius: 16px; background: rgba(245, 158, 11, .08); border: 1px solid rgba(245, 158, 11, .35); }
.need-bar > span { font-size: 22px; }
.need-bar p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.need-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.need-list button { padding: 6px 12px; border-radius: 99px; background: rgba(245, 158, 11, .14); color: #fcd34d; font-weight: 700; font-size: 13px; }
.need-list button:hover { background: rgba(245, 158, 11, .26); }
.need-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); flex: none; font-style: normal; }
.need-tag { margin-top: 8px; color: var(--warn); font-size: 12px; font-weight: 700; }
.mcard em.need { color: var(--warn); }
/* быстрая настройка */
.presets { margin-top: 12px; padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, rgba(139, 92, 246, .1), rgba(56, 189, 248, .05)); border: 1px solid #2e3360; }
.presets-cap { font-weight: 800; font-size: 14px; }
.preset-list { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.preset { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); text-align: left; transition: border-color .15s, transform .15s; }
.preset:hover { border-color: #4b4f8a; transform: translateY(-1px); }
.preset.on { border-color: var(--violet); background: rgba(124, 108, 255, .1); }
.preset b { font-size: 14px; }
.preset b em { font-style: normal; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--grad); font-size: 10px; vertical-align: 1px; }
.preset small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
/* галочки: выбрать все */
.checks-all { display: flex; gap: 12px; }
.checks-all button { color: var(--muted); font-size: 12px; font-weight: 700; }
.checks-all button:hover { color: #c4b5fd; }
.rows-empty { padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; }
/* предпросмотр сообщения как в Discord */
.msgprev { margin-top: 4px; padding: 12px 14px; border-radius: 14px; background: #1e2030; border: 1px solid #2a2d42; }
.msgprev > small { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.dmsg { display: flex; gap: 12px; }
.dmsg > img { width: 40px; height: 40px; border-radius: 50%; flex: none; background: #2b2f45; }
.dmsg > div { min-width: 0; flex: 1; }
.dmsg-h { display: flex; align-items: center; gap: 6px; }
.dmsg-h b { color: #c4b5fd; }
.dmsg-h em { font-style: normal; padding: 0 5px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 800; }
.dmsg-h time { color: var(--muted); font-size: 11.5px; }
.dmsg-t { margin-top: 3px; color: #dbdee1; white-space: pre-wrap; word-break: break-word; }
.dmsg .embed { margin-top: 6px; }
.mention { padding: 0 3px; border-radius: 4px; background: rgba(88, 101, 242, .3); color: #c9cdfb; font-weight: 600; }
.dmsg code { padding: 1px 4px; border-radius: 4px; background: #2b2d31; font-size: 13px; }
.wbanner { margin-top: 6px; max-width: 420px; aspect-ratio: 2.4; border-radius: 12px; background: radial-gradient(circle at 20% 20%, rgba(139, 92, 246, .55), transparent 60%), radial-gradient(circle at 80% 80%, rgba(56, 189, 248, .45), transparent 60%), #151827; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.wb-av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); border: 3px solid #fff; font-weight: 800; font-size: 20px; }
.wbanner b { letter-spacing: .12em; font-size: 15px; }
.wbanner small { color: #cfd2e2; }
/* поиск по настройкам */
.gsearch { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13px; }
.gsearch:hover { border-color: #3a4070; color: var(--text); }
.gsearch svg, .search svg { width: 16px; height: 16px; flex: none; }
kbd { padding: 2px 6px; border-radius: 6px; background: #1b1f30; border: 1px solid var(--line); color: var(--muted); font: 700 11px "Manrope", sans-serif; white-space: nowrap; }
.mod-res button { width: 100%; }
.mod-res button > span { flex: 1; min-width: 0; }
.mod-res button > svg { width: 18px; height: 18px; flex: none; color: #a99bff; }
.mod-res button em { font-style: normal; font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.mod-res button.act { background: rgba(124, 108, 255, .14); }
.gs-res { max-height: 56vh; overflow: auto; margin-top: 0; }
.modal-card .search.big { margin: 0; }
/* главная: шаги настройки */
.setup { margin-top: 16px; padding: 18px 20px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.setup-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setup-h small, .setup.done-all small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.setup-pct { font-weight: 800; font-size: 20px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.setup-bar { margin-top: 12px; height: 6px; border-radius: 99px; background: #1b1f30; overflow: hidden; }
.setup-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .4s; }
.setup-steps { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.setup-steps button { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.setup-steps button:hover { border-color: #4b4f8a; }
.setup-steps span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #23284a; font-size: 11px; }
.setup-steps .done { color: var(--muted); }
.setup-steps .done span { background: var(--ok); color: #05150d; }
.setup.done-all b { color: var(--ok); }
.copy-row select { width: auto; flex: 1; min-width: 180px; }
@media (max-width: 900px) {
  .gsearch span, .gsearch kbd, .search kbd { display: none; }
  .gsearch { width: 38px; padding: 0; justify-content: center; }
  .preset-list { grid-template-columns: 1fr; }
  .need-bar { padding: 12px 14px; }
  .top-note span { display: none; }
  .toast { bottom: 118px; width: calc(100vw - 48px); text-align: center; }
}

/* ---------- «Свои команды» ---------- */
.cc-tpl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.cc-tpl span { color: var(--muted); font-size: 12.5px; font-weight: 700; margin-right: 2px; }
.cc-tpl button { padding: 5px 11px; border-radius: 99px; background: rgba(124, 108, 255, .12); border: 1px solid rgba(124, 108, 255, .3); color: #c4b5fd; font: 700 12.5px ui-monospace, Consolas, monospace; }
.cc-tpl button:hover { background: rgba(124, 108, 255, .25); }
.cc-wrap .search { margin-top: 12px; }
.cc-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.cc { border-radius: 16px; background: var(--bg); border: 1px solid var(--line); transition: border-color .15s; }
.cc.open { border-color: #3a4070; }
.cc.bad { border-color: rgba(245, 158, 11, .55); }
.cc.dim .cc-h code, .cc.dim .cc-sub { opacity: .5; }
.cc-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.cc-h code { font: 700 14.5px ui-monospace, Consolas, monospace; color: #c4b5fd; }
.cc-sub { flex: 1; min-width: 120px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-err { color: var(--warn); font-size: 12.5px; font-weight: 700; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.sm.danger:hover { color: var(--err); background: rgba(248, 113, 113, .1); }
.cc-body { padding: 4px 14px 16px; border-top: 1px solid var(--line); }
.cc-sec { margin-top: 14px; }
.cc-sec h4 { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cc-sec .fields { margin-top: 10px; }
.cc-sec .msgprev { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.f.wide { grid-column: 1 / -1; }
.cc-types { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cc-types button { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 13px; color: #c9ccdd; }
.cc-types button.on { background: var(--grad); color: #fff; border-color: transparent; }
.dmsg-av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #3b3f5c; font-weight: 800; }
.dmsg.user .dmsg-h b { color: #e5e7f0; }
.react-chip { display: inline-flex; gap: 6px; margin-top: 6px; padding: 2px 8px; border-radius: 8px; background: rgba(88, 101, 242, .2); border: 1px solid #5865f2; font-size: 13px; font-weight: 700; }
.cmd-cfg .cmd-reset { grid-column: 1 / -1; align-items: flex-start; }
.pk-reload { color: var(--muted); font-size: 12.5px; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
@media (max-width: 900px) { .cc-err { max-width: 100%; order: 5; flex-basis: 100%; } }
