:root {
  --premium-bg: #f3f6fb;
  --premium-surface: rgba(255, 255, 255, .92);
  --premium-surface-strong: #ffffff;
  --premium-surface-soft: #f8fafc;
  --premium-sidebar: #08111f;
  --premium-sidebar-2: #0d1728;
  --premium-text: #152033;
  --premium-muted: #738096;
  --premium-line: rgba(148, 163, 184, .20);
  --premium-line-strong: rgba(148, 163, 184, .30);
  --premium-blue: #229ed9;
  --premium-blue-2: #0d8dcc;
  --premium-blue-soft: #e8f6fd;
  --premium-cyan: #56c6f4;
  --premium-green: #1fb978;
  --premium-red: #df5555;
  --premium-shadow-sm: 0 6px 20px rgba(15, 23, 42, .055);
  --premium-shadow-md: 0 16px 40px rgba(15, 23, 42, .075);
  --premium-shadow-lg: 0 24px 60px rgba(15, 23, 42, .10);
}

html,
body,
button,
input,
textarea,
select {
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif !important;
}

body {
  background:
    radial-gradient(circle at 88% -6%, rgba(34, 158, 217, .15), transparent 24%),
    radial-gradient(circle at 32% 105%, rgba(73, 190, 239, .08), transparent 26%),
    linear-gradient(180deg, #f7f9fc 0%, #f1f5f9 100%) !important;
  color: var(--premium-text) !important;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .26;
  background-image:
    linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 68%);
}

.app {
  min-height: 100vh;
}

.sidebar {
  width: 272px !important;
  padding: 22px 16px 18px !important;
  background:
    radial-gradient(circle at 12% 2%, rgba(34,158,217,.16), transparent 22%),
    linear-gradient(180deg, var(--premium-sidebar) 0%, var(--premium-sidebar-2) 52%, #09111d 100%) !important;
  border-right: 1px solid rgba(255,255,255,.055) !important;
  box-shadow: 16px 0 44px rgba(15,23,42,.10) !important;
  position: relative;
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  left: -90px;
  bottom: -110px;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: rgba(34,158,217,.07);
  filter: blur(2px);
  pointer-events: none;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  margin: 2px 9px 18px !important;
  color: #f8fbff;
  font-size: 28px !important;
  font-weight: 900 !important;
  letter-spacing: -1.1px !important;
}

.logo::before {
  content: "N";
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 11px;
  background:
    linear-gradient(145deg, #4fc3f0, #168bc4);
  color: white;
  font-size: 16px;
  letter-spacing: 0;
  box-shadow:
    0 7px 20px rgba(34,158,217,.30),
    inset 0 1px 0 rgba(255,255,255,.28);
}

.logo span {
  color: #43d58a !important;
}

.tg-bot-sidebar-card {
  position: relative;
  margin: 0 0 18px !important;
  padding: 14px !important;
  border: 1px solid rgba(255,255,255,.075) !important;
  border-radius: 16px !important;
  background:
    linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.035)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.045),
    0 10px 28px rgba(0,0,0,.10);
  backdrop-filter: blur(12px);
}

.tg-bot-sidebar-card::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35d08b;
  box-shadow: 0 0 0 4px rgba(53,208,139,.10);
}

.tg-bot-sidebar-label {
  margin-bottom: 11px !important;
  color: #6f809b !important;
  font-size: 9px !important;
  letter-spacing: .13em !important;
}

.tg-bot-sidebar-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 13px !important;
  background:
    linear-gradient(145deg, #40b8e9, #147daf) !important;
  box-shadow:
    0 9px 20px rgba(34,158,217,.24),
    inset 0 1px 0 rgba(255,255,255,.20) !important;
}

.tg-bot-sidebar-name {
  font-size: 13px !important;
  letter-spacing: -.1px;
}

.tg-bot-sidebar-user {
  color: #8496b0 !important;
}

.channel-label {
  margin: 18px 0 9px !important;
  padding: 0 11px !important;
  color: #5f6f88 !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: .15em !important;
}

