.bot-form{display:flex;flex-direction:column;gap:12px;min-width:0;margin:16px 0}.bot-form label{display:flex;flex-direction:column;gap:6px;font-size:14px;line-height:1.5}.bot-form input,.bot-form select,.bot-form textarea{max-width:100%;min-width:0;box-sizing:border-box}.bot-form input:not([type=checkbox]),.bot-form select,.bot-form button{min-height:44px}.bot-form input[type=checkbox]{width:22px;height:22px;flex-shrink:0;accent-color:#ffffff}.bot-checks label,.bot-form label:has(>input[type=checkbox]){flex-direction:row;align-items:center;min-height:44px}.bot-form fieldset{border:1px solid var(--border-medium);border-radius:10px;padding:12px;min-width:0}.bot-grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.bot-actions{display:flex;gap:8px;flex-wrap:wrap}.bot-actions>*{flex:1}.bot-preview{border:1px solid var(--border-medium);border-radius:10px;padding:16px;white-space:pre-wrap;overflow-wrap:anywhere;background:#202020}.bot-help{font-size:14px;line-height:1.5;color:#bbb5ab}.bot-button-row{border:1px solid var(--border-medium);border-radius:10px;padding:10px;display:grid;gap:8px;margin-bottom:8px}.bot-media-type{max-width:110px;min-width:80px}.bot-form button:focus-visible,.bot-form input:focus-visible,.bot-form textarea:focus-visible,.bot-form select:focus-visible{outline:2px solid #ffffff;outline-offset:2px}#modalPrivetkaSettings .modal-card{max-height:85dvh;overflow:auto}#previewSimButtons{display:grid;gap:6px;margin-top:10px}#previewSimButtons>div{padding:10px;border:1px solid #8a7549;border-radius:8px;color:#ffffff;text-align:center}@media(max-width:400px){.bot-media-type{max-width:85px}#botSectionWelcome .cbot-field-group>div:has(.bot-media-type),#botSectionDelivery div:has(>.bot-media-type){flex-wrap:wrap}.bot-grid-3{gap:5px}} 

#stepEditorCard{scroll-margin-top:100px}#seqStepsTimelineContainer button{min-width:44px;min-height:44px}#seqStepsTimelineContainer button svg{width:18px;height:18px}#modalPrivetkaSettings .modal-card{overscroll-behavior:contain}#viewBots{padding-bottom:100px}

/* Keep card labels inside their controls at narrow widths and larger text scales. */
.cbot-saas-card { container-type: inline-size; }
.cbot-saas-stat-item { padding: 6px 4px; min-width: 0; }
.cbot-saas-stat-lbl {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  letter-spacing: 0.2px;
  font-size: clamp(8px, 2.7cqw, 10px);
  text-transform: uppercase;
}
.cbot-saas-actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}
.cbot-saas-actions-primary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.cbot-saas-actions-primary-row .cbot-btn-action-primary,
.cbot-saas-actions-primary-row .cbot-btn-action-secondary {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
}
.cbot-saas-actions-primary-row .cbot-btn-action-primary {
  background: linear-gradient(180deg, #f3dcab 0%, #d9b46c 100%);
  color: #09090b;
  border: 1px solid rgba(255, 240, 200, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 18px -8px rgba(217, 180, 108, 0.45);
}
.cbot-saas-actions-primary-row .cbot-btn-action-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #f4f2ee;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.cbot-saas-actions-tools-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}
.cbot-saas-actions-tools-row .cbot-btn-action-icon,
.cbot-saas-actions-tools-row .cbot-btn-action-danger {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
}
.cbot-saas-actions-tools-row .cbot-btn-action-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #a3a09a;
}
.cbot-saas-actions-tools-row .cbot-btn-action-danger {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #ef4444;
}
.cbot-saas-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.cbot-saas-actions .cbot-btn-action-primary,
.cbot-saas-actions .cbot-btn-action-secondary {
  flex: 1 1 calc(50% - 6px);
  min-width: 0;
  height: 42px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 12px;
}
.cbot-saas-actions .cbot-btn-action-icon,
.cbot-saas-actions .cbot-btn-action-danger {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.subgram-settings{display:flex;flex-direction:column;gap:9px;min-width:0;margin:0 0 16px;padding:14px;border:1px solid rgba(255, 255, 255,.3);border-radius:12px;background:rgba(255, 255, 255,.06)}
.subgram-heading{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px}.subgram-heading strong{color:#f1dfb9;font-size:15px}.subgram-heading span{font-size:12px;color:#d2c4a5}.subgram-settings p{margin:0;color:#bcb7ae;font-size:12px;line-height:1.5}.subgram-settings label{font-size:13px;font-weight:700;color:#eee}.subgram-settings input{box-sizing:border-box;width:100%;min-width:0;min-height:44px}.subgram-actions{display:flex;gap:8px;flex-wrap:wrap}.subgram-actions button{min-height:44px;flex:1 1 130px}.subgram-actions button[hidden]{display:none}

/* ═══════════════════════════════════════════════════════════════════════════════
   BELKA-GRADE PRO BOT EDITOR & SCENARIO TIMELINE (Apple-Glass UI)
   ═══════════════════════════════════════════════════════════════════════════════ */

.belka-bot-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #0a0a0c;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 10px 8px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.85);
  box-sizing: border-box;
}

.belka-btn-back {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.belka-btn-back:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.12); }

.belka-bot-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.belka-bot-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.belka-bot-username {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.2px;
  max-width: none;
}

.belka-badge-status {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  white-space: nowrap;
}

.belka-bot-desc-line {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.belka-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.belka-btn-open-tg {
  padding: 7px 11px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.belka-btn-open-tg:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.22); }

.belka-btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}
.belka-btn-icon:active { transform: scale(0.92); }

