/* TelegramCRM — Midnight Editorial Style
   Референс: design/Promt.md — тёмный #050505, акцент коралл #FF6B50,
   Satoshi/Inter, большие радиусы, стекло, тонкая типографика */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #050505;
  --panel: #0d0d0d;
  --panel2: #111111;
  --panel3: #161616;
  --card: #111111;
  --line: #222222;
  --line2: #333333;
  --fg: #ebebeb;
  --mut: #888888;
  --mut2: #666666;
  --mut3: #444444;
  --acc: #FF6B50;
  --acc-hover: #E55A40;
  --ok: #4ade80;
  --warn: #fbbf24;
  --err: #f87171;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: var(--acc); color: #000; }

/* ================= TOPBAR ================= */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: rgba(13,13,13,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo .logo-mark {
  width: 30px; height: 30px;
  background: #fff;
  color: #000;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  transition: transform .3s;
}
.logo:hover .logo-mark { transform: rotate(12deg); }
.crumbs { color: var(--mut); font-size: 13px; font-weight: 500; }
.crumbs b { color: var(--fg); font-weight: 600; }
.spacer { flex: 1; }

.tbtn {
  border: 1px solid var(--line2);
  background: #1a1a1a;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .3s;
  letter-spacing: -0.01em;
}
.tbtn:hover { background: #fff; color: #000; border-color: #fff; }
.tbtn.acc {
  background: var(--acc);
  border-color: var(--acc);
  color: #000;
  font-weight: 700;
}
.tbtn.acc:hover { background: var(--acc-hover); border-color: var(--acc-hover); color: #000; }

/* ================= LAYOUT ================= */
.wrap { display: flex; height: calc(100vh - 64px); }
.sidebar {
  width: 300px;
  background: var(--panel);
  border-right: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; flex: none;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ================= SIDEBAR ================= */
.side-head { padding: 20px 16px 12px; }
.side-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .3em;
  color: var(--mut2);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.set-gear {
  background: none; border: none; color: var(--mut2); cursor: pointer;
  padding: 4px; border-radius: 6px; display: inline-flex; transition: color .25s;
}
.set-gear:hover { color: var(--fg); }
.set-gear .icon { width: 14px; height: 14px; }
.count {
  background: var(--panel3);
  border: 1px solid var(--line2);
  border-radius: 20px;
  font-size: 10px;
  padding: 2px 9px;
  color: var(--mut);
  font-weight: 600;
  letter-spacing: normal;
}
.search {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 13px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .3s;
}
.search:focus { border-color: var(--acc); }
.search::placeholder { color: var(--mut3); }

.acct-list { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.acct {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 3px;
  transition: background .25s, border-color .25s;
}
.acct:hover { background: var(--panel3); }
.acct.active { background: #1a1a1a; border-color: var(--line2); }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex: none;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  background: #2a2a2a;
}
.a1 { background: linear-gradient(135deg,#FF6B50,#c43c22); }
.a2 { background: linear-gradient(135deg,#a78bfa,#6d28d9); }
.a3 { background: linear-gradient(135deg,#4ade80,#15803d); }
.a4 { background: linear-gradient(135deg,#f472b6,#be185d); }
.a5 { background: linear-gradient(135deg,#fbbf24,#b45309); }

.a-body { min-width: 0; flex: 1; }
.a-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.02em; }
.a-sub { font-size: 12px; color: var(--mut2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-status { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st-ok { background: var(--ok); box-shadow: 0 0 8px #4ade8066; }
.st-warn { background: var(--warn); }
.st-err { background: var(--err); }
.st-new { background: var(--mut2); }

/* ================= ACCOUNT HEAD ================= */
.acc-head {
  padding: 18px 28px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 16px;
  background: var(--panel);
}
.acc-head .avatar { width: 48px; height: 48px; font-size: 17px; }
.acc-title { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.acc-title .mono { font-size: 12px; color: var(--mut2); font-weight: 400; margin-left: 8px; }
.acc-meta { font-size: 13px; color: var(--mut); display: flex; gap: 10px; margin-top: 4px; align-items: center; }
.pill {
  font-size: 10px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--line2);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.pill.ok { color: var(--ok); border-color: #4ade8044; background: #4ade8012; }
.pill.warn { color: var(--warn); border-color: #fbbf2444; background: #fbbf2412; }
.pill.err { color: var(--err); border-color: #f8717144; background: #f8717112; }
.pill.mut { color: var(--mut); }

/* ================= TABS ================= */
.tabs { display: flex; gap: 4px; background: var(--panel); border-bottom: 1px solid rgba(255,255,255,.07); padding: 0 24px; }
.tab {
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--mut);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  user-select: none;
  transition: color .25s;
}
.tab:hover { color: var(--fg); }
.tab.on { color: var(--acc); border-color: var(--acc); }

/* ================= TOOLBAR / BUTTONS / INPUTS ================= */
.toolbar { padding: 16px 28px; display: flex; gap: 10px; align-items: center; }

.btn {
  border: 1px solid var(--line2);
  background: var(--panel3);
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .3s;
  letter-spacing: -0.01em;
}
.btn:hover { border-color: #555; color: #fff; }
.btn.acc { background: var(--acc); color: #000; border-color: var(--acc); font-weight: 700; }
.btn.acc:hover { background: var(--acc-hover); border-color: var(--acc-hover); color: #000; }
.btn.danger:hover { border-color: var(--err); color: var(--err); }

.input {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 10px;
  padding: 10px 13px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .3s;
}
.input:focus { border-color: var(--acc); }
.input::placeholder { color: var(--mut3); }

/* ================= TABLE ================= */
.tbl-wrap { flex: 1; overflow: auto; padding: 0 28px 28px; min-height: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--mut2);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
td { padding: 12px; border-bottom: 1px solid #161616; }
tr:hover td { background: #0f0f0f; }
.b-name { font-weight: 600; }
.b-user { font-family: var(--mono); font-size: 11.5px; color: var(--acc); }
.mono { font-family: var(--mono); font-size: 11.5px; color: var(--mut); }
.empty { padding: 80px 20px; text-align: center; color: var(--mut2); font-size: 14px; line-height: 1.7; }

/* ================= MODALS ================= */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.overlay.open { display: flex; }
.modal {
  width: 460px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.8);
}
.modal.wide { width: 640px; max-height: 88vh; overflow-y: auto; }
.m-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  display: flex; justify-content: space-between; align-items: center;
}
.m-close { cursor: pointer; color: var(--mut); font-size: 18px; line-height: 1; transition: color .25s; }
.m-close:hover { color: var(--fg); }
.m-body { padding: 22px; }
.m-body p { font-size: 13px; color: var(--mut); margin-bottom: 16px; line-height: 1.6; }
.m-body code { font-family: var(--mono); font-size: 11.5px; background: var(--panel3); padding: 2px 6px; border-radius: 6px; }
.m-body a { color: var(--acc); }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--mut2);
  margin-bottom: 7px;
  font-weight: 700;
}
.field .input { width: 100%; }
.field .ck { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 5px 0; cursor: pointer; color: var(--fg); }
.ck input { accent-color: var(--acc); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.step { flex: 1; height: 3px; border-radius: 3px; background: var(--line); }
.step.on { background: var(--acc); }
.acc-err { color: var(--err); font-size: 12.5px; min-height: 18px; margin-top: 8px; white-space: pre-wrap; }
.m-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ================= FAB + TOAST ================= */
.fab {
  position: fixed; right: 28px; bottom: 28px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--acc);
  color: #000;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255,107,80,.35);
  border: none;
  z-index: 50;
  transition: background .3s, transform .3s;
}
.fab:hover { background: var(--acc-hover); transform: translateY(-3px); }
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: #15803d;
  color: #fff;
  font-size: 13px; font-weight: 500;
  padding: 12px 22px;
  border-radius: 12px;
  transition: .3s cubic-bezier(.2,.9,.3,1.2);
  z-index: 200;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: #b91c1c; }

/* ================= TDATA BROWSER ================= */
.td-crumb { font-size: 11.5px; color: var(--acc); margin-bottom: 10px; word-break: break-all; }
.td-list { display: flex; flex-direction: column; gap: 2px; }
.td-item {
  text-align: left; background: none; border: none;
  color: var(--fg); font-size: 13px;
  font-family: var(--font);
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  transition: background .2s;
}
.td-item:hover { background: var(--panel3); color: var(--acc); }

/* ================= SCROLLBARS ================= */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* ================= BOTS: MODALS ================= */
.btn.sm { font-size: 11.5px; padding: 6px 12px; border-radius: 8px; }
textarea.input { resize: vertical; font-family: var(--font); }
.hint { font-size: 12px; color: var(--mut2); margin-top: 6px; min-height: 16px; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  background: var(--panel3);
  border: 1px solid var(--line2);
  color: var(--acc);
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color .25s;
}
.chip:hover { border-color: var(--acc); }
.cmd-row { display: flex; gap: 8px; margin-bottom: 8px; }
.cmd-row input { flex: 1; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .row2 { grid-template-columns: 1fr; } }
.avatar-drop {
  border: 1px dashed var(--line2);
  border-radius: 16px;
  min-height: 110px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--mut2);
  font-size: 12px;
  padding: 10px;
  text-align: center;
  transition: border-color .3s, color .3s;
}
.avatar-drop:hover { border-color: var(--acc); color: var(--acc); }
.avatar-drop img { max-width: 96px; max-height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto; }
.token-box { display: flex; align-items: center; gap: 8px; }
.token-box code {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: 11.5px;
  background: var(--panel3);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

/* ================= CHATS: CARDS ================= */
.chat-list { flex: 1; overflow-y: auto; padding: 4px 28px 28px; min-height: 0; }
.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
#bots-body, #chats-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background .25s, border-color .25s;
}
.chat-card:hover { background: var(--panel3); border-color: var(--line); }
.chat-ico {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--panel3);
  border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  flex: none;
}
.chat-body { min-width: 0; flex: 1; }
.chat-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { font-size: 12px; color: var(--mut2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.chat-sub .mono { color: var(--acc); }
.chat-actions { flex: none; display: flex; gap: 8px; }
.radio-row { display: flex; flex-direction: column; gap: 8px; }

/* ================= CHAT MANAGE ================= */
.cm-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-bottom: 16px;
  padding: 13px 16px;
  background: var(--panel3);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cm-meta .mono { color: var(--acc); font-size: 12px; }
.cm-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.cm-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--mut2);
  font-weight: 700;
  margin-bottom: 10px;
}
.cm-bot { font-size: 13px; display: flex; align-items: center; gap: 9px; }
.cm-photo {
  border: 1px dashed var(--line2);
  border-radius: 14px;
  height: 84px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--mut2);
  font-size: 11.5px;
  text-align: center;
  line-height: 1.5;
  overflow: hidden;
  transition: border-color .3s, color .3s;
}
.cm-photo:hover { border-color: var(--acc); color: var(--acc); }
.cm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ================= CHAT VIEW ================= */
.modal.chat-modal {
  width: 700px; max-width: 94vw; height: 84vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel3);
  flex: none;
}
.ch-info { min-width: 0; }
.ch-title { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-sub { font-size: 11.5px; color: var(--mut2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.msg {
  max-width: 75%;
  background: var(--panel3);
  border: 1px solid var(--line);
  border-radius: 16px;
  border-bottom-left-radius: 6px;
  padding: 10px 14px;
  align-self: flex-start;
}
.msg.out { align-self: flex-end; background: #1a1a1a; border-color: var(--line2); border-radius: 16px; border-bottom-right-radius: 6px; }
.msg-head { font-size: 11px; font-weight: 700; color: var(--acc); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.msg-actions { display: inline-flex; gap: 2px; margin-left: 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-actions { opacity: 1; }
.msg-act {
  border: none; background: transparent; color: var(--mut);
  cursor: pointer; padding: 2px; border-radius: 6px;
  display: inline-flex; align-items: center;
  transition: color .15s, background .15s;
}
.msg-act .icon { width: 13px; height: 13px; }
.msg-act .icon svg { width: 100%; height: 100%; }
.msg-act:hover { color: var(--fg); background: var(--panel2); }
.msg-act.danger:hover { color: var(--err); }
.msg.editing { border-color: var(--acc); }
.msg-text { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg-meta { font-size: 10px; color: var(--mut2); text-align: right; margin-top: 5px; }
.chat-input {
  display: flex; gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  flex: none;
  align-items: flex-end;
}
.chat-input textarea {
  flex: 1;
  resize: none;
  min-height: 42px;
  max-height: 110px;
  overflow-y: auto;
  line-height: 1.45;
}
.chat-input .btn { align-self: flex-end; flex: none; }

/* ================= SETTINGS PANEL ================= */
.panel-overlay { justify-content: flex-end; align-items: stretch; }
.panel {
  width: 560px; max-width: 96vw;
  height: 100%;
  background: var(--panel2);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.2,.8,.25,1);
  box-shadow: -30px 0 80px rgba(0,0,0,.6);
}
.panel-overlay.open .panel { transform: translateX(0); }
.panel .m-head { flex: none; }
.panel-tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.ptab {
  background: none; border: none; color: var(--mut);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .25s;
}
.ptab:hover { color: var(--fg); }
.ptab.on { color: var(--acc); border-color: var(--acc); }
.panel-body { flex: 1; overflow-y: auto; padding: 20px; min-height: 0; }
.p-hint { font-size: 12.5px; color: var(--mut); margin-bottom: 16px; line-height: 1.6; }
.p-hint a { color: var(--acc); }

.px-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.px-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.px-actions { display: flex; gap: 6px; flex: none; }

/* ================= ICONS ================= */
.icon { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; vertical-align: -2.5px; }
.icon svg { width: 100%; height: 100%; }
.btn .icon, .tbtn .icon { margin-right: 2px; }
.icon-btn { display: inline-flex; align-items: center; gap: 5px; }
.icon-btn .icon { margin-right: 0; }
.td-item .icon { width: 14px; height: 14px; margin-right: 4px; color: var(--acc); }

/* ================= CHAT AVATARS ================= */
.chat-ava, .chat-ico {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--panel3);
  border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  flex: none;
  position: relative;
  overflow: hidden;
  color: var(--mut);
}
.chat-ava .icon, .chat-ico .icon { width: 19px; height: 19px; }
.chat-ava img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: none;
}
.chat-ava.has-img img { display: block; }
.chat-ava.has-img { border-color: transparent; }

/* ================= MOBILE ================= */
.burger { display: none; }

@media (max-width: 900px) {
  body { overflow: auto; }
  .topbar { height: 56px; padding: 0 14px; gap: 12px; }
  .logo { font-size: 0; gap: 0; } /* только монограмма */
  .logo .logo-mark { width: 32px; height: 32px; font-size: 16px; }
  .crumbs { display: none; }
  .burger {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border: 1px solid var(--line2);
    background: #1a1a1a;
    color: var(--fg);
    border-radius: 10px;
    cursor: pointer;
    flex: none;
  }
  .burger .icon { width: 18px; height: 18px; }

  .wrap { height: calc(100vh - 56px); position: relative; }
  .sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    width: min(320px, 85vw);
    z-index: 60;
    transform: translateX(-105%);
    transition: transform .3s cubic-bezier(.2,.8,.3,1);
    box-shadow: 20px 0 60px rgba(0,0,0,.6);
  }
  body.side-open .sidebar { transform: translateX(0); }
  .side-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(3px);
    z-index: 55;
    display: none;
  }
  body.side-open .side-backdrop { display: block; }

  .acc-head { padding: 14px 16px; flex-wrap: wrap; }
  .acc-head .avatar { width: 40px; height: 40px; font-size: 15px; }
  .acc-title { font-size: 17px; }
  .acc-head .acc-actions { width: 100%; display: flex; gap: 8px; flex-wrap: wrap; }
  .acc-head .acc-actions .btn { flex: 1; justify-content: center; white-space: nowrap; }

  .tabs { padding: 0 12px; overflow-x: auto; }
  .tab { padding: 12px 14px; font-size: 12.5px; white-space: nowrap; }
  .toolbar { padding: 12px 16px; flex-wrap: wrap; }
  .toolbar .btn { white-space: nowrap; }
  .tbl-wrap, .chat-list { padding-left: 12px; padding-right: 12px; }

  /* модалки — на весь экран */
  .overlay { align-items: stretch; justify-content: stretch; padding: 0; }
  .modal, .modal.wide, .modal.chat-modal {
    width: 100%; max-width: 100%;
    height: 100%; max-height: 100%;
    border-radius: 0;
    border: none;
    display: flex; flex-direction: column;
  }
  .panel { width: 100%; max-width: 100%; border-left: none; }
  .modal .m-body { flex: 1; overflow-y: auto; }
  .row2 { grid-template-columns: 1fr; }
  .chat-head .btn-txt { display: none; } /* в мобиле только иконки */
  .fab { right: 18px; bottom: 18px; }

  /* таблица ботов: колонки в столбик */
  .tbl-wrap table, .tbl-wrap thead, .tbl-wrap tbody, .tbl-wrap tr, .tbl-wrap td { display: block; }
  .tbl-wrap thead { display: none; }
  .tbl-wrap tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .tbl-wrap td { border: none; padding: 4px 0; }
}