.menu-item {
  min-height: 44px;
  display: flex !important;
  align-items: center;
  padding: 11px 13px !important;
  margin-bottom: 5px !important;
  border-radius: 12px !important;
  color: #aab8cc !important;
  font-size: 13px !important;
  font-weight: 680 !important;
  letter-spacing: -.05px;
  transition:
    transform .16s ease,
    background .16s ease,
    color .16s ease,
    box-shadow .16s ease !important;
}

.menu-item:hover {
  transform: translateX(2px);
  background: rgba(255,255,255,.065) !important;
  color: #f8fbff !important;
}

.menu-item.active {
  background:
    linear-gradient(90deg, rgba(34,158,217,.26), rgba(34,158,217,.09)) !important;
  color: #ffffff !important;
  box-shadow:
    inset 3px 0 0 #38bdf8,
    0 6px 18px rgba(0,0,0,.08) !important;
}

.menu-item.active::after {
  right: 13px !important;
  width: 6px !important;
  height: 6px !important;
  background: #6dd3fb !important;
  box-shadow: 0 0 0 4px rgba(109,211,251,.10);
}

.main {
  min-width: 0;
}

.topbar {
  height: 82px !important;
  margin: 0 !important;
  padding: 0 28px !important;
  border-bottom: 1px solid rgba(148,163,184,.16) !important;
  background: rgba(255,255,255,.86) !important;
  backdrop-filter: blur(18px) saturate(145%);
  box-shadow: 0 8px 28px rgba(15,23,42,.035);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar h2 {
  color: #152033 !important;
  font-size: 19px !important;
  font-weight: 850 !important;
  letter-spacing: -.45px !important;
}

.tg-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-topbar-bot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 7px;
  border: 1px solid rgba(148,163,184,.20);
  border-radius: 13px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 14px rgba(15,23,42,.045);
}

.tg-topbar-bot-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #42b9e9, #1689bd);
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.tg-topbar-bot-copy {
  min-width: 0;
  line-height: 1.1;
}

