/* ==================================================================
   MAXBOT Studio — кабинет
   ================================================================== */

/* ---------------------------- boot ------------------------------ */
.boot {
  position: fixed; inset: 0; z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(900px 600px at 70% 10%, rgba(107, 92, 255, .16), transparent 60%), #080c18;
  color: #fff;
  transition: opacity .3s ease;
}
.boot.hidden { display: none; }
.boot-logo { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .02em; font-size: 1.2rem; }
.boot-logo small { display: block; font-size: .58rem; letter-spacing: .26em; color: rgba(255,255,255,.4); font-weight: 600; }
.boot-logo .logo-mark { width: 44px; height: 44px; border-radius: 13px; }
.boot-bar { width: 160px; height: 3px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: 99px; background: var(--grad); animation: boot-slide 1.1s ease-in-out infinite; }
@keyframes boot-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(300%); } }

/* ---------------------------- auth ------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #fff; }
.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 38px 48px;
  color: #fff;
  background:
    radial-gradient(700px 460px at 80% 8%, rgba(107, 92, 255, .55), transparent 62%),
    radial-gradient(600px 400px at 0% 100%, rgba(69, 196, 255, .25), transparent 60%),
    #080c18;
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 80% 70% at 40% 40%, #000, transparent 78%);
}
.auth-logo { position: relative; z-index: 1; color: #fff; }
.auth-visual-body { position: relative; z-index: 1; max-width: 440px; }
.auth-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  font-size: .74rem; color: rgba(255,255,255,.8);
}
.auth-badge .pulse { width: 6px; height: 6px; border-radius: 50%; background: #54e6b1; animation: pulse 2.4s infinite; }
.auth-visual h1 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.06; letter-spacing: -.035em; margin: 20px 0 16px; font-weight: 800; }
.auth-visual-body p { color: rgba(255,255,255,.6); font-size: .96rem; line-height: 1.6; }
.auth-list { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.auth-list li { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: rgba(255,255,255,.78); }
.auth-list .tick {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(84, 230, 177, .14); color: #54e6b1;
  display: grid; place-items: center; font-size: .7rem; flex: 0 0 auto;
}
.auth-visual-foot { position: relative; z-index: 1; }
.auth-mini { display: flex; align-items: center; gap: 12px; font-size: .74rem; color: rgba(255,255,255,.42); }
.auth-mini-avatars { display: flex; }
.auth-mini-avatars i {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #7b5cff, #4c8dff);
  border: 2px solid #0b1020; margin-left: -7px;
  font-style: normal; font-size: .62rem; font-weight: 700; color: #fff;
}
.auth-mini-avatars i:first-child { margin-left: 0; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-card { width: min(400px, 100%); }
.auth-tabs { display: flex; padding: 4px; background: #f1f3fa; border-radius: 12px; margin-bottom: 26px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.auth-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.025em; }
.auth-sub { margin-top: 6px; color: var(--muted); font-size: .88rem; }
.auth-form { margin-top: 24px; display: flex; flex-direction: column; gap: 15px; }
.auth-form .btn { margin-top: 4px; height: 48px; }
.auth-alt { margin-top: 18px; text-align: center; font-size: .82rem; color: var(--muted); }
.auth-alt a, .auth-alt button { color: var(--brand); font-weight: 600; background: none; border: 0; }
.auth-demo {
  margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.auth-demo .hint { text-align: center; }
.auth-error { background: var(--danger-soft); color: #b02a2f; font-size: .82rem; padding: 9px 12px; border-radius: 9px; }

/* ---------------------------- shell ----------------------------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 16px 16px;
  overflow-y: auto; overflow-x: hidden; min-height: 0;
  overscroll-behavior: contain; scrollbar-width: thin;
  background: #fff;
  border-right: 1px solid var(--border);
  z-index: 40;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; margin-bottom: 20px; }
.sidebar-logo { color: var(--ink); font-size: 1rem; }
.sidebar-logo small { color: var(--muted-2); }
.sidebar-site { color: var(--muted-2); width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.sidebar-site:hover { background: var(--surface-2); color: var(--ink); }
.sidebar-new { height: 42px; margin-bottom: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.side-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: .89rem; font-weight: 500;
  transition: background .16s, color .16s;
}
.side-nav a svg { flex: 0 0 auto; opacity: .8; }
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.active { background: var(--violet-soft); color: var(--brand); font-weight: 600; }
.side-nav a.active svg { opacity: 1; }
.nav-count {
  margin-left: auto; font-size: .7rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}
.side-nav a.active .nav-count { background: #fff; border-color: transparent; color: var(--brand); }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto; }
.plan-widget {
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(150deg, #f3f0ff, #eef6ff);
  border: 1px solid #e6e2ff;
}
.plan-widget .pw-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.plan-widget .pw-name { font-size: .8rem; font-weight: 700; color: var(--ink); }
.plan-widget .pw-price { font-size: .78rem; color: var(--muted); }
.plan-widget .pw-bar { height: 6px; border-radius: 99px; background: rgba(107, 92, 255, .14); overflow: hidden; margin: 4px 0 7px; }
.plan-widget .pw-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.plan-widget .pw-note { font-size: .7rem; color: var(--muted); line-height: 1.4; }
.plan-widget .btn { width: 100%; margin-top: 10px; height: 34px; font-size: .78rem; }
.user-widget { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--border); }
.user-widget:hover { background: var(--surface-2); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: 0 0 auto;
}
.user-widget .uw-name { font-size: .82rem; font-weight: 600; line-height: 1.2; }
.user-widget .uw-email { font-size: .68rem; color: var(--muted-2); }
.user-widget .uw-menu { margin-left: auto; color: var(--muted-2); display: grid; place-items: center; border: 0; background: none; padding: 4px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  min-height: 70px;
  padding: 12px 30px;
  background: rgba(245, 246, 251, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-titles { min-width: 0; }
.topbar h1 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.015em; }
.topbar p { font-size: .74rem; color: var(--muted-2); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sidebar-toggle { display: none; }
.view { padding: 28px 30px 60px; width: 100%; max-width: 1280px; margin: 0 auto; }

/* ---------------------------- page ------------------------------ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.page-head p { margin-top: 6px; color: var(--muted); font-size: .88rem; max-width: 640px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title-sm { font-size: 1.02rem; font-weight: 700; letter-spacing: -.015em; display: flex; align-items: center; gap: 8px; }
.section-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-head-row .link { font-size: .82rem; color: var(--brand); font-weight: 600; white-space: nowrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* ---------------------------- stats ---------------------------- */
.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { padding: 18px 18px 16px; background: #fff; border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat-card .sc-label { font-size: .76rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .sc-value { font-size: 1.62rem; font-weight: 800; letter-spacing: -.035em; margin-top: 8px; line-height: 1.1; }
.stat-card .sc-value small { font-size: .82rem; font-weight: 500; color: var(--muted-2); letter-spacing: 0; }
.stat-card .sc-note { margin-top: 6px; font-size: .72rem; color: var(--muted-2); }
.stat-card .sc-icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.stat-card .sc-icon.brand { background: var(--violet-soft); color: var(--brand); }
.stat-card .sc-icon.green { background: var(--success-soft); color: var(--success); }
.stat-card .sc-icon.blue { background: #eaf3ff; color: #2f7fe0; }
.stat-card .sc-icon.orange { background: var(--warning-soft); color: var(--warning); }

/* ---------------------------- bot cards ------------------------ */
.bots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.bot-card {
  display: flex; flex-direction: column;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.bot-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d9def0; }
.bot-card-top { display: flex; align-items: flex-start; gap: 12px; }
.bot-avatar {
  width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(135deg, #7b5cff, #4c8dff);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 1.05rem; flex: 0 0 auto;
  background-size: cover; background-position: center;
  box-shadow: 0 6px 14px -8px rgba(107, 92, 255, .8);
}
.bot-avatar.lg { width: 58px; height: 58px; border-radius: 16px; font-size: 1.35rem; }
.bot-avatar.sm { width: 32px; height: 32px; border-radius: 9px; font-size: .82rem; }
.bot-card .bc-name { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 7px; }
.bot-card .bc-handle { font-size: .74rem; color: var(--muted-2); margin-top: 1px; }
.bot-card .bc-desc { margin-top: 12px; font-size: .8rem; color: var(--muted); line-height: 1.5; min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bot-card .bc-stats { display: flex; gap: 18px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }
.bot-card .bc-stats div { font-size: .7rem; color: var(--muted-2); }
.bot-card .bc-stats b { display: block; font-size: .95rem; color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
.bot-card .bc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.bot-card .bc-foot .btn { height: 32px; padding: 0 12px; font-size: .78rem; }
.add-bot-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 210px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--muted);
  background: transparent;
  transition: border-color .2s, background .2s, color .2s;
}
.add-bot-card:hover { border-color: var(--brand); background: rgba(107, 92, 255, .03); color: var(--brand); }
.add-bot-card .plus-circle { width: 40px; height: 40px; border-radius: 50%; background: var(--violet-soft); color: var(--brand); display: grid; place-items: center; }
.add-bot-card b { font-size: .86rem; }

/* ---------------------------- statuses ------------------------- */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.status .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-live { background: var(--success-soft); color: var(--success); }
.status-draft { background: var(--warning-soft); color: #b57500; }
.status-demo { background: var(--violet-soft); color: var(--brand); }
.status-error { background: var(--danger-soft); color: var(--danger); }
.status-paused { background: #eef0f7; color: var(--muted); }
.status-live .dot { animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------------------------- panels --------------------------- */
.panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.panel-pad { padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h3 { font-size: .95rem; font-weight: 700; }
.panel-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split-main { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------------------------- layout helpers ------------------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }

/* ---------------------------- checklist ------------------------ */
.checklist { display: flex; flex-direction: column; }
.checklist-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.checklist-item:last-child { border-bottom: 0; }
.checklist-item .ci-mark { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: 0 0 auto; color: transparent; margin-top: 1px; }
.checklist-item.done .ci-mark { background: var(--success); border-color: var(--success); color: #fff; }
.checklist-item .ci-title { font-size: .84rem; font-weight: 600; }
.checklist-item .ci-desc { font-size: .76rem; color: var(--muted); margin-top: 1px; }
.checklist-item a { color: var(--brand); font-weight: 600; font-size: .76rem; }
.checklist-item.done .ci-title { color: var(--muted); text-decoration: line-through; }

/* ---------------------------- tabs ----------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 10px 13px 12px;
  font-size: .85rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  border: 0; background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab .tb-badge { display: inline-block; margin-left: 5px; font-size: .66rem; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; color: var(--muted); }
.tab.active .tb-badge { background: var(--violet-soft); border-color: transparent; color: var(--brand); }

/* ---------------------------- bot header ----------------------- */
.bot-hero { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.bot-hero .bh-main { min-width: 0; flex: 1; }
.bot-hero h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bot-hero .bh-sub { color: var(--muted); font-size: .82rem; margin-top: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bot-hero .bh-sub .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.bot-hero .bh-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------- mini phone ----------------------- */
.mini-phone {
  width: 300px;
  border-radius: 30px;
  background: #0f1524;
  padding: 8px;
  box-shadow: 0 28px 60px -26px rgba(11, 16, 32, .55);
  margin: 0 auto;
}
.mini-phone-screen { background: #eef1f8; border-radius: 23px; overflow: hidden; display: flex; flex-direction: column; height: 520px; }
.mp-head { background: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid #e8ebf3; }
.mp-ava { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #7b5cff, #4c8dff); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: 0 0 auto; }
.mp-head b { font-size: .76rem; display: block; line-height: 1.2; }
.mp-head span { font-size: .62rem; color: #6b7590; }
.mp-body { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 7px; scrollbar-width: none; }
.mp-body::-webkit-scrollbar { display: none; }
.mp-msg { display: flex; gap: 6px; max-width: 94%; }
.mp-msg .bubble { font-size: .74rem; padding: 8px 10px; border-radius: 12px 12px 12px 4px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); white-space: pre-line; line-height: 1.4; }
.mp-msg.user { margin-left: auto; flex-direction: row-reverse; }
.mp-msg.user .bubble { background: linear-gradient(135deg, #6d7cff, #4c8dff); color: #fff; border-radius: 12px 12px 4px 12px; }
.mp-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 1px; width: 100%; }
.mp-buttons button { border: 0; background: #fff; border-radius: 8px; padding: 7px 5px; font-size: .67rem; font-weight: 600; color: #4c6bff; box-shadow: 0 1px 2px rgba(16,24,40,.06); line-height: 1.2; }
.mp-buttons button:active { background: #f0f2ff; }
.mp-buttons button.wide { grid-column: span 2; }
.mp-input { background: #fff; border-top: 1px solid #e8ebf3; padding: 8px 10px; display: flex; gap: 7px; align-items: center; }
.mp-input .fake { flex: 1; height: 28px; border-radius: 9px; background: #f1f3f9; font-size: .66rem; color: #9aa2b6; display: flex; align-items: center; padding: 0 9px; }
.mp-input .send { width: 27px; height: 27px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; }
.mp-hint { text-align: center; font-size: .68rem; color: #8b93a9; padding: 4px 0 8px; }

/* ---------------------------- scenario ------------------------- */
.scenario-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.block-list { display: flex; flex-direction: column; gap: 8px; }
.block-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
  width: 100%;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.block-card:hover { border-color: #cfd5e8; box-shadow: var(--shadow-sm); }
.block-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(107, 92, 255, .1); }
.block-card .bc-ico { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: .82rem; flex: 0 0 auto; }
.block-card .bc-title { font-size: .82rem; font-weight: 600; line-height: 1.3; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.block-card .bc-text { font-size: .7rem; color: var(--muted-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.block-start { font-size: .58rem; padding: 1px 5px; border-radius: 4px; background: var(--violet-soft); color: var(--brand); font-weight: 700; }
.block-card .bc-dots { margin-left: auto; color: var(--muted-2); padding: 2px; flex: 0 0 auto; }
.scenario-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
.scenario-side .mini-phone-screen { height: 440px; }
.editor-panel { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-sm); }
.editor-panel h3 { font-size: 1rem; font-weight: 700; }
.editor-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-editor { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.btn-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px minmax(0, 1fr) 30px; gap: 6px; align-items: center; }
.btn-row .input, .btn-row .select { min-height: 34px; height: 34px; padding: 6px 9px; font-size: .78rem; border-radius: 8px; }
.btn-row .select { padding-right: 26px; background-position: right 8px center; background-size: 9px; }
.btn-row .icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); display: grid; place-items: center; }
.btn-row .icon-btn:hover { color: var(--danger); border-color: #f3c9ca; background: var(--danger-soft); }
.flow-empty { padding: 30px; text-align: center; color: var(--muted); font-size: .84rem; }

/* ---------------------------- forms/panels --------------------- */
.form-panel { display: flex; flex-direction: column; gap: 16px; }
.form-panel .form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.char-count { font-size: .7rem; color: var(--muted-2); text-align: right; margin-top: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .sr-title { font-size: .86rem; font-weight: 600; }
.switch-row .sr-desc { font-size: .76rem; color: var(--muted); margin-top: 2px; max-width: 520px; line-height: 1.45; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #dfe3ef; transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }

.kv { display: flex; flex-direction: column; gap: 0; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: .84rem; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 500; text-align: right; }
.code-box { font-family: var(--mono); font-size: .74rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; word-break: break-all; color: var(--ink-3); }

/* ---------------------------- tables --------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table .cell-main { font-weight: 600; color: var(--ink); }
.table .cell-sub { font-size: .72rem; color: var(--muted-2); margin-top: 1px; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table .num { font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent;
  color: var(--muted); display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------- tags ----------------------------- */
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.tag.brand { background: var(--violet-soft); border-color: transparent; color: var(--brand); }

/* ---------------------------- subscribers ---------------------- */
.search-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.search-input { position: relative; flex: 1; min-width: 200px; }
.search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.search-input .input { padding-left: 36px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }

/* ---------------------------- broadcast ------------------------ */
.broadcast-item { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.broadcast-item:last-child { border-bottom: 0; }
.bi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.bi-text { font-size: .84rem; line-height: 1.5; white-space: pre-line; color: var(--ink-3); }
.bi-progress { height: 5px; border-radius: 99px; background: #eef1f8; overflow: hidden; margin-top: 10px; }
.bi-progress i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .4s; }
.bi-meta { display: flex; gap: 14px; margin-top: 8px; font-size: .7rem; color: var(--muted-2); flex-wrap: wrap; }

/* ---------------------------- tester --------------------------- */
.tester-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tester-phone { background: #0f1524; border-radius: 30px; padding: 10px; box-shadow: 0 30px 60px -30px rgba(11,16,32,.5); }
.tester-screen { background: #eef1f8; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; height: 560px; }
.tester-body { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.tester-input { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid #e8ebf3; }
.tester-input .input { height: 38px; min-height: 38px; font-size: .82rem; }
.tester-input .btn { height: 38px; width: 38px; padding: 0; border-radius: 10px; }
.quick-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-buttons button { border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 5px 8px; font-size: .72rem; color: var(--ink-3); }
.quick-buttons button:hover { border-color: var(--brand); color: var(--brand); }

/* ---------------------------- chart ---------------------------- */
.chart-card { padding: 18px 20px; }
.chart-legend { display: flex; align-items: center; gap: 16px; font-size: .72rem; color: var(--muted); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }
.chart-svg { width: 100%; height: 180px; display: block; }
.chart-svg .grid-line { stroke: #eef1f8; stroke-width: 1; }
.chart-svg .axis-label { fill: #9aa2b6; font-size: 9px; font-family: var(--font); }
.chart-svg .area { fill: url(#areaGrad); }
.chart-svg .line { fill: none; stroke: #6b5cff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .line-2 { fill: none; stroke: #45c4ff; stroke-width: 1.6; stroke-dasharray: 3 3; }
.chart-svg .point { fill: #fff; stroke: #6b5cff; stroke-width: 2; }
.bars-h { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 38px; align-items: center; gap: 10px; font-size: .76rem; }
.bar-row .bl { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bt { height: 8px; border-radius: 99px; background: #eef1f8; overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7b5cff, #4c8dff); }
.bar-row b { text-align: right; font-size: .74rem; }

/* ---------------------------- activity ------------------------- */
.activity { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-item .ai-ava { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex: 0 0 auto; font-size: .72rem; font-weight: 700; }
.activity-item .ai-text { font-size: .8rem; line-height: 1.4; min-width: 0; }
.activity-item .ai-meta { font-size: .68rem; color: var(--muted-2); margin-top: 1px; }
.activity-item .ai-text p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------- empty ---------------------------- */
.empty { padding: 46px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .em-icon { width: 58px; height: 58px; border-radius: 18px; background: var(--violet-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 4px; }
.empty h3 { font-size: 1rem; font-weight: 700; }
.empty p { font-size: .84rem; color: var(--muted); max-width: 380px; line-height: 1.55; }
.empty .btn { margin-top: 6px; }

/* ---------------------------- onboarding ----------------------- */
.onboarding {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 30px;
  background:
    radial-gradient(600px 300px at 88% 0%, rgba(69, 196, 255, .25), transparent 60%),
    radial-gradient(500px 320px at 5% 100%, rgba(107, 92, 255, .3), transparent 60%),
    #0b1020;
  color: #fff;
  margin-bottom: 22px;
}
.onboarding h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.025em; max-width: 560px; }
.onboarding p { margin-top: 8px; color: rgba(255,255,255,.6); font-size: .88rem; max-width: 520px; line-height: 1.6; }
.onboarding-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.onboarding-step { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.onboarding-step b { display: block; font-size: .78rem; }
.onboarding-step span { display: block; font-size: .7rem; color: rgba(255,255,255,.5); margin-top: 3px; line-height: 1.4; }
.onboarding-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.onboarding-actions .btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.18); }

/* ---------------------------- billing -------------------------- */
.plan-current {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0b1020, #1a2350);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.plan-current::after {
  content: ""; position: absolute; width: 320px; height: 320px; right: -60px; top: -140px;
  background: radial-gradient(circle, rgba(107, 92, 255, .55), transparent 65%);
}
.plan-current .pc-main { position: relative; z-index: 1; flex: 1; min-width: 200px; }
.plan-current .pc-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.45); }
.plan-current h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; margin-top: 3px; }
.plan-current p { font-size: .8rem; color: rgba(255,255,255,.55); margin-top: 5px; }
.plan-current .pc-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.usage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.usage-card { padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; }
.usage-card .uc-top { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); }
.usage-card .uc-top b { color: var(--ink); }
.usage-card .uc-bar { height: 7px; border-radius: 99px; background: #eef1f8; margin-top: 10px; overflow: hidden; }
.usage-card .uc-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .6s; }
.usage-card .uc-bar i.warn { background: linear-gradient(90deg, #f5b942, #f08c1a); }
.usage-card .uc-note { font-size: .68rem; color: var(--muted-2); margin-top: 8px; }
.plans-billing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.plan-b-card { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: #fff; position: relative; }
.plan-b-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(107, 92, 255, .1); }
.plan-b-card .pbc-tag { position: absolute; top: -9px; left: 20px; background: var(--violet-soft); color: var(--brand); font-size: .64rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.plan-b-card .pbc-name { font-size: .98rem; font-weight: 800; }
.plan-b-card .pbc-desc { font-size: .75rem; color: var(--muted); margin-top: 3px; min-height: 32px; }
.plan-b-card .pbc-price { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; margin-top: 12px; }
.plan-b-card .pbc-price span { font-size: .76rem; font-weight: 500; color: var(--muted-2); letter-spacing: 0; }
.plan-b-card ul { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; font-size: .78rem; color: var(--ink-3); }
.plan-b-card li { display: flex; gap: 7px; }
.plan-b-card li::before { content: "✓"; color: var(--success); font-weight: 700; flex: 0 0 auto; }
.plan-b-card .btn { margin-top: 16px; }
.period-row { display: flex; align-items: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.period-row .label { font-size: .8rem; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: #eef0f8; border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; font-size: .76rem; font-weight: 600; color: var(--muted); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------------------------- help ----------------------------- */
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.help-card { padding: 20px; border: 1px solid var(--border); background: #fff; border-radius: 15px; }
.help-card .hc-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--violet-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.help-card h3 { font-size: .9rem; font-weight: 700; }
.help-card p { font-size: .8rem; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.help-card a { display: inline-flex; margin-top: 10px; font-size: .78rem; color: var(--brand); font-weight: 600; }
.help-steps { counter-reset: hs; display: flex; flex-direction: column; gap: 16px; }
.help-step { display: flex; gap: 14px; }
.help-step::before { counter-increment: hs; content: counter(hs); width: 26px; height: 26px; border-radius: 8px; background: var(--violet-soft); color: var(--brand); font-weight: 700; font-size: .78rem; display: grid; place-items: center; flex: 0 0 auto; }
.help-step b { display: block; font-size: .86rem; }
.help-step span { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; line-height: 1.5; }

/* ---------------------------- misc ----------------------------- */
.link { color: var(--brand); font-weight: 600; }
.link:hover { text-decoration: underline; }
.link svg { display: inline-block; vertical-align: -2px; }
.note-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); font-size: .78rem; color: var(--muted); line-height: 1.5; }
.note-box .nb-icon { flex: 0 0 auto; margin-top: 1px; color: var(--brand); }
.note-box.warn { background: var(--warning-soft); border-color: transparent; color: #8a5b00; }
.note-box.warn .nb-icon { color: var(--warning); }
.note-box.danger { background: var(--danger-soft); border-color: transparent; color: #a52a2f; }
.note-box.danger .nb-icon { color: var(--danger); }
.note-box.success { background: var(--success-soft); border-color: transparent; color: #0b6b4a; }
.note-box.success .nb-icon { color: var(--success); }
.copy-row { display: flex; align-items: center; gap: 8px; }
.copy-row .code-box { flex: 1; }
.token-row { display: flex; gap: 8px; }
.token-row .input { flex: 1; }

/* ---------------------------- responsive ----------------------- */
@media (max-width: 1180px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .tester-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .plans-billing { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 270px;
    height: 100vh; height: 100dvh; max-height: 100dvh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  /* Профиль должен быть доступен без прокрутки, даже если карточка тарифа высокая. */
  .sidebar-bottom { margin-top: 14px; gap: 8px; flex-direction: column-reverse; }
  .plan-widget { padding: 10px 12px; }
  .side-nav a { padding: 9px 11px; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(10,15,30,.4); z-index: 39; }
  .sidebar-overlay.open { display: block; }
  .sidebar-toggle { display: inline-grid; }
  .topbar { padding: 10px 18px; }
  .view { padding: 22px 18px 60px; }
  .split-main { grid-template-columns: 1fr; }
  .scenario-layout { grid-template-columns: 1fr; }
  .scenario-side { position: static; }
  .onboarding-steps { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; }
  .split-2 { grid-template-columns: 1fr; }
  .tester-layout { grid-template-columns: 1fr; }
  .usage-grid { grid-template-columns: 1fr; }
  .grid-stats { gap: 10px; }
  .stat-card .sc-value { font-size: 1.35rem; }
  .topbar h1 { font-size: .98rem; }
  .topbar p { display: none; }
  .page-head h2 { font-size: 1.3rem; }
  .bot-hero h2 { font-size: 1.2rem; }
}
@media (max-width: 560px) {
  .view { padding: 16px 12px 60px; }
  #periodSeg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; width: 100%; }
  #periodSeg button { width: 100%; padding: 8px 6px; font-size: .72rem; }
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 14px; }
  .stat-card .sc-icon { display: none; }
  .bot-hero { gap: 12px; }
  .bot-hero .bh-actions { width: 100%; }
  .page-actions { width: 100%; }
  .topbar-actions .btn span { display: none; }
  .mini-phone { width: 100%; max-width: 320px; }
  .btn-row { grid-template-columns: 1fr 96px; }
  .btn-row .btn-target, .btn-row .btn-value { grid-column: 1 / -1; }
  .tabs { gap: 0; }
  .tab { padding: 9px 10px 11px; font-size: .8rem; }
}


/* Оверлей сайдбара скрыт на десктопе (иначе занимает ячейку grid) */
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 39; background: rgba(10, 15, 30, .4); }

/* --- FAQ в кабинете --- */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  font-weight: 600; font-size: .86rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted);
  transition: transform .2s, background .2s, color .2s;
}
.faq-item[open] summary .plus { transform: rotate(45deg); background: var(--violet-soft); color: var(--brand); border-color: transparent; }
.faq-answer { padding: 0 16px 16px; font-size: .82rem; line-height: 1.62; color: var(--muted); }
.faq-answer a { color: var(--brand); font-weight: 500; }

/* --- команды --- */
.cmd-row {
  display: grid;
  grid-template-columns: 16px minmax(90px, 150px) minmax(150px, 1fr) minmax(150px, 220px) 30px;
  gap: 8px;
  align-items: center;
}
.cmd-slash { color: var(--muted-2); font-weight: 700; text-align: center; }
.cmd-row .input, .cmd-row .select { min-height: 38px; height: 38px; font-size: .82rem; }
@media (max-width: 760px) {
  .cmd-row { grid-template-columns: 16px minmax(90px, 1fr) 30px; }
  .cmd-row .cmd-desc, .cmd-row .cmd-block { grid-column: 2 / 4; }
}

/* --- диалоги --- */
.dialog-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); max-width: 820px; }
.dialog-item:last-child { border-bottom: 0; }
.di-ava {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); display: grid; place-items: center;
  font-size: .68rem; font-weight: 700;
}
.di-ava.bot { background: var(--violet-soft); border-color: transparent; color: var(--brand); }
.di-body { min-width: 0; flex: 1; }
.di-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .7rem; margin-bottom: 4px; }
.di-head b { font-size: .78rem; color: var(--ink); }
.di-head span { color: var(--muted-2); }
.di-bubble {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 4px 11px 11px 11px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: .8rem;
  line-height: 1.45;
  white-space: pre-line;
  color: var(--ink-3);
  max-width: 100%;
}
.di-bubble.out { background: var(--violet-soft); border-color: transparent; color: var(--ink); }

/* --- тестер --- */
.tester-body .bubble { font-size: .82rem; padding: 9px 12px; }
.tester-body .mp-msg { max-width: 90%; }
.tester-body .mp-buttons { grid-template-columns: 1fr 1fr; }
.tester-body .mp-buttons button { font-size: .74rem; padding: 8px 6px; }
.tester-body .chat-date { align-self: center; }
.tester-screen .mp-head { padding: 12px 14px; }

/* --- мелочи --- */
.sidebar-logo .logo-mark { width: 32px; height: 32px; }
.bot-hero .bh-actions .btn { height: 38px; }
.user-widget { cursor: pointer; }
.topbar .sidebar-toggle { display: none; }
.uc-bar { height: 7px; border-radius: 99px; background: #eef1f8; overflow: hidden; margin: 5px 0 2px; }
.uc-bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .5s; }
.uc-bar i.warn { background: linear-gradient(90deg, #f5b942, #f08c1a); }
@media (max-width: 1024px) {
  .topbar .sidebar-toggle { display: inline-grid; }
}

/* ============================ админка, оплата, монетизация ============================ */
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.admin-toolbar .search-input { flex: 1; min-width: 220px; }
.admin-toolbar .select { max-width: 200px; }
.admin-row { cursor: pointer; }
.admin-user-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); gap: 18px; }
.admin-balance-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); }
.admin-mini-panel { border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.admin-mini-panel > b { display: block; font-size: .82rem; margin-bottom: 8px; }
.admin-mini-row { display: flex; align-items: center; gap: 7px; padding: 6px 0; font-size: .76rem; color: var(--ink-3); border-bottom: 1px dashed var(--border); }
.admin-mini-row:last-child { border-bottom: 0; }
.admin-mini-row .ellipsis { flex: 1; min-width: 0; }
.admin-mini-row .badge { font-size: .62rem; height: 20px; padding: 0 6px; }

.payment-banner {
  display: flex; align-items: center; gap: 14px;
  margin-top: 18px; padding: 16px 18px;
  border-radius: 14px; border: 1px solid var(--border);
  background: #fff;
}
.payment-banner .pb-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; }
.payment-banner b { display: block; font-size: .88rem; }
.payment-banner span { display: block; font-size: .78rem; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.payment-banner .badge { margin-left: auto; flex: 0 0 auto; }
.payment-banner.yookassa { background: linear-gradient(135deg, #f4f2ff, #eef7ff); border-color: #e3ddff; }
.payment-banner.yookassa .pb-icon { background: #fff; color: var(--brand); }
.payment-banner.demo { background: var(--warning-soft); border-color: transparent; }
.payment-banner.demo .pb-icon { background: #fff; color: var(--warning); }

.balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.balance-card { padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.balance-card .bc-label { font-size: .76rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.balance-card .bc-value { font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; }
.balance-card .bc-note { font-size: .7rem; color: var(--muted-2); margin-top: 4px; line-height: 1.4; }

.checkout-plan { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.checkout-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.method { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; cursor: pointer; font-size: .8rem; background: #fff; }
.method.active { border-color: var(--brand); background: var(--violet-soft); }
.method input { accent-color: var(--brand); }
.method .method-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--brand); flex: 0 0 auto; }
.method b { display: block; font-size: .8rem; }
.method small { display: block; color: var(--muted-2); font-size: .68rem; }
.co-period { flex-wrap: wrap; }

.plan-b-card.popular { border-color: rgba(107,92,255,.35); box-shadow: 0 12px 28px -18px rgba(107,92,255,.7); }
.plan-b-card .pbc-tag { z-index: 1; }
.plans-billing .plan-b-card ul { flex: 1; }

@media (max-width: 1024px) {
  .admin-user-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .balance-grid { grid-template-columns: 1fr; }
  .checkout-methods { grid-template-columns: 1fr; }
  .payment-banner { flex-wrap: wrap; }
  .payment-banner .badge { margin-left: 0; }
  .admin-toolbar .select { max-width: none; flex: 1; }
}
/* Бейдж тарифа поверх карточки */
.plan-b-card .pbc-tag { z-index: 5; }
.admin-balance-box .form-row { grid-template-columns: 1fr; gap: 8px; }
.admin-balance-box .input, .admin-balance-box .select { min-height: 38px; }
.plan-b-card .pbc-tag { z-index: 5; }
.payment-banner.danger { background: var(--danger-soft); border-color: transparent; }
.payment-banner.danger .pb-icon { background: #fff; color: var(--danger); }

/* ================= команда, медиа, сценарий, интеграции ================= */
.team-layout { align-items: start; }
.team-members { display: flex; flex-direction: column; gap: 2px; }
.team-member { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; }
.team-member:hover { background: var(--bg-2); }
.team-member.owner { background: var(--violet-soft); }
.team-avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--violet)); color: #fff; font-weight: 800; flex: 0 0 auto; }
.team-member-main { flex: 1; min-width: 0; }
.team-member-name { font-weight: 700; font-size: .86rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-member-email { font-size: .74rem; color: var(--muted); margin-top: 2px; }
.team-member-actions { display: flex; align-items: center; gap: 6px; }
.select-sm { min-height: 32px; font-size: .74rem; padding: 4px 28px 4px 8px; }
.team-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--violet-soft); color: var(--ink-3); font-size: .76rem; line-height: 1.5; margin-top: 14px; }
.role-list { display: flex; flex-direction: column; gap: 12px; }
.role-row { display: flex; gap: 10px; align-items: flex-start; }
.role-row p { margin: 2px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.role-row strong { font-size: .82rem; }
.role-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; background: var(--muted-2); }
.role-dot.owner { background: var(--brand); }
.role-dot.admin { background: #7c3aed; }
.role-dot.editor { background: #0ea5e9; }
.role-dot.viewer { background: #94a3b8; }
.team-invite-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.team-invite-panel h4 { font-size: .84rem; margin-bottom: 10px; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.invite-row:last-child { border-bottom: 0; }
.invite-actions { display: flex; gap: 6px; align-items: center; }
.team-invite-banner { display: flex; gap: 8px; align-items: center; background: var(--violet-soft); color: var(--brand); border-radius: 10px; padding: 10px 12px; font-size: .78rem; line-height: 1.4; margin-bottom: 14px; }
@media (max-width: 900px) {
  .team-layout { grid-template-columns: 1fr; }
  .team-member { flex-wrap: wrap; }
  .team-member-actions { width: 100%; justify-content: flex-end; }
}

/* медиа */
.media-picker { display: flex; flex-direction: column; gap: 10px; }
.media-selected { display: flex; flex-wrap: wrap; gap: 8px; }
.media-chip { display: flex; align-items: center; gap: 7px; padding: 5px 8px 5px 5px; border: 1px solid var(--border); border-radius: 10px; background: #fff; max-width: 230px; }
.media-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 7px; }
.media-file-icon { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; background: var(--violet-soft); color: var(--brand); }
.media-chip-name { font-size: .72rem; max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-remove { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; }
.media-remove:hover { color: var(--danger); }
.media-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-media { width: 100%; display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.mp-media img { max-width: 100%; border-radius: 10px; max-height: 180px; object-fit: cover; }
.mp-file { display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 9px; background: var(--bg-2); color: var(--ink-3); font-size: .75rem; text-decoration: none; }
.mp-file:hover { background: var(--violet-soft); }

/* типы блоков сценария */
.chip-tiny { font-size: .6rem; padding: 1px 6px; }
.bc-ico.type-condition { background: #f3e8ff; color: #7c3aed; }
.bc-ico.type-action { background: #fef3c7; color: #b45309; }
.bc-ico.type-input { background: #e0f2fe; color: #0369a1; }
.bc-ico.type-http { background: #dcfce7; color: #15803d; }
.type-panel { margin-top: 6px; }
.type-panel.hidden { display: none; }
.grid-3col-tight { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; }
@media (max-width: 760px) {
  .grid-3col-tight { grid-template-columns: 1fr; }
}

/* интеграции */
.integration-hero { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: linear-gradient(120deg, var(--violet-soft), #eef2ff); margin-bottom: 16px; }
.ih-icon { width: 42px; height: 42px; border-radius: 12px; background: #fff; color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.integration-hero strong { font-size: .86rem; }
.integration-hero p { margin: 4px 0 0; font-size: .76rem; color: var(--ink-3); line-height: 1.5; }
.integration-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.integration-card:last-child { border-bottom: 0; }
.integration-main { min-width: 0; flex: 1; }
.integration-url { display: flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--ink-3); }
.integration-url code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 620px; }
.integration-actions { display: flex; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 8px; background: var(--bg-2); color: var(--ink-3); font-size: .66rem; }
.chip-violet { background: var(--violet-soft); color: var(--brand); }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(16px); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-3); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
@media (max-width: 760px) {
  .integration-card { align-items: flex-start; }
  .integration-actions { width: 100%; justify-content: flex-end; }
  .integration-url code { max-width: 230px; }
}

/* A/B рассылки */
.ab-toggle-row { padding: 10px 12px; border-radius: 10px; background: var(--violet-soft); margin-bottom: 12px; }
.ab-block.hidden { display: none; }
.ab-results { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding: 8px 10px; background: var(--bg-2); border-radius: 9px; }
.ab-result-row { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 8px; align-items: center; font-size: .72rem; color: var(--ink-3); }
.ab-label { font-weight: 800; color: var(--brand); }
.ab-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-stat { color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) {
  .ab-result-row { grid-template-columns: 20px 1fr; }
  .ab-stat { grid-column: 2; }
}

/* тестер: переменные */
.tester-vars { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.tester-var-row { display: flex; gap: 8px; font-size: .72rem; align-items: flex-start; }
.tester-var-row > span { color: var(--muted); min-width: 80px; }
.tester-var-row > div { display: flex; flex-wrap: wrap; gap: 4px; }

.grid-2col-tight { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .grid-2col-tight { grid-template-columns: 1fr; } }

.team-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .team-layout { grid-template-columns: 1fr; } }

.panel-title { font-size: 1rem; font-weight: 700; }
.panel-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }

/* прокрутка вкладок бота */
.tabs-scroll { display: flex; align-items: center; gap: 4px; margin-bottom: 22px; }
.tabs-scroll .tabs { flex: 1; margin-bottom: 0; scrollbar-width: thin; scrollbar-color: var(--brand) var(--bg-2); padding-bottom: 5px; }
.tabs-scroll .tabs::-webkit-scrollbar { display: block; height: 6px; }
.tabs-scroll .tabs::-webkit-scrollbar-track { background: var(--bg-2); border-radius: 99px; }
.tabs-scroll .tabs::-webkit-scrollbar-thumb { background: var(--brand); border-radius: 99px; }
.tabs-scroll.no-overflow .tabs { padding-bottom: 0; }
.tabs-arrow { flex: 0 0 auto; width: 28px; height: 30px; border: 1px solid var(--border); background: #fff; color: var(--ink-3); border-radius: 8px; cursor: pointer; font-size: 1.2rem; line-height: 1; display: grid; place-items: center; }
.tabs-arrow:hover { background: var(--violet-soft); color: var(--brand); }
.tabs-arrow.is-hidden { visibility: hidden; pointer-events: none; }
@media (max-width: 700px) {
  .tabs-arrow { width: 24px; height: 28px; }
}

.auth-mail-icon { width: 62px; height: 62px; border-radius: 18px; background: var(--violet-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.auth-success { display: flex; gap: 8px; align-items: center; background: #e9f9ef; color: #147a43; border-radius: 10px; padding: 10px 12px; font-size: .8rem; margin-bottom: 14px; }

/* Visual flow editor */
.flow-page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:14px; }
.flow-work { display:grid; grid-template-columns:236px minmax(0,1fr); gap:12px; align-items:stretch; }
.flow-palette { background:#fff; border:1px solid var(--border); border-radius:16px; padding:12px; height:min(72vh,720px); overflow:auto; box-shadow:0 8px 28px rgba(26,27,51,.05); }
.flow-palette-title { font-size:.82rem; font-weight:800; color:var(--ink); }
.flow-palette-sub { font-size:.68rem; color:var(--muted); margin:2px 0 10px; line-height:1.35; }
.flow-palette-item { width:100%; display:flex; gap:9px; align-items:flex-start; text-align:left; padding:9px; border:1px solid var(--border); background:#fff; border-radius:11px; margin-bottom:7px; cursor:grab; color:var(--ink); }
.flow-palette-item:hover { border-color:var(--brand); background:var(--violet-soft); }
.flow-palette-item:active { cursor:grabbing; }
.flow-palette-ico { width:28px; height:28px; flex:0 0 28px; border-radius:8px; display:grid; place-items:center; background:var(--violet-soft); color:var(--brand); }
.flow-palette-item b { display:block; font-size:.74rem; line-height:1.2; }
.flow-palette-item small { display:block; color:var(--muted); font-size:.64rem; line-height:1.25; margin-top:2px; }
.flow-palette-item.type-notify .flow-palette-ico { background:#fff4e5; color:#b45b00; }
.flow-palette-item.type-condition .flow-palette-ico { background:#e8f8f1; color:#137a50; }
.flow-palette-tip { margin-top:12px; padding-top:10px; border-top:1px solid var(--border); color:var(--muted); font-size:.66rem; line-height:1.45; display:flex; gap:5px; }
.flow-stage { min-width:0; }
.flow-viewport { position:relative; height:min(72vh,720px); border:1px solid var(--border); border-radius:16px; overflow:hidden; background-color:#fafaff; background-image:radial-gradient(#dfe1f0 1px, transparent 1px); background-size:22px 22px; touch-action:none; cursor:grab; }
.flow-viewport.is-panning { cursor:grabbing; }
.flow-viewport.is-readonly { cursor:default; }
.flow-world { position:absolute; left:0; top:0; transform-origin:0 0; min-width:900px; min-height:600px; }
.flow-edges { position:absolute; left:0; top:0; overflow:visible; pointer-events:none; color:#9aa0ba; z-index:1; }
.flow-edge { fill:none; stroke:#aeb3cc; stroke-width:2; pointer-events:stroke; cursor:pointer; transition:stroke .15s; }
.flow-edge:hover { stroke:#6b5cff; stroke-width:3; }
.flow-edge-temp { stroke:#6b5cff; stroke-dasharray:6 5; pointer-events:none; }
.flow-edge-label { fill:#8188a5; font-size:10px; font-family:inherit; pointer-events:none; }
.flow-nodes { position:absolute; inset:0; z-index:2; }
.flow-node { position:absolute; background:#fff; border:1px solid #d9dced; border-radius:14px; box-shadow:0 8px 22px rgba(35,39,78,.08); cursor:grab; user-select:none; transition:box-shadow .15s,border-color .15s; }
.flow-node:hover { border-color:#b7b2ff; box-shadow:0 12px 28px rgba(70,60,180,.14); }
.flow-node.is-dragging { cursor:grabbing; box-shadow:0 18px 38px rgba(70,60,180,.2); z-index:5; }
.flow-node.is-target { border-color:var(--brand); box-shadow:0 0 0 4px rgba(107,92,255,.16); }
.flow-node.is-start { border-color:#8fd7b6; }
.flow-node-head { display:flex; align-items:center; gap:6px; padding:9px 9px 7px; border-bottom:1px solid #f0f1f8; }
.flow-node-ico { width:24px; height:24px; border-radius:7px; display:grid; place-items:center; flex:0 0 24px; background:var(--violet-soft); color:var(--brand); }
.flow-node.type-condition .flow-node-ico { background:#e8f8f1; color:#137a50; }
.flow-node.type-notify .flow-node-ico { background:#fff4e5; color:#b45b00; }
.flow-node.type-fallback .flow-node-ico { background:#fff1f0; color:#b42318; }
.flow-node.type-delay .flow-node-ico { background:#eef3ff; color:#4356c7; }
.flow-node.type-catalog .flow-node-ico { background:#e9f9ef; color:#137a50; }
.flow-node.type-http .flow-node-ico { background:#eaf2ff; color:#2864c8; }
.flow-node-name { font-size:.74rem; font-weight:800; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.flow-start-badge { font-size:.57rem; font-weight:800; color:#147a43; background:#e9f9ef; border-radius:99px; padding:3px 6px; text-transform:uppercase; letter-spacing:.02em; }
.flow-node-edit { border:0; background:transparent; color:var(--muted); padding:2px; cursor:pointer; border-radius:5px; display:grid; place-items:center; }
.flow-node-edit:hover { background:var(--violet-soft); color:var(--brand); }
.flow-node-body { padding:9px 10px; font-size:.68rem; color:var(--ink-3); line-height:1.4; min-height:34px; max-height:62px; overflow:hidden; white-space:pre-wrap; }
.flow-node-foot { padding:5px 7px 8px; display:flex; flex-direction:column; gap:4px; border-top:1px dashed #eff0f7; }
.flow-out { border:0; background:transparent; display:flex; align-items:center; justify-content:flex-end; gap:6px; padding:3px 1px; cursor:crosshair; color:var(--muted); font-size:.62rem; font-weight:700; }
.flow-out:hover { color:var(--brand); }
.flow-out-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.flow-out.is-add { color:var(--brand); }
.flow-port { position:absolute; width:11px; height:11px; border-radius:50%; background:#fff; border:2px solid #aeb3cc; z-index:4; }
.flow-port-in { left:-6px; top:44px; }
.flow-port-out { position:relative; left:4px; width:10px; height:10px; flex:0 0 10px; }
.flow-out:hover .flow-port-out { border-color:var(--brand); background:var(--violet-soft); }
.flow-toolbar { position:absolute; right:12px; top:12px; z-index:9; display:flex; align-items:center; gap:3px; background:rgba(255,255,255,.94); border:1px solid var(--border); border-radius:10px; padding:3px; box-shadow:0 4px 14px rgba(30,32,70,.08); }
.flow-tool { border:0; background:transparent; color:var(--ink-3); width:28px; height:26px; border-radius:7px; cursor:pointer; display:grid; place-items:center; font-size:1rem; }
.flow-tool:hover { background:var(--violet-soft); color:var(--brand); }
.flow-fit-btn { width:32px; }
.flow-zoom-label { min-width:40px; text-align:center; font-size:.65rem; font-weight:800; color:var(--muted); }
.flow-empty { position:absolute; inset:0; display:grid; place-items:center; color:var(--muted); font-size:.8rem; pointer-events:none; }
.flow-legend { display:flex; gap:16px; flex-wrap:wrap; margin-top:10px; color:var(--muted); font-size:.66rem; }
.flow-legend span { display:inline-flex; gap:4px; align-items:center; }
.flow-dirty { margin-left:auto; color:#147a43; font-weight:800; }
.flow-dirty.is-dirty { color:#b45b00; }
#flowApply.has-changes { box-shadow:0 0 0 3px rgba(107,92,255,.18); }
@media (max-width: 900px) {
  .flow-work { grid-template-columns:1fr; }
  .flow-palette { height:auto; display:flex; gap:6px; overflow-x:auto; padding:9px; }
  .flow-palette-title, .flow-palette-sub, .flow-palette-tip { display:none; }
  .flow-palette-item { min-width:160px; margin:0; }
  .flow-viewport { height:62vh; min-height:400px; }
  .flow-legend { gap:9px; }
}
@media (max-width: 560px) {
  .flow-palette-item { min-width:140px; }
  .flow-palette-item small { display:none; }
  .flow-node { width:220px !important; }
}

.flow-page.is-fullscreen { position:fixed; inset:0; z-index:150; background:var(--bg, #f7f7fb); padding:14px; display:flex; flex-direction:column; overflow:hidden; }
.flow-page.is-fullscreen .flow-page-head { flex:0 0 auto; }
.flow-page.is-fullscreen .flow-work { flex:1; min-height:0; }
.flow-page.is-fullscreen .flow-palette { height:100%; }
.flow-page.is-fullscreen .flow-stage { min-height:0; display:flex; }
.flow-page.is-fullscreen .flow-viewport { height:100%; flex:1; }
.flow-page.is-fullscreen .flow-legend { flex:0 0 auto; }
@media (max-width: 900px) {
  .flow-page.is-fullscreen { padding:8px; }
  .flow-page.is-fullscreen .flow-work { display:flex; flex-direction:column; }
  .flow-page.is-fullscreen .flow-palette { height:auto; max-height:120px; flex:0 0 auto; }
}

.subscriber-pick { width:100%; display:flex; align-items:center; gap:10px; text-align:left; border:1px solid var(--border); background:#fff; border-radius:10px; padding:9px 10px; cursor:pointer; color:var(--ink); }
.subscriber-pick:hover { border-color:var(--brand); background:var(--violet-soft); }
.sp-ava { width:30px; height:30px; flex:0 0 30px; border-radius:50%; background:var(--violet-soft); color:var(--brand); display:grid; place-items:center; font-weight:800; font-size:.75rem; }
.sp-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.sp-main b { font-size:.76rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sp-main small { font-size:.66rem; color:var(--muted); }
.sp-pick { font-size:.65rem; font-weight:800; color:var(--brand); white-space:nowrap; }