/* Diagnostic Alerts */
.belka-alert-card {
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: fadeInDown 0.25s ease;
}

.belka-alert-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(217, 119, 6, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.belka-alert-blue {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(184, 142, 74, 0.06) 100%);
  border: 1px solid var(--border-accent);
}

.belka-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.belka-alert-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}
.belka-alert-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
}

.belka-alert-btn-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0d0d0e;
  font-weight: 800;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  align-self: flex-start;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
}
.belka-alert-btn-amber:active { transform: scale(0.96); }

.belka-alert-btn-blue {
  background: var(--accent-gradient);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 12.5px;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  align-self: flex-start;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: all 0.2s ease;
}
.belka-alert-btn-blue:active { transform: scale(0.96); }

/* Onboarding Checklist */
.belka-checklist-card {
  background: rgba(22, 22, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.belka-checklist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.belka-checklist-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}
.belka-checklist-toggle {
  font-size: 12px;
  color: var(--accent-primary);
  cursor: pointer;
  font-weight: 600;
}
.belka-checklist-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.belka-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}
.belka-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #10b981);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.belka-checklist-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.belka-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 8px;
}
.belka-check-row:last-child { border-bottom: none; }
.belka-check-row:active { background: rgba(255, 255, 255, 0.04); }

.belka-check-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.belka-num-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent-primary);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.belka-check-badge-done {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.belka-check-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.belka-check-done-text {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: line-through;
}

.belka-check-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
  margin-top: 1px;
}

.belka-tag-dohod {
  font-size: 10px;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  padding: 1px 6px;
  border-radius: 5px;
  margin-left: 6px;
  display: inline-block;
}

.belka-chevron {
  color: rgba(255, 255, 255, 0.3);
  font-size: 16px;
  font-weight: 700;
  padding-left: 6px;
}