.tg-topbar-bot-name {
  max-width: 155px;
  color: #27344a;
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-topbar-bot-user {
  max-width: 155px;
  margin-top: 3px;
  color: #8793a5;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  min-height: 34px !important;
  padding: 7px 11px !important;
  border-radius: 11px !important;
  border: 1px solid rgba(148,163,184,.19) !important;
  background: rgba(255,255,255,.94) !important;
  color: #607087 !important;
  box-shadow: 0 4px 14px rgba(15,23,42,.04) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
}

.status-badge.ok {
  border-color: rgba(31,185,120,.20) !important;
  background: #edf9f4 !important;
  color: #188158 !important;
}

.status-badge.error {
  border-color: rgba(223,85,85,.20) !important;
  background: #fff3f3 !important;
  color: #b63f3f !important;
}

.page {
  padding: 30px !important;
  animation: tgPageIn .24s ease both;
}

@keyframes tgPageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page:not(.conversations) {
  max-width: 1480px !important;
}

.page-header {
  align-items: center !important;
  margin-bottom: 22px !important;
}

.page-header h1 {
  color: #162136 !important;
  font-size: 26px !important;
  font-weight: 900 !important;
  letter-spacing: -.75px !important;
}

.page-header p {
  margin-top: 4px;
  color: #77859a !important;
  font-size: 13px !important;
}

.card {
  border: 1px solid var(--premium-line) !important;
  border-radius: 17px !important;
  background: rgba(255,255,255,.94) !important;
  box-shadow: var(--premium-shadow-sm) !important;
  backdrop-filter: blur(12px);
}

.btn {
  min-height: 40px !important;
  padding: 10px 15px !important;
  border-radius: 11px !important;
  background:
    linear-gradient(180deg, #27a8df, #178dc6) !important;
  color: white !important;
  box-shadow:
    0 7px 18px rgba(34,158,217,.17),
    inset 0 1px 0 rgba(255,255,255,.18) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.btn:hover {
  transform: translateY(-1px) !important;
  box-shadow:
    0 9px 22px rgba(34,158,217,.22),
    inset 0 1px 0 rgba(255,255,255,.18) !important;
}

.btn.secondary {
  border: 1px solid rgba(148,163,184,.22) !important;
  background: #f6f8fb !important;
  color: #4f5d73 !important;
  box-shadow: none !important;
}

.btn.danger {
  border: 1px solid rgba(223,85,85,.15) !important;
  background: linear-gradient(180deg, #eb6464, #d94d4d) !important;
  box-shadow: 0 7px 18px rgba(217,77,77,.14) !important;
}

.page.conversations.active {
  height: calc(100vh - 82px);
  background:
    linear-gradient(90deg, rgba(255,255,255,.75), rgba(248,250,252,.72)) !important;
}

.conversation-list {
  width: 350px !important;
  background: rgba(255,255,255,.92) !important;
  border-right: 1px solid rgba(148,163,184,.16) !important;
  box-shadow: 8px 0 28px rgba(15,23,42,.025);
}

.conversation-search {
  padding: 15px !important;
  background: rgba(255,255,255,.90) !important;
  border-bottom: 1px solid rgba(148,163,184,.14) !important;
  position: sticky;
  top: 0;
  z-index: 3;
}

.conversation-search::before {
  content: "⌕";
  position: absolute;
  left: 29px;
  top: 50%;
  transform: translateY(-50%);
  color: #93a1b3;
  font-size: 17px;
  pointer-events: none;
}

.conversation-search input {
  width: 100%;
  min-height: 43px !important;
  padding: 0 13px 0 37px !important;
  border: 1px solid rgba(148,163,184,.22) !important;
  border-radius: 13px !important;
  background: #f6f8fb !important;
  color: #263248;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.conversation-search input:focus {
  border-color: rgba(34,158,217,.38) !important;
  background: white !important;
  box-shadow: 0 0 0 4px rgba(34,158,217,.075) !important;
}

#conversationList {
  padding: 7px 5px 14px;
}

.conversation-row {
  min-height: 68px;
  margin: 4px 6px !important;
  padding: 10px !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  transition:
    background .15s ease,
    border-color .15s ease,
    transform .15s ease,
    box-shadow .15s ease !important;
}

.conversation-row:hover {
  transform: translateX(2px);
  border-color: rgba(148,163,184,.14) !important;
  background: #f8fbfd !important;
}

.conversation-row.active {
  border-color: rgba(34,158,217,.20) !important;
  background:
    linear-gradient(135deg, #edf8fe, #f6fbfe) !important;
  box-shadow: 0 6px 18px rgba(34,158,217,.07);
}

.avatar {
  width: 43px !important;
  height: 43px !important;
  border-radius: 14px !important;
  background:
    linear-gradient(145deg, #43bbea, #1787bb) !important;
  box-shadow:
    0 7px 16px rgba(34,158,217,.18),
    inset 0 1px 0 rgba(255,255,255,.20) !important;
}

.conversation-name {
  color: #27344a !important;
  font-size: 13px !important;
  font-weight: 850 !important;
}

.conversation-preview {
  margin-top: 4px;
  color: #8591a3 !important;
  font-size: 11px !important;
  line-height: 1.35;
}

.chat {
  background:
    radial-gradient(circle at 85% 12%, rgba(34,158,217,.08), transparent 19%),
    linear-gradient(rgba(246,249,252,.94), rgba(246,249,252,.94)),
    radial-gradient(circle at 1px 1px, #dce4ec 1px, transparent 0) !important;
  background-size: auto, auto, 25px 25px !important;
}

.chat-header {
  min-height: 72px !important;
  padding: 12px 20px !important;
  background: rgba(255,255,255,.93) !important;
  border-bottom: 1px solid rgba(148,163,184,.15) !important;
  backdrop-filter: blur(14px);
  box-shadow: 0 7px 22px rgba(15,23,42,.025) !important;
}

.chat-header-name {
  color: #243146 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.chat-header-user {
  margin-top: 3px;
  color: #8995a6 !important;
  font-size: 10px !important;
}

.chat-messages {
  padding: 28px 30px !important;
}

.message-row {
  margin-bottom: 10px !important;
}

.bubble {
  max-width: min(680px, 76%) !important;
  padding: 11px 13px !important;
  border: 1px solid rgba(148,163,184,.16) !important;
  border-radius: 15px 15px 15px 5px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 7px 20px rgba(15,23,42,.055) !important;
  color: #2b374a !important;
  line-height: 1.48 !important;
}

.message-row.out .bubble {
  border-color: rgba(34,158,217,.17) !important;
  border-radius: 15px 15px 5px 15px !important;
  background:
    linear-gradient(145deg, #dff4ff, #eaf8ff) !important;
  box-shadow: 0 7px 20px rgba(34,158,217,.075) !important;
}

.bubble-time {
  margin-top: 5px !important;
  color: #98a4b4 !important;
  font-size: 9px !important;
}

.chat-compose {
  padding: 14px 18px !important;
  background: rgba(255,255,255,.92) !important;
  border-top: 1px solid rgba(148,163,184,.14) !important;
  backdrop-filter: blur(14px);
}

.chat-compose textarea {
  min-height: 47px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(148,163,184,.22) !important;
  border-radius: 14px !important;
  background: #f8fafc !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.chat-compose textarea:focus {
  border-color: rgba(34,158,217,.38) !important;
  background: white !important;
  box-shadow: 0 0 0 4px rgba(34,158,217,.07) !important;
}

.chat-placeholder {
  color: #8b97a8 !important;
}

.table-wrap {
  overflow: hidden !important;
}

table {
  background: white;
}

thead th {
  height: 46px;
  padding: 12px 14px !important;
  background: #f8fafc !important;
  color: #738096 !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  letter-spacing: .055em !important;
  border-bottom: 1px solid rgba(148,163,184,.15) !important;
}

tbody td {
  padding: 14px !important;
  color: #425067 !important;
  font-size: 12px !important;
  border-bottom: 1px solid rgba(148,163,184,.12) !important;
}

tbody tr:hover td {
  background: #fbfdff !important;
}

.pill {
  padding: 5px 9px !important;
  border-radius: 999px !important;
  background: #f2f5f8 !important;
  color: #69778c !important;
}

.pill.active {
  background: #e8f8f0 !important;
  color: #188158 !important;
}

.form-card {
  padding: 20px !important;
}

.field label {
  color: #556278 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.field input,
.field textarea,
.field select {
  border: 1px solid rgba(148,163,184,.22) !important;
  border-radius: 11px !important;
  background: #f9fbfd !important;
  color: #2b374a !important;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(34,158,217,.40) !important;
  background: white !important;
  box-shadow: 0 0 0 4px rgba(34,158,217,.07) !important;
}

.tg-settings-shell {
  gap: 20px !important;
}

.tg-settings-hero {
  min-height: 150px;
  padding: 27px !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 82% 18%, rgba(74,201,250,.18), transparent 22%),
    linear-gradient(135deg, #0a1423 0%, #11243a 54%, #14344b 100%) !important;
  box-shadow: 0 22px 55px rgba(15,23,42,.16) !important;
}

.tg-settings-hero::before {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -82px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(34,158,217,.07);
}

.tg-settings-kicker {
  color: #75d4fa !important;
  font-size: 9px !important;
  letter-spacing: .16em !important;
}

.tg-settings-bot-name {
  font-size: 29px !important;
  font-weight: 950 !important;
  letter-spacing: -1px !important;
}

.tg-settings-bot-user {
  color: #9db9cc !important;
}

.tg-settings-hero-badge {
  padding: 10px 13px !important;
  border: 1px solid rgba(80,220,151,.23) !important;
  background: rgba(42,190,124,.13) !important;
  color: #c8f7dd !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.tg-metric-grid {
  gap: 14px !important;
}

.tg-metric-card {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 19px !important;
  border: 1px solid var(--premium-line) !important;
  border-radius: 17px !important;
  background: rgba(255,255,255,.94) !important;
  box-shadow: var(--premium-shadow-sm) !important;
}

.tg-metric-card::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -28px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(34,158,217,.055);
}

.tg-metric-label {
  color: #7d899b !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.tg-metric-value {
  margin-top: 8px !important;
  color: #1d2a40 !important;
  font-size: 29px !important;
  font-weight: 950 !important;
  letter-spacing: -1px !important;
}

.tg-info-grid {
  gap: 16px !important;
}

.tg-info-card {
  padding: 21px !important;
  border: 1px solid var(--premium-line) !important;
  border-radius: 17px !important;
  background: rgba(255,255,255,.95) !important;
  box-shadow: var(--premium-shadow-sm) !important;
}

.tg-info-card h3 {
  color: #213047 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

.tg-info-card > p {
  color: #8290a3 !important;
}

.tg-info-row {
  padding: 11px 0 !important;
  border-top: 1px solid rgba(148,163,184,.13) !important;
}

.tg-info-row strong {
  color: #39475d !important;
}

.tg-lock-box {
  margin-top: 6px;
  border: 1px solid rgba(148,163,184,.20) !important;
  border-radius: 12px !important;
  background: #f7f9fc !important;
  color: #6d7a8f !important;
}

.tg-bot-list-item {
  padding: 13px !important;
  border: 1px solid rgba(148,163,184,.17) !important;
  border-radius: 13px !important;
  background:
    linear-gradient(145deg, #fbfdff, #f7fafc) !important;
}

.tg-bot-list-icon {
  width: 39px !important;
  height: 39px !important;
  border-radius: 12px !important;
  background:
    linear-gradient(145deg, #e1f4fd, #eef9fe) !important;
  color: #1589bd !important;
  box-shadow: inset 0 0 0 1px rgba(34,158,217,.10);
}

/* FLOW PREMIUM */
body #telegramFlowEditorV3 {
  max-width: 1460px !important;
  margin-top: 6px !important;
}

body #telegramFlowEditorV3 .nf-flow-toolbar {
  margin-bottom: 18px !important;
  padding: 14px 15px !important;
  border: 1px solid var(--premium-line) !important;
  border-radius: 15px !important;
  background: rgba(255,255,255,.92) !important;
  box-shadow: var(--premium-shadow-sm) !important;
}

body #telegramFlowEditorV3 .nf-flow-note {
  color: #718096 !important;
}

body #telegramFlowEditorV3 .nf-flow-grid {
  grid-template-columns: minmax(0, 1fr) 400px !important;
  gap: 20px !important;
}

body #telegramFlowEditorV3 .nf-flow-canvas {
  min-height: 560px !important;
  padding: 34px 28px 44px !important;
  border: 1px solid rgba(148,163,184,.20) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 1px 1px, rgba(148,163,184,.26) 1.15px, transparent 0) !important;
  background-size: 26px 26px !important;
  background-color: #f7f9fc !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.75),
    var(--premium-shadow-md) !important;
}

body #telegramFlowEditorV3 .nf-flow-start,
body #telegramFlowEditorV3 .nf-flow-end {
  padding: 9px 17px !important;
  border-radius: 999px !important;
  letter-spacing: .08em !important;
  box-shadow: 0 8px 20px rgba(15,23,42,.10);
}

body #telegramFlowEditorV3 .nf-flow-start {
  background:
    linear-gradient(180deg, #19263a, #111b2b) !important;
}

body #telegramFlowEditorV3 .nf-flow-end {
  border: 1px solid rgba(148,163,184,.25) !important;
  background: rgba(255,255,255,.92) !important;
  color: #778398 !important;
  box-shadow: 0 6px 16px rgba(15,23,42,.05);
}

body #telegramFlowEditorV3 .nf-flow-connector {
  height: 66px !important;
  background:
    linear-gradient(#8abed6, #77b5d2) !important;
  opacity: .90;
}

body #telegramFlowEditorV3 .nf-flow-delay {
  padding: 5px 10px !important;
  border: 1px solid rgba(148,163,184,.22) !important;
  background: rgba(247,249,252,.96) !important;
  color: #718096 !important;
  box-shadow: 0 3px 9px rgba(15,23,42,.03);
}

body #telegramFlowEditorV3 .nf-flow-node {
  max-width: 680px !important;
  border: 1px solid rgba(148,163,184,.18) !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 14px 35px rgba(15,23,42,.075) !important;
  transition:
    transform .17s ease,
    box-shadow .17s ease,
    border-color .17s ease;
}

body #telegramFlowEditorV3 .nf-flow-node:hover {
  transform: translateY(-2px);
  border-color: rgba(34,158,217,.24) !important;
  box-shadow: 0 18px 42px rgba(15,23,42,.09) !important;
}

body #telegramFlowEditorV3 .nf-flow-node.welcome {
  border-color: rgba(34,158,217,.25) !important;
}

body #telegramFlowEditorV3 .nf-flow-node.editing {
  border-color: rgba(34,158,217,.48) !important;
  box-shadow:
    0 0 0 4px rgba(34,158,217,.08),
    0 18px 42px rgba(15,23,42,.09) !important;
}

body #telegramFlowEditorV3 .nf-flow-node-head {
  padding: 13px 16px !important;
  border-bottom: 1px solid rgba(148,163,184,.13) !important;
  background:
    linear-gradient(180deg, #fbfdff, #f8fafc) !important;
}

body #telegramFlowEditorV3 .nf-flow-node.welcome .nf-flow-node-head {
  background:
    linear-gradient(180deg, #eff9fe, #f6fbfe) !important;
}

body #telegramFlowEditorV3 .nf-flow-node-title {
  color: #27344a !important;
  font-weight: 900 !important;
}

body #telegramFlowEditorV3 .nf-flow-node-type {
  color: #8190a4 !important;
}