/* KPIs Row */
.belka-kpis-card {
  background: rgba(20, 20, 24, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.belka-date-picker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.belka-date-picker-row::-webkit-scrollbar { display: none; }

.belka-date-pill {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.belka-date-pill:active { transform: scale(0.96); }
.belka-date-pill.active {
  background: linear-gradient(180deg, #f3dcab 0%, #d9b46c 100%);
  color: #09090b;
  border-color: rgba(255, 240, 200, 0.55);
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 14px -6px rgba(217, 180, 108, 0.55);
}

/* Mobile touch-friendly checkboxes */
#chkWelcomeCaptionAbove,
#chkDelayCaptionAbove {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.belka-kpis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.belka-kpi-val {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 2px;
}
.belka-kpi-lbl {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
}
.belka-kpi-pct {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 1px;
}

.belka-chart-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.belka-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.belka-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
  flex-shrink: 0;
}
.belka-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.belka-chart-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.belka-chart-dot.is-gold { background: #efd092; box-shadow: 0 0 6px rgba(239, 208, 146, 0.5); }
.belka-chart-dot.is-green { background: #4ade80; box-shadow: 0 0 6px rgba(74, 222, 128, 0.45); }
.belka-chart-tooltip {
  font-size: 11px;
  font-weight: 700;
  color: #efd092;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.belka-chart-wrap {
  width: 100%;
  min-height: 98px;
  position: relative;
}
.belka-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.belka-chart-empty {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.07);
  border-radius: 10px;
}
/* Scenario header & Drawflow-style Funnel Map */
.belka-sc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.belka-sc-head-title {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.belka-sc-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 2px;
}
.belka-sc-switch-btn {
  min-height: 28px;
  padding: 4px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}
.belka-sc-switch-btn.active {
  background: linear-gradient(180deg, #f3dcab 0%, #d9b46c 100%);
  color: #09090b;
  box-shadow: 0 2px 8px -2px rgba(217, 180, 108, 0.45);
}
.belka-funnel-map-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: #0c0c0f;
  background-image: radial-gradient(rgba(217, 180, 108, 0.14) 1px, transparent 1px);
  background-size: 18px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.belka-funnel-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 0;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
}
.df-canvas {
  position: relative;
  width: 680px;
  height: 256px;
}
.df-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.df-node {
  position: absolute;
  width: 132px;
  padding: 9px 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(28, 28, 33, 0.96), rgba(16, 16, 20, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.df-node:active { transform: scale(0.97); }
.df-node.is-ready { border-color: rgba(74, 222, 128, 0.36); }
.df-node.is-gold { border-color: rgba(217, 180, 108, 0.42); }
.df-node.is-muted { opacity: 0.72; }
.df-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
}
.df-node-title {
  font-size: 11.5px;
  font-weight: 800;
  color: #fafafa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.df-node-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}
.df-node.is-ready .df-node-tag { background: rgba(74, 222, 128, 0.16); color: #86efac; }
.df-node.is-gold .df-node-tag { background: rgba(217, 180, 108, 0.18); color: #efd092; }
.df-node-sub {
  font-size: 10px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.56);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.df-port {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: #18181b;
  border: 1.5px solid #efd092;
}
.df-port.in { left: -4px; }
.df-port.out { right: -4px; }
.df-node.is-ready .df-port { border-color: #4ade80; }

/* Big Action Button */
.belka-broadcast-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 14px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: none;
  cursor: pointer;
  margin-bottom: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.belka-broadcast-btn:active { transform: scale(0.98); box-shadow: 0 2px 10px var(--accent-glow); }

/* Quick 5 Tiles (1 clean row) */
.belka-tiles-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.belka-tile-btn {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  padding: 9px 2px 8px 2px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.belka-tile-label {
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.belka-tile-btn:active { transform: scale(0.95); }
.belka-tile-btn.active {
  background: linear-gradient(180deg, rgba(217, 180, 108, 0.14), rgba(24, 24, 27, 0.96));
  border: 1.5px solid rgba(217, 180, 108, 0.55);
  box-shadow: 0 6px 18px -6px rgba(217, 180, 108, 0.32);
}

.belka-tile-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.belka-tile-btn.active .belka-tile-icon-box {
  transform: scale(1.08);
}
.belka-tile-icon-box.purple {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}
.belka-tile-icon-box.rose {
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold-200);
}
.belka-tile-icon-box.cyan {
  background: rgba(255, 255, 255, 0.14);
  color: var(--gold-50);
}
.belka-tile-icon-box.amber {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.belka-tile-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.belka-tile-btn.active .belka-tile-label {
  color: var(--gold-200);
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SCENARIO TIMELINE (Belka Screenshot 3)
   ═══════════════════════════════════════════════════════════════════════════════ */

.belka-timeline {
  position: relative;
  padding-left: 42px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 6px;
  margin-bottom: 24px;
}

.belka-timeline::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 20px;
  bottom: 28px;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.25) 50%, rgba(34, 197, 94, 0.5) 100%);
  border-radius: 2px;
}

.belka-step-card {
  position: relative;
  background: rgba(20, 20, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.belka-step-icon {
  position: absolute;
  left: -42px;
  top: 14px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  z-index: 2;
  box-shadow: 0 0 12px var(--accent-glow);
}

.belka-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.belka-step-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  flex: 1;
  min-width: 0;
}
.belka-step-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.belka-badge-subtle {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  white-space: nowrap;
}
.belka-badge-subtle.ready {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}
.belka-badge-subtle.auto {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
}

.belka-step-action-btn {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.belka-step-action-btn:active { transform: scale(0.94); }

.belka-step-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
  margin-bottom: 2px;
}
.belka-step-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
}

/* Telegram Interactive Bubble */
.telegram-bubble-card {
  margin-top: 10px;
  background: linear-gradient(160deg, #18181b 0%, #111113 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.telegram-bubble-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.telegram-bubble-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--gold-200);
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
.telegram-bubble-btn:active { transform: scale(0.98); background: rgba(255, 255, 255, 0.24); }

/* Traffic links table / list */
.belka-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.belka-link-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.belka-link-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.belka-link-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.belka-link-copy-btn {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  color: #f1dfb9;
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
}
.belka-link-copy-btn:active { transform: scale(0.94); }

.belka-link-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}
.belka-link-stats b { color: #fff; }

/* Clean iOS-style Toggle Switch & Multi-Access Controls */
.clean-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}
.clean-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.clean-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.16);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.clean-switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}
.clean-switch input:checked + .slider {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}
.clean-switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* Monetization & BotoHub Styles (Screenshot Pixel-Perfect) */
.monetization-top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.monetization-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}
.monetization-back-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.12);
}
.monetization-top-titles {
  display: flex;
  flex-direction: column;
}
.monetization-main-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}
.monetization-sub-title {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 1px;
}
.monetization-lead-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.botohub-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.botohub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.botohub-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.botohub-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.botohub-badge-icon.purple {
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
}
.botohub-badge-icon.teal {
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
}
.botohub-badge-icon.sky {
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
}
.botohub-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.botohub-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.35;
}
.botohub-desc-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}
.botohub-more-link {
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.botohub-more-link:hover {
  text-decoration: underline;
}
.botohub-subcard {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
}
.botohub-alert {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  font-size: 11.5px;
  color: #fef3c7;
  line-height: 1.45;
}
.botohub-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.botohub-test-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 10px;
  padding: 0 16px;
  height: 42px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.botohub-test-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.botohub-test-btn:active {
  transform: scale(0.96);
}
.botohub-footer-hint {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.45;
  margin-top: 12px;
}
.botohub-status-msg {
  font-size: 11.5px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.4;
}




/* ═════════════════════════════════════════════════════════════════════════
   ✨ AI-ASSISTANT FOR OP-BOTS (GEMINI 2.5 FLASH / ULTRA-GLOW APPLE STYLE)
   ═════════════════════════════════════════════════════════════════════════ */

.belka-btn-ai-magic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(184, 142, 74, 0.24) 100%);
  border: 1px solid var(--border-accent);
  color: var(--gold-50);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.belka-btn-ai-magic:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(184, 142, 74, 0.35) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.belka-btn-ai-magic:active {
  transform: scale(0.96);
}
.ai-sparkle-spin {
  display: inline-block;
  animation: aiSparklePulse 2.4s infinite ease-in-out;
}
@keyframes aiSparklePulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.25) rotate(15deg); opacity: 1; filter: drop-shadow(0 0 6px #facc15); }
}