body #telegramFlowEditorV3 .nf-flow-node-body {
  padding: 18px !important;
}

body #telegramFlowEditorV3 .nf-flow-image {
  border-radius: 12px !important;
  background: #f4f7fa !important;
  box-shadow: inset 0 0 0 1px rgba(148,163,184,.12);
}

body #telegramFlowEditorV3 .nf-flow-text {
  color: #35435a !important;
}

body #telegramFlowEditorV3 .nf-flow-link {
  border: 1px solid rgba(34,158,217,.15) !important;
  border-radius: 10px !important;
  background: #eaf7fd !important;
  color: #127eaf !important;
}

body #telegramFlowEditorV3 .nf-flow-actions {
  padding: 0 18px 17px !important;
}

body #telegramFlowEditorV3 .nf-flow-action {
  padding: 7px 11px !important;
  border: 1px solid rgba(148,163,184,.20) !important;
  border-radius: 9px !important;
  background: #f8fafc !important;
  color: #58667b !important;
}

body #telegramFlowEditorV3 .nf-flow-action:hover {
  background: white !important;
  box-shadow: 0 4px 10px rgba(15,23,42,.045);
}

body #telegramFlowEditorV3 .nf-flow-editor {
  top: 98px !important;
  padding: 21px !important;
  border: 1px solid var(--premium-line) !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: var(--premium-shadow-md) !important;
}