/* AI Promo Banner in Constructor */
.belka-ai-card {
  position: relative;
  background: linear-gradient(135deg, rgba(28, 25, 20, 0.9) 0%, rgba(24, 24, 27, 0.95) 55%, rgba(42, 33, 18, 0.85) 100%);
  border: 1px solid var(--border-accent);
  border-radius: 18px;
  padding: 14px 16px;
  margin: 12px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.belka-ai-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 32px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.belka-ai-card:active {
  transform: scale(0.985);
}
.belka-ai-bg-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.belka-ai-icon-box {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  background: var(--accent-gradient);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  position: relative;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.belka-ai-info {
  flex: 1;
  min-width: 0;
}
.belka-ai-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.belka-ai-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
}
.belka-ai-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
}
.belka-ai-btn:active {
  transform: scale(0.95);
}

/* ═══ Textarea comfort fix ═══ */
.bot-form textarea,
.cbot-textarea,
textarea.cbot-textarea {
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.5;
  font-size: 16px;
  resize: vertical;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  box-sizing: border-box;
}
.bot-form textarea:focus,
.cbot-textarea:focus {
  border-color: #ffffff;
  outline: none;
}

/* ═══ AI Refine block ═══ */
.ai-refine-block {
  margin-top: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
}
.ai-refine-block .ai-refine-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-refine-block textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 60px;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 13.5px;
  line-height: 1.45;
  resize: vertical;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  box-sizing: border-box;
  font-family: inherit;
}
.ai-refine-block textarea::placeholder { color: var(--text-dim); }
.ai-refine-block textarea:focus {
  border-color: var(--border-focus);
  outline: none;
}
.ai-refine-submit-btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px 16px;
  background: var(--accent-gradient);
  border: none;
  border-radius: 12px;
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ai-refine-submit-btn:active {
  transform: scale(0.97);
  filter: brightness(0.92);
}
.ai-refine-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══ UNIVERSAL DARK THEME DROPDOWN / SELECT FIX (ALL TABS & MODALS) ═══ */
:root {
  color-scheme: dark !important;
}