body #telegramFlowEditorV3 .nf-flow-mode {
  background: #eef6fb !important;
  color: #557087 !important;
}

body #telegramFlowEditorV3 .nf-field input,
body #telegramFlowEditorV3 .nf-field textarea,
body #telegramFlowEditorV3 .nf-field select {
  border: 1px solid rgba(148,163,184,.22) !important;
  border-radius: 11px !important;
  background: #f8fafc !important;
}

body #telegramFlowEditorV3 .nf-field input:focus,
body #telegramFlowEditorV3 .nf-field textarea:focus,
body #telegramFlowEditorV3 .nf-field select:focus {
  border-color: rgba(34,158,217,.38) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(34,158,217,.07) !important;
}

/* BROADCAST PREMIUM */
body #telegramBroadcastBuilder {
  max-width: 1280px !important;
  margin: 0 auto;
}

body #telegramBroadcastBuilder .tb-layout {
  grid-template-columns: minmax(0, 1fr) 400px !important;
  gap: 20px !important;
}

body #telegramBroadcastBuilder .tb-card {
  padding: 22px !important;
  border: 1px solid var(--premium-line) !important;
  border-radius: 18px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: var(--premium-shadow-md) !important;
}

body #telegramBroadcastBuilder .tb-section-title {
  color: #243146 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

body #telegramBroadcastBuilder .tb-mode-grid {
  gap: 11px !important;
}