/* ═════════════════════════════════════════════════════════════════════════
   🧪 A/B WELCOME SWITCHER & 🚀 TRAFFIC BAIT TEXTS (MILESTONE 1)
   ═════════════════════════════════════════════════════════════════════════ */

/* A/B Switcher Container */
.ai-ab-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 4px;
  color-scheme: dark;
}

.ai-ab-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-200);
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-ab-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-ab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  color-scheme: dark;
}

.ai-ab-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--border-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.ai-ab-btn.active {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  color: var(--on-accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Traffic Bait Texts Card */
.ai-traffic-texts-card {
  background: #18181b;
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-card);
  color-scheme: dark;
}

.ai-traffic-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.ai-traffic-item {
  margin-bottom: 12px;
}

.ai-traffic-item:last-child {
  margin-bottom: 0;
}

.ai-traffic-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ai-traffic-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
  color-scheme: dark;
}

.ai-copy-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--border-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.ai-copy-btn.copied {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #4ade80;
}

.ai-traffic-bubble {
  font-size: 12.5px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  margin-bottom: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 🎲 Single Block Regeneration Button & Spinner (Milestone 2, Feature 1) */
.ai-card-regen-btn {
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  color: var(--accent-primary);
  font-size: 12px;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}
.ai-card-regen-btn:hover {
  background: var(--accent-primary);
  color: var(--on-accent);
  transform: scale(1.08);
}
.ai-card-regen-btn.spinning {
  animation: spin 0.75s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 📱 Telegram Simulator Styles (Milestone 2, Feature 4) */
.ai-simulator-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  isolation: isolate;
  overflow: clip;
}
.tg-sim-toolbar {
  width: 100%;
  max-width: 360px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}
.tg-sim-btn-back, .tg-sim-btn-reset {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tg-sim-btn-back:hover, .tg-sim-btn-reset:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.tg-sim-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.tg-phone-frame {
  width: 100%;
  max-width: 360px;
  min-height: 480px;
  background: var(--bg-base);
  border: 2px solid #27272a;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tg-phone-header {
  background: #18181b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  display: flex;
  align-items: center;
}
.tg-phone-bot-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tg-phone-bot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.tg-phone-bot-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}
.tg-phone-bot-status {
  font-size: 11px;
  color: #71717a;
}
.tg-chat-screen {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 520px;
}
.tg-sim-bubble {
  max-width: 86%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tg-sim-bubble.bot {
  align-self: flex-start;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}
.tg-sim-bubble.user {
  align-self: flex-end;
  background: var(--accent-primary);
  color: var(--on-accent);
  border-bottom-right-radius: 4px;
}
.tg-sim-btn {
  width: 100%;
  padding: 10px 14px;
  background: var(--accent-gradient);
  color: var(--on-accent);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.15s ease;
  text-align: center;
}
.tg-sim-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.tg-sim-btn.secondary {
  background: #10b981;
}

/* 💾 Template Save Button */
.ai-btn-save-template {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ai-btn-save-template:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Premium AI single-message preview stays scoped to the AI result sheet. */
.ai-preview-card.ai-premium-message-card {
  background: var(--glass-card);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
}
.ai-preview-card.ai-premium-message-card[style*="display: none"] { display: none !important; }
.ai-presentation-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--gold-200);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.ai-presentation-badge[data-mode="classic"] {
  border-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}
.ai-premium-cover-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0 0 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(10, 10, 11, 0.55);
}
.ai-premium-cover-frame[data-media-state="telegram-file-id"]::after {
  content: "Обложка сохранена в Telegram";
  display: block;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.ai-premium-cover-frame[data-media-state="telegram-file-id"] .ai-premium-cover {
  display: none;
}
.ai-premium-cover {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: center;
  border-radius: 11px;
}
.ai-premium-copy {
  margin: 0 0 10px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ai-sponsor-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
}
.ai-sponsor-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 7px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 11.5px;
  line-height: 1.25;
}
.ai-sponsor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}
.ai-sponsor-status {
  color: var(--text-muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.ai-premium-message-card #aiPreviewPremiumCta {
  margin-top: 2px;
  background: var(--accent-gradient);
  color: var(--on-accent);
  box-shadow: 0 3px 10px var(--accent-glow);
}
@media (max-width: 420px) {
  .ai-premium-cover { max-height: 180px; }
  .ai-sponsor-row { grid-template-columns: auto minmax(0, 1fr); }
  .ai-sponsor-status { grid-column: 2; }
}