body #telegramBroadcastBuilder .tb-mode {
  min-height: 92px;
  padding: 14px !important;
  border: 1px solid rgba(148,163,184,.20) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, #ffffff, #fafcfe) !important;
  box-shadow: 0 5px 14px rgba(15,23,42,.035);
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    border-color .16s ease !important;
}

body #telegramBroadcastBuilder .tb-mode:hover {
  transform: translateY(-2px);
  border-color: rgba(34,158,217,.22) !important;
  box-shadow: 0 9px 20px rgba(15,23,42,.055);
}

body #telegramBroadcastBuilder .tb-mode.active {
  border-color: rgba(34,158,217,.40) !important;
  background:
    linear-gradient(145deg, #eef9fe, #f8fcff) !important;
  box-shadow:
    0 0 0 4px rgba(34,158,217,.07),
    0 10px 24px rgba(34,158,217,.07) !important;
}

body #telegramBroadcastBuilder .tb-mode strong {
  color: #2d3b50 !important;
  font-weight: 900 !important;
}

body #telegramBroadcastBuilder .tb-mode small {
  color: #8491a3 !important;
}

body #telegramBroadcastBuilder .tb-field input,
body #telegramBroadcastBuilder .tb-field textarea {
  border: 1px solid rgba(148,163,184,.22) !important;
  border-radius: 11px !important;
  background: #f8fafc !important;
}

body #telegramBroadcastBuilder .tb-field input:focus,
body #telegramBroadcastBuilder .tb-field textarea:focus {
  border-color: rgba(34,158,217,.38) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(34,158,217,.07) !important;
}

body #telegramBroadcastBuilder .tb-preview-card {
  top: 98px !important;
}

body #telegramBroadcastBuilder .tb-preview-shell {
  min-height: 340px !important;
  padding: 20px !important;
  border: 1px solid rgba(34,158,217,.11);
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 80% 15%, rgba(255,255,255,.78), transparent 22%),
    linear-gradient(180deg, #d9eef8, #eaf4f9) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

body #telegramBroadcastBuilder .tb-preview-bubble {
  padding: 13px !important;
  border: 1px solid rgba(148,163,184,.13);
  border-radius: 14px 14px 14px 5px !important;
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 9px 24px rgba(15,23,42,.08) !important;
}

body #telegramBroadcastBuilder .tb-preview-button {
  border: 1px solid rgba(34,158,217,.16) !important;
  border-radius: 9px !important;
  background: #edf8fe !important;
  color: #117fad !important;
}

/* micro-polish */
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(34,158,217,.18) !important;
  outline-offset: 2px;
}

::selection {
  background: rgba(34,158,217,.22);
  color: #112035;
}

.empty,
.loading {
  color: #8490a2 !important;
}

.error-box,
.success-box {
  border-radius: 11px !important;
}

@media (max-width: 1180px) {
  .sidebar {
    width: 238px !important;
  }

  .conversation-list {
    width: 320px !important;
  }

  body #telegramFlowEditorV3 .nf-flow-grid,
  body #telegramBroadcastBuilder .tb-layout {
    grid-template-columns: 1fr !important;
  }

  body #telegramFlowEditorV3 .nf-flow-editor,
  body #telegramBroadcastBuilder .tb-preview-card {
    position: static !important;
  }
}

@media (max-width: 820px) {
  .topbar {
    min-height: 76px;
    height: auto !important;
    padding: 12px 17px !important;
    flex-wrap: wrap;
  }

  .tg-topbar-bot {
    display: none;
  }

  .page {
    padding: 20px !important;
  }
}

@media (max-width: 680px) {
  .sidebar {
    width: 100% !important;
    padding: 16px 13px !important;
  }

  .logo {
    margin-bottom: 14px !important;
  }

  .page.conversations.active {
    height: auto;
  }

  .conversation-list {
    width: 100% !important;
  }

  .chat-messages {
    padding: 18px 15px !important;
  }

  .bubble {
    max-width: 88% !important;
  }

  .tg-metric-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 460px) {
  .tg-metric-grid {
    grid-template-columns: 1fr !important;
  }

  .page {
    padding: 15px !important;
  }

  body #telegramFlowEditorV3 .nf-flow-canvas {
    padding: 26px 12px 34px !important;
  }
}
