/* ============================================
   WIDGET DASHBOARD — wd- prefix
   ============================================ */
.wd-toast-container {
  position: fixed; top: 24px; right: 24px; z-index: 99999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.wd-toast {
  background: #1f2937; color: #fff; padding: 12px 20px; border-radius: 10px;
  font-family: var(--wl-font,'Inter'),sans-serif; font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); opacity: 0; transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s; pointer-events: auto; max-width: 340px;
}
.wd-toast.wd-show { opacity: 1; transform: translateY(0); }
.wd-toast.wd-t-success { background: #059669; }
.wd-toast.wd-t-error { background: #dc2626; }
.wd-toast.wd-t-info { background: #6366f1; }

#wd-login, #wd-register {
  min-height: 100vh; display: none; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: var(--wl-font,'Inter'),sans-serif; padding: 20px;
  position: fixed; inset: 0; z-index: 5000; overflow-y: auto;
}
#wd-login.wd-active, #wd-register.wd-active { display: flex; }

#wd-dashboard, #wd-constructor, #wd-leads, #wd-analytics,
#wd-chat-constructor, #wd-chat-leads,
#wd-chat-analytics, #wd-chat-operator, #wd-chat-history,
#wd-pricing {
  display: none; min-height: 100vh; background: #f8fafc;
  font-family: var(--wl-font,'Inter'),sans-serif; flex-direction: column;
  position: fixed; inset: 0; z-index: 5000; overflow-y: auto;
}
#wd-dashboard.wd-active,
#wd-constructor.wd-active,
#wd-leads.wd-active,
#wd-analytics.wd-active,
#wd-chat-constructor.wd-active,
#wd-chat-leads.wd-active,
#wd-chat-analytics.wd-active,
#wd-chat-operator.wd-active,
#wd-chat-history.wd-active { display: flex; }

.wd-auth-card {
  background: rgba(255,255,255,0.97); backdrop-filter: blur(20px);
  border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22); border: 1px solid rgba(255,255,255,0.7);
  position: relative; z-index: 1;
}
.wd-auth-logo { text-align: center; margin-bottom: 20px; }
.wd-auth-logo-mark {
  width: 52px; height: 52px; background: linear-gradient(135deg,#6366f1,#8b5cf6);
  border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.wd-auth-title { font-size: 22px; font-weight: 700; color: #111827; text-align: center; margin-bottom: 5px; }
.wd-auth-subtitle { font-size: 14px; color: #6b7280; text-align: center; margin-bottom: 24px; }
.wd-form-group { margin-bottom: 13px; }
.wd-form-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.wd-form-label span { color: #9ca3af; font-weight: 400; }
.wd-form-input, .wd-form-select, .wd-form-textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid #e5e7eb; border-radius: 10px;
  font-size: 14px; font-family: var(--wl-font,'Inter'),sans-serif; color: #111827;
  background: #fff; outline: none; transition: border-color 0.2s,box-shadow 0.2s; box-sizing: border-box;
}
.wd-form-input:focus, .wd-form-select:focus, .wd-form-textarea:focus {
  border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.wd-form-textarea { resize: vertical; min-height: 78px; }

.wd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  font-family: var(--wl-font,'Inter'),sans-serif; cursor: pointer; border: none; outline: none;
  transition: background 0.2s,transform 0.1s,box-shadow 0.2s; text-decoration: none;
  white-space: nowrap; box-sizing: border-box; line-height: 1;
}
.wd-btn:active { transform: scale(0.98); }
.wd-btn--primary { background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,0.35); width: 100%; }
.wd-btn--primary:hover { box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
.wd-btn--secondary { background: #f3f4f6; color: #374151; }
.wd-btn--secondary:hover { background: #e5e7eb; }
.wd-btn--outline { background: transparent; color: #6366f1; border: 1.5px solid #6366f1; }
.wd-btn--outline:hover { background: rgba(99,102,241,0.06); }
.wd-btn--danger { background: #fee2e2; color: #dc2626; }
.wd-btn--danger:hover { background: #fecaca; }
.wd-btn--sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.wd-btn--icon { padding: 7px; width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.wd-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.wd-auth-link-row { margin-top: 17px; text-align: center; font-size: 13px; color: #6b7280; }
.wd-auth-link { color: #6366f1; font-weight: 600; cursor: pointer; text-decoration: none; border: none; background: none; font-size: 13px; font-family: inherit; padding: 0; }
.wd-auth-link:hover { text-decoration: underline; }
.wd-auth-back { display: block; margin-top: 13px; text-align: center; font-size: 13px; color: #9ca3af; cursor: pointer; background: none; border: none; font-family: inherit; width: 100%; }
.wd-auth-back:hover { color: #6366f1; }

/* Topbar */
.wd-topbar {
  background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; gap: 14px; flex-shrink: 0;
}
.wd-topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.wd-topbar-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.wd-topbar-brand-mark {
  width: 34px; height: 34px; background: linear-gradient(135deg,#6366f1,#8b5cf6);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; font-weight: 800; flex-shrink: 0;
}
.wd-topbar-title { font-size: 18px; font-weight: 700; color: #111827; white-space: nowrap; letter-spacing: -0.01em; }
.wd-topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.wd-user-dropdown { position: relative; }
.wd-user-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: #f3f4f6; border-radius: 10px; cursor: pointer; border: none;
  font-family: inherit; font-size: 13px; font-weight: 600; color: #374151;
  transition: background 0.2s; max-width: 200px;
}
.wd-user-btn:hover { background: #e5e7eb; }
.wd-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#6366f1,#8b5cf6); display: flex;
  align-items: center; justify-content: center; color: #fff;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.wd-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.13);
  padding: 6px; min-width: 210px; z-index: 200; display: none;
}
.wd-user-menu.wd-open { display: block; }
.wd-user-menu-email { padding: 8px 11px 9px; font-size: 12px; color: #9ca3af; font-weight: 500; border-bottom: 1px solid #f3f4f6; margin-bottom: 4px; word-break: break-all; }
.wd-user-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 11px; background: none; border: none; border-radius: 8px; font-size: 13px; font-family: inherit; color: #374151; cursor: pointer; text-align: left; transition: background 0.15s; }
.wd-user-menu-item:hover { background: #f3f4f6; }
.wd-user-menu-item.wd-danger { color: #dc2626; }
.wd-user-menu-item.wd-danger:hover { background: #fee2e2; }

.wd-main { flex: 1; padding: 26px 24px; max-width: 1200px; width: 100%; margin: 0 auto; box-sizing: border-box; }

/* Stats */
.wd-stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 26px; }
.wd-stat-card { background: #fff; border-radius: 14px; padding: 18px; border: 1px solid #e5e7eb; display: flex; align-items: center; gap: 13px; transition: box-shadow 0.2s; }
.wd-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }
.wd-stat-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wd-stat-icon svg { width: 22px; height: 22px; stroke-width: 1.8; fill: none; stroke: currentColor; }
.wd-stat-icon--purple { background: #ede9fe; color: #7c3aed; }
.wd-stat-icon--blue { background: #dbeafe; color: #2563eb; }
.wd-stat-icon--green { background: #d1fae5; color: #059669; }
.wd-stat-icon--orange { background: #ffedd5; color: #ea580c; }
.wd-stat-value { font-size: 24px; font-weight: 800; color: #111827; line-height: 1; margin-bottom: 3px; }
.wd-stat-label { font-size: 11px; color: #6b7280; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.wd-stat-period { font-size: 10px; color: #9ca3af; font-weight: 400; margin-top: 1px; }
.wd-stat-value--muted { color: #d1d5db; font-weight: 600; }

.wd-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.wd-section-title { font-size: 16px; font-weight: 600; color: #111827; }

.wd-widget-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(340px,1fr)); gap: 18px; }
.wd-widget-card { background: #fff; border-radius: 16px; border: 1px solid #e5e7eb; padding: 0; transition: box-shadow 0.25s,border-color 0.25s,transform 0.25s; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.wd-widget-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.10); border-color: #d1d5db; transform: translateY(-2px); }
.wd-widget-card-accent { height: 4px; width: 100%; flex-shrink: 0; }
.wd-widget-card-accent--quiz { background: linear-gradient(90deg, #c4b5fd, #ddd6fe); }
.wd-widget-card-accent--chat { background: linear-gradient(90deg, #93c5fd, #bfdbfe); }
.wd-widget-card-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.wd-widget-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.wd-widget-card-info { flex: 1; min-width: 0; }
.wd-widget-card-name { font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-widget-card-title { font-size: 12px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-widget-card-accent { border-radius: 16px 16px 0 0; }

.wd-card-menu-wrap { position: relative; flex-shrink: 0; }
.wd-card-menu-btn { width: 30px; height: 30px; border: none; background: none; cursor: pointer; font-size: 18px; color: #9ca3af; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; padding: 0; line-height: 1; }
.wd-card-menu-btn:hover { background: #f3f4f6; color: #374151; }
.wd-card-menu { position: absolute; top: calc(100% + 4px); right: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 50; min-width: 160px; padding: 4px; }
.wd-card-menu-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; font-weight: 500; color: #374151; cursor: pointer; border-radius: 7px; transition: background 0.15s; white-space: nowrap; }
.wd-card-menu-item:hover { background: #f3f4f6; }
.wd-card-menu-item--danger { color: #dc2626; }
.wd-card-menu-item--danger:hover { background: #fef2f2; }
.wd-card-menu-item svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }

.wd-delete-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.wd-delete-modal { background: #fff; border-radius: 16px; padding: 28px; max-width: 400px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.wd-delete-modal-icon { font-size: 36px; margin-bottom: 12px; }
.wd-delete-modal-title { font-size: 17px; font-weight: 700; color: #111827; margin-bottom: 8px; }
.wd-delete-modal-text { font-size: 13px; color: #6b7280; margin-bottom: 24px; line-height: 1.5; }
.wd-delete-modal-actions { display: flex; gap: 10px; }
.wd-delete-modal-actions .wd-btn { flex: 1; justify-content: center; padding: 10px 16px; font-size: 13px; }
.wd-btn--danger { background: #dc2626; color: #fff; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; font-family: inherit; transition: background 0.15s; }
.wd-btn--danger:hover { background: #b91c1c; }

.wd-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 100px; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.wd-badge--active { background: #d1fae5; color: #059669; }
.wd-badge--paused { background: #f3f4f6; color: #6b7280; }
.wd-badge--new { background: #ede9fe; color: #7c3aed; }
.wd-badge--processing { background: #dbeafe; color: #1d4ed8; }
.wd-badge--completed { background: #d1fae5; color: #059669; }
.wd-badge--spam { background: #fee2e2; color: #dc2626; }

.wd-widget-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.wd-metric { text-align: center; padding: 12px 6px 10px; background: #f8fafc; border-radius: 10px; border: 1px solid #f1f5f9; transition: background 0.2s; }
.wd-widget-card:hover .wd-metric { background: #f1f5f9; }
.wd-metric-value { font-size: 20px; font-weight: 800; color: #111827; line-height: 1; margin-bottom: 4px; letter-spacing: -0.02em; }
.wd-metric-value--empty { color: #d1d5db; font-weight: 600; }
.wd-metric-label { font-size: 11px; color: #9ca3af; font-weight: 500; }
.wd-widget-actions { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: auto; }
.wd-widget-actions .wd-btn { font-size: 12px; padding: 9px 10px; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.wd-widget-actions .wd-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.wd-widget-actions--wide .wd-btn:last-child { grid-column: 1 / -1; }

.wd-feature-locked { position: relative; opacity: 0.45; cursor: not-allowed !important; }
.wd-feature-locked * { pointer-events: none !important; }
.wd-feature-lock-badge { position: absolute; top: 4px; right: 4px; background: #f59e0b; color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; pointer-events: none; z-index: 2; letter-spacing: 0.02em; }
.wd-feature-locked-overlay { position: relative; }
.wd-feature-locked-overlay::after { content: '🔒 ' attr(data-lock-hint); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.85); border-radius: 10px; font-size: 12px; color: #6b7280; font-weight: 600; cursor: pointer; z-index: 3; }
.wd-empty { text-align: center; padding: 56px 20px; color: #9ca3af; }
.wd-empty-icon { font-size: 44px; margin-bottom: 14px; }
.wd-empty-title { font-size: 17px; font-weight: 700; color: #374151; margin-bottom: 7px; }
.wd-empty-text { font-size: 13px; margin-bottom: 22px; }

/* Constructor */
.wd-constructor-topbar {
  background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 20px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; gap: 10px; flex-shrink: 0; overflow: hidden;
}
.wd-constructor-back {
  background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 600;
  color: #6b7280; font-family: inherit; display: flex; align-items: center; gap: 5px;
  padding: 0; transition: color 0.2s; white-space: nowrap; flex-shrink: 0;
}
.wd-constructor-back:hover { color: #6366f1; }

.wd-steps { display: flex; align-items: center; gap: 2px; }
.wd-step { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 100px; font-size: 12px; font-weight: 600; color: #9ca3af; white-space: nowrap; cursor: default; transition: background 0.2s,color 0.2s; }
.wd-step--active { background: #ede9fe; color: #6366f1; }
.wd-step--done { color: #059669; }
.wd-step-num { width: 20px; height: 20px; border-radius: 50%; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; transition: background 0.2s,color 0.2s; }
.wd-step--active .wd-step-num { background: #6366f1; color: #fff; }
.wd-step--done .wd-step-num { background: #059669; color: #fff; }

.wd-constructor-body { flex: 1; padding: 26px 24px; max-width: 800px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.wd-step-panel { display: none; }
.wd-step-panel.wd-active { display: block; }
.wd-step-panel-title { font-size: 19px; font-weight: 700; color: #111827; margin-bottom: 5px; }
.wd-step-panel-subtitle { font-size: 13px; color: #6b7280; margin-bottom: 22px; }

.wd-question-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 13px; }
.wd-question-item { background: #fff; border: 1.5px solid #e5e7eb; border-radius: 13px; overflow: hidden; transition: border-color 0.2s; }
.wd-question-item:focus-within { border-color: #6366f1; }
.wd-question-header { display: flex; align-items: center; gap: 8px; padding: 11px 13px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; }
.wd-question-num { width: 24px; height: 24px; border-radius: 50%; background: #6366f1; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.wd-question-header .wd-form-input { flex: 1; min-width: 120px; background: #fff; }
.wd-question-header .wd-form-select { width: 145px; background: #fff; flex-shrink: 0; }
.wd-question-body { padding: 12px 13px; }
.wd-options-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 8px; }
.wd-option-row { display: flex; align-items: center; gap: 7px; }
.wd-option-row .wd-form-input { flex: 1; }
.wd-option-drag { cursor: grab; color: #d1d5db; padding: 0 3px; font-size: 15px; flex-shrink: 0; }

.wd-lead-field-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 11px; margin-bottom: 9px; gap: 10px; flex-wrap: wrap; }
.wd-lead-field-info { display: flex; align-items: center; gap: 9px; }
.wd-lead-field-icon { font-size: 16px; }
.wd-lead-field-name { font-size: 13px; font-weight: 600; color: #111827; }
.wd-lead-field-desc { font-size: 11px; color: #9ca3af; }
.wd-lead-field-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wd-toggle-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: #6b7280; font-weight: 500; user-select: none; }
.wd-toggle { position: relative; width: 38px; height: 21px; display: inline-block; flex-shrink: 0; }
.wd-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.wd-toggle-slider { position: absolute; inset: 0; background: #d1d5db; border-radius: 11px; transition: background 0.2s; cursor: pointer; }
.wd-toggle-slider::before { content: ''; position: absolute; width: 15px; height: 15px; background: #fff; border-radius: 50%; left: 3px; top: 3px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.wd-toggle input:checked + .wd-toggle-slider { background: #6366f1; }
.wd-toggle input:checked + .wd-toggle-slider::before { transform: translateX(17px); }

.wd-style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.wd-color-row { display: flex; align-items: center; gap: 9px; }
.wd-color-input { width: 40px; height: 40px; border-radius: 9px; border: 1.5px solid #e5e7eb; cursor: pointer; padding: 3px; background: #fff; flex-shrink: 0; }
.wd-range-input { width: 100%; accent-color: #6366f1; cursor: pointer; }
.wd-style-preview { background: #fff; border: 1.5px solid #e5e7eb; border-radius: 16px; overflow: hidden; height: 360px; display: flex; flex-direction: column; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.wd-preview-header { padding: 16px 15px 10px; text-align: center; flex-shrink: 0; }
.wd-preview-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.wd-preview-desc { font-size: 11px; opacity: 0.8; }
.wd-preview-body { flex: 1; padding: 10px 13px; display: flex; flex-direction: column; gap: 7px; }
.wd-preview-option { padding: 8px 10px; border: 1.5px solid rgba(0,0,0,0.1); border-radius: 7px; font-size: 11px; font-weight: 500; text-align: center; }
.wd-preview-footer { padding: 10px 13px; flex-shrink: 0; }
.wd-preview-btn { width: 100%; padding: 9px; border-radius: 8px; border: none; font-size: 12px; font-weight: 700; color: #fff; cursor: default; }
.wd-preview-branding { text-align: center; font-size: 10px; opacity: 0.4; margin-top: 5px; }

.wd-embed-box { background: #1e293b; border-radius: 11px; padding: 18px; position: relative; margin-bottom: 13px; }
.wd-embed-code { font-family: 'Courier New',Courier,monospace; font-size: 12px; color: #a5f3fc; white-space: pre-wrap; word-break: break-all; background: none; border: none; width: 100%; resize: none; outline: none; min-height: 90px; line-height: 1.5; }
.wd-embed-copy { position: absolute; top: 11px; right: 11px; }

.wd-constructor-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; padding-top: 20px; border-top: 1px solid #e5e7eb; gap: 12px; }
.wd-constructor-nav-right { display: flex; gap: 9px; }

.wd-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 15px; padding: 20px; margin-bottom: 16px; }
.wd-card-title { font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 14px; }

/* Leads */
.wd-leads-topbar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; flex-shrink: 0; gap: 12px; }
.wd-leads-title { font-size: 15px; font-weight: 700; color: #111827; }
.wd-leads-widget-name { font-size: 12px; color: #9ca3af; }
.wd-leads-main { flex: 1; padding: 20px 24px; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.wd-filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.wd-filter-bar .wd-form-select { width: auto; min-width: 145px; }
.wd-search-wrap { position: relative; flex: 1; min-width: 170px; }
.wd-search-wrap .wd-form-input { padding-left: 33px; }
.wd-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 14px; pointer-events: none; }
.wd-table-wrap { background: #fff; border-radius: 15px; border: 1px solid #e5e7eb; overflow: hidden; }
.wd-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wd-table th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; background: #f8fafc; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.wd-table td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; color: #374151; vertical-align: middle; }
.wd-table tr:last-child td { border-bottom: none; }
.wd-table tr:hover td { background: #f8fafc; }
.wd-table-actions { display: flex; gap: 5px; align-items: center; }
.wd-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 15px; border-top: 1px solid #f3f4f6; }
.wd-pagination-info { font-size: 13px; color: #6b7280; }

.wd-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.52); backdrop-filter: blur(4px); z-index: 6000; display: none; align-items: center; justify-content: center; padding: 20px; }
.wd-modal-overlay.wd-open { display: flex; }
.wd-modal { background: #fff; border-radius: 18px; padding: 24px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; position: relative; }
.wd-modal-close { position: absolute; top: 14px; right: 14px; background: #f3f4f6; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; color: #6b7280; transition: background 0.2s; }
.wd-modal-close:hover { background: #e5e7eb; }
.wd-modal-title { font-size: 17px; font-weight: 700; color: #111827; margin-bottom: 17px; }
.wd-modal-section { margin-bottom: 17px; }
.wd-modal-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #9ca3af; margin-bottom: 9px; }
.wd-modal-field { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.wd-modal-field-label { font-size: 11px; color: #9ca3af; font-weight: 500; }
.wd-modal-field-value { font-size: 14px; color: #111827; font-weight: 500; word-break: break-all; }
.wd-modal-answers { display: flex; flex-direction: column; gap: 7px; }
.wd-modal-answer-item { background: #f8fafc; border-radius: 9px; padding: 9px 11px; }
.wd-modal-answer-q { font-size: 11px; color: #9ca3af; font-weight: 600; margin-bottom: 2px; }
.wd-modal-answer-a { font-size: 13px; color: #111827; font-weight: 500; }
.wd-modal-status-btns { display: flex; gap: 7px; flex-wrap: wrap; }

/* Analytics */
.wd-analytics-topbar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 100; flex-shrink: 0; }
.wd-analytics-title { font-size: 15px; font-weight: 700; color: #111827; }
.wd-analytics-main { flex: 1; padding: 20px 24px; max-width: 880px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.wd-analytics-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 22px; }
.wd-analytics-stat { background: #fff; border-radius: 13px; border: 1px solid #e5e7eb; padding: 18px; text-align: center; }
.wd-analytics-stat-value { font-size: 30px; font-weight: 800; color: #111827; margin-bottom: 4px; }
.wd-analytics-stat-label { font-size: 13px; color: #6b7280; font-weight: 500; }
.wd-funnel-card { background: #fff; border-radius: 15px; border: 1px solid #e5e7eb; padding: 22px; }
.wd-funnel-title { font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 18px; }
.wd-funnel-steps { display: flex; flex-direction: column; gap: 14px; }
.wd-funnel-step { display: flex; flex-direction: column; gap: 5px; }
.wd-funnel-step-header { display: flex; align-items: center; justify-content: space-between; }
.wd-funnel-step-label { font-size: 13px; font-weight: 600; color: #374151; display: flex; align-items: center; gap: 7px; }
.wd-funnel-step-num { font-size: 17px; font-weight: 800; color: #111827; }
.wd-funnel-step-pct { font-size: 12px; color: #6b7280; font-weight: 500; }
.wd-funnel-bar-bg { height: 10px; background: #f3f4f6; border-radius: 5px; overflow: hidden; }
.wd-funnel-bar-fill { height: 100%; border-radius: 5px; transition: width 0.7s cubic-bezier(0.4,0,0.2,1); background: linear-gradient(90deg,#6366f1,#8b5cf6); }
.wd-funnel-drop { display: flex; align-items: center; gap: 5px; padding: 3px 0 0 2px; }
.wd-funnel-drop-arrow { color: #f59e0b; font-size: 12px; }
.wd-funnel-drop-text { font-size: 11px; color: #9ca3af; }

.wd-loading { display: flex; align-items: center; justify-content: center; padding: 50px; color: #9ca3af; font-size: 13px; gap: 10px; }
.wd-spinner { width: 22px; height: 22px; border: 2.5px solid #e5e7eb; border-top-color: #6366f1; border-radius: 50%; animation: wdSpin 0.8s linear infinite; flex-shrink: 0; }
@keyframes wdSpin { to { transform: rotate(360deg); } }
@keyframes chatDot { 0%,100%{opacity:.3} 50%{opacity:1} }

/* ========== OPERATOR DASHBOARD STYLES ========== */
.op-status-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; padding:0 4px; }
.op-status-toggle { display:inline-flex; background:#f3f4f6; border-radius:10px; padding:3px; gap:2px; }
.op-status-btn { display:inline-flex; align-items:center; gap:5px; padding:6px 14px; border:none; border-radius:8px; background:transparent; font-size:13px; font-weight:500; color:#6b7280; cursor:pointer; transition:all 0.2s; white-space:nowrap; }
.op-status-btn:hover { background:#e5e7eb; }
.op-status-btn.active { background:#fff; color:#111827; box-shadow:0 1px 3px rgba(0,0,0,0.1); }
.op-dot { width:8px; height:8px; border-radius:50%; display:inline-block; flex-shrink:0; }
.op-dot--green { background:#10b981; }
.op-dot--amber { background:#f59e0b; }
.op-dot--gray { background:#9ca3af; }
.op-status-btn.active .op-dot--green { box-shadow:0 0 0 3px rgba(16,185,129,0.2); }
.op-status-btn.active .op-dot--amber { box-shadow:0 0 0 3px rgba(245,158,11,0.2); }
.op-status-btn.active .op-dot--gray { box-shadow:0 0 0 3px rgba(156,163,175,0.2); }

.op-ws-indicator { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:#9ca3af; }
.op-ws-dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.op-ws--connected .op-ws-dot { background:#10b981; }
.op-ws--connected { color:#10b981; }
.op-ws--disconnected .op-ws-dot { background:#ef4444; animation:opPulse 1.5s infinite; }
.op-ws--disconnected { color:#ef4444; }
.op-ws--connecting .op-ws-dot { background:#f59e0b; }
.op-ws--connecting { color:#f59e0b; }
@keyframes opPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.op-no-chat { flex:1; display:flex; align-items:center; justify-content:center; text-align:center; padding:40px; background:#fafafa; border-radius:12px; }

.op-action-btn { display:inline-flex; align-items:center; padding:6px 12px; border-radius:8px; border:1px solid #e5e7eb; background:#fff; font-size:12px; font-weight:500; cursor:pointer; transition:all 0.15s; white-space:nowrap; }
.op-action-btn:hover { background:#f9fafb; }
.op-action-btn--secondary { color:#374151; border-color:#d1d5db; }
.op-action-btn--secondary:hover { background:#f3f4f6; border-color:#9ca3af; }
.op-action-btn--outline { color:#2563eb; border-color:#bfdbfe; background:#eff6ff; }
.op-action-btn--outline:hover { background:#dbeafe; border-color:#93c5fd; }
.op-action-btn--danger { color:#dc2626; border-color:#fecaca; background:#fef2f2; }
.op-action-btn--danger:hover { background:#fee2e2; border-color:#f87171; }

.op-empty-state { padding:40px 24px; text-align:center; }
.op-empty-icon { font-size:36px; margin-bottom:12px; opacity:0.6; }
.op-empty-title { font-size:14px; font-weight:600; color:#6b7280; margin-bottom:8px; }
.op-empty-text { font-size:13px; color:#9ca3af; margin-bottom:16px; }
.op-empty-tips { text-align:left; display:inline-block; }
.op-empty-tip { font-size:12px; color:#6b7280; padding:4px 0; display:flex; align-items:center; gap:6px; }

.op-session-card { padding:12px; border:1px solid #e5e7eb; border-radius:10px; margin-bottom:8px; cursor:pointer; transition:all 0.15s; background:#fff; }
.op-session-card:hover { background:#f8fafc; border-color:#d1d5db; }
.op-session-card.active { background:#eff6ff; border-color:#2563eb; box-shadow:0 0 0 1px #2563eb; }
.op-unread-badge { background:#ef4444; color:#fff; border-radius:10px; min-width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; padding:0 6px; }
.op-wait-badge { font-size:10px; padding:2px 6px; border-radius:6px; font-weight:600; }
.op-wait-badge--green { background:#d1fae5; color:#065f46; }
.op-wait-badge--amber { background:#fef3c7; color:#92400e; }
.op-wait-badge--red { background:#fee2e2; color:#991b1b; }

.op-date-sep { display:flex; align-items:center; gap:12px; margin:16px 0 8px; font-size:11px; color:#9ca3af; }
.op-date-sep::before, .op-date-sep::after { content:''; flex:1; height:1px; background:#e5e7eb; }

.op-close-confirm { position:fixed; inset:0; background:rgba(0,0,0,0.4); display:flex; align-items:center; justify-content:center; z-index:999; }
.op-close-confirm-box { background:#fff; border-radius:12px; padding:24px; max-width:360px; width:90%; box-shadow:0 8px 32px rgba(0,0,0,0.15); text-align:center; }

@media (max-width: 768px) {
  .wd-stats-row { grid-template-columns: repeat(2,1fr); }
  .wd-analytics-stats { grid-template-columns: repeat(2,1fr); }
  .wd-style-grid { grid-template-columns: 1fr; }
  .wd-widget-grid { grid-template-columns: 1fr; }
  .wd-auth-card { padding: 26px 18px; }
  .wd-topbar, .wd-leads-topbar { padding: 0 14px; }
  .wd-main, .wd-constructor-body, .wd-leads-main, .wd-analytics-main { padding: 16px 14px; }
  .wd-table th:nth-child(4), .wd-table td:nth-child(4) { display: none; }

  /* Operator panel: stack vertically */
  #wd-chat-operator > div[style*="display:flex"] {
      flex-direction: column !important;
  }

  #operatorSessionList {
      width: 100% !important;
      border-right: none !important;
      border-bottom: 1px solid #e5e7eb;
      max-height: 35vh;
      padding-right: 0 !important;
  }

  #operatorChatPanel {
      min-height: 50vh;
  }

  /* Hide visitor profile on mobile */
  #visitorProfile {
      display: none !important;
  }

  /* Tables scroll horizontally */
  #chatLeadsList table,
  #wd-chat-history table {
      display: block;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
  }

  /* Filter bars wrap */
  #wd-chat-leads > div:first-child {
      flex-direction: column;
  }
}
@media (max-width: 640px) {
  .wd-step-label { display: none; }
  .wd-constructor-topbar { padding: 0 12px; }
}
@media (max-width: 480px) {
  .wd-stats-row { grid-template-columns: 1fr 1fr; }
  .wd-analytics-stats { grid-template-columns: 1fr; }
  .wd-modal { padding: 18px 14px; }
  .wd-modal-status-btns .wd-btn { flex: 1; }
  .wd-widget-actions .wd-btn { font-size: 10px; padding: 6px 5px; }
  #dashPricingCalc div[style*="grid-template-columns:repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Chat widget styles */
.wd-back-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.wd-back-btn:hover {
    background: #f9fafb;
}

.chat-step {
    display: none;
    padding: 20px 0;
}

.chat-step.active {
    display: block;
}
.chat-tpl-chip {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: #fff;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.chat-tpl-chip:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #f5f3ff;
}

.wd-field {
    margin-bottom: 16px;
}

.wd-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.wd-field input,
.wd-field textarea,
.wd-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.wd-field input:focus,
.wd-field textarea:focus,
.wd-field select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Accordion */
.wiz-accordion-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}
.wiz-accordion-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.wiz-accordion-header {
    padding: 16px 20px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.25s;
}
.wiz-accordion-info h4 { font-size: 15px; font-weight: 600; color: #111827; margin: 0; }
.wiz-accordion-desc { font-size: 12px; color: #9ca3af; margin-top: 2px; display: block; }
.wiz-accordion-arrow { font-size: 14px; color: #9ca3af; transition: transform 0.25s; }
.wiz-accordion-item.open .wiz-accordion-header {
    background: linear-gradient(135deg, #4F46E5, #818cf8);
}
.wiz-accordion-item.open .wiz-accordion-info h4 { color: #fff; }
.wiz-accordion-item.open .wiz-accordion-desc { color: rgba(255,255,255,0.7); }
.wiz-accordion-item.open .wiz-accordion-arrow { color: #fff; transform: rotate(90deg); }
.wiz-accordion-body {
    background: #fff;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 20px;
}
.wiz-accordion-item.open .wiz-accordion-body {
    max-height: 2400px;
    padding: 20px;
}

/* Toggle switch */
.wiz-toggle {
    width: 40px; height: 22px;
    background: #d1d5db; border-radius: 11px;
    position: relative; cursor: pointer;
    transition: background 0.2s; flex-shrink: 0;
}
.wiz-toggle.on { background: #4F46E5; }
.wiz-toggle::after {
    content: ''; position: absolute;
    width: 18px; height: 18px;
    background: #fff; border-radius: 50%;
    top: 2px; left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.wiz-toggle.on::after { transform: translateX(18px); }

/* Dependent fields */
.wiz-dependent {
    overflow: hidden; max-height: 0; opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}
.wiz-dependent.visible { max-height: 600px; opacity: 1; margin-top: 16px; }

/* Channel cards */
.ch-card {
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 0;
    margin-bottom: 12px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.ch-card:last-child { margin-bottom: 0; }
.ch-card.ch-active { border-color: var(--ch-color, #6366f1); box-shadow: 0 0 0 3px rgba(99,102,241,0.08); }
.ch-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
}
.ch-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ch-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.ch-card-icon.ch-tg { background: #e0f2fe; }
.ch-card-icon.ch-vk { background: #ede9fe; }
.ch-card-icon.ch-email { background: #fef3c7; }
.ch-card-icon.ch-avito { background: #dcfce7; }
.ch-card-icon.ch-max { background: #dbeafe; }
.ch-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.ch-card-desc {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 1px;
}
.ch-card-body {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
    padding: 0 16px;
}
.ch-card.ch-active .ch-card-body {
    max-height: 500px;
    opacity: 1;
    padding: 0 16px 16px;
}
.ch-card-body .ch-field {
    margin-bottom: 10px;
}
.ch-card-body .ch-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 4px;
}
.ch-card-body .ch-field input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #111827;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}
.ch-card-body .ch-field input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: #fff;
}
.ch-card-body .ch-hint {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #e5e7eb;
}
.ch-card-body .ch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.ch-card-body .ch-btn-test {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    transition: all 0.2s;
}
.ch-card-body .ch-btn-test:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99,102,241,0.04);
}
.ch-card-body .ch-webhook-url {
    font-size: 11px;
    color: #6b7280;
    word-break: break-all;
    margin-bottom: 8px;
}

/* Operator status dots */
.op-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.op-status-dot.online { background: #22c55e; }
.op-status-dot.busy { background: #f59e0b; }
.op-status-dot.offline { background: #d1d5db; }

/* ===== PRICING REDESIGN: Bundle Builder ===== */
.wdp-wrap { max-width:1200px; margin:0 auto; padding:32px 20px 40px; }
.wdp-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:36px; }
.wdp-header h2 { font-size:28px; font-weight:800; color:#0f172a; letter-spacing:-0.5px; margin:0 0 6px 0; line-height:1.1; }
.wdp-header p { font-size:14px; color:#94a3b8; margin:0; font-weight:500; }
.wdp-back { padding:8px 20px; border-radius:10px; border:1px solid #e2e8f0; background:#fff; color:#475569; cursor:pointer; font-size:13px; font-weight:500; transition:all .2s; box-shadow:0 1px 2px rgba(0,0,0,.04); flex-shrink:0; font-family:inherit; }
.wdp-back:hover { border-color:#6366f1; color:#6366f1; }
.wdp-products { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.wdp-card { background:#fff; border:1px solid #e2e8f0; border-radius:20px; overflow:hidden; transition:transform .25s ease, box-shadow .25s ease; position:relative; }
.wdp-card:hover { transform:translateY(-2px); box-shadow:0 12px 40px rgba(0,0,0,.08); }
.wdp-card-accent { height:4px; width:100%; }
.wdp-card-accent--quiz { background:linear-gradient(90deg, #c4b5fd, #818cf8, #6366f1); }
.wdp-card-accent--chat { background:linear-gradient(90deg, #93c5fd, #60a5fa, #3b82f6); }
.wdp-card-inner { padding:24px; }
.wdp-card-head { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.wdp-card-icon { width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:20px; flex-shrink:0; }
.wdp-card-icon--quiz { background:linear-gradient(135deg, #ede9fe, #e0e7ff); }
.wdp-card-icon--chat { background:linear-gradient(135deg, #dbeafe, #e0f2fe); }
.wdp-card-title { font-size:16px; font-weight:700; color:#0f172a; letter-spacing:-0.2px; }
.wdp-card-desc { font-size:11px; color:#94a3b8; font-weight:500; margin-top:1px; }
.wdp-tabs { display:flex; gap:6px; padding:4px; background:#f1f5f9; border-radius:12px; margin-bottom:24px; }
.wdp-tab { flex:1; padding:10px 4px; border:none; border-radius:9px; background:transparent; color:#64748b; font-size:12px; font-weight:600; cursor:pointer; transition:all .2s ease; text-align:center; position:relative; z-index:1; font-family:inherit; line-height:1.2; }
.wdp-tab:hover:not(.wdp-tab--active) { color:#475569; background:rgba(255,255,255,.5); }
.wdp-tab--active { background:#fff; color:#0f172a; box-shadow:0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06); }
.wdp-tab-badge { position:absolute; top:-7px; left:50%; transform:translateX(-50%); font-size:8px; font-weight:700; padding:1px 6px; border-radius:6px; letter-spacing:0.3px; white-space:nowrap; line-height:1.5; pointer-events:none; }
.wdp-tab-badge--current { background:#e0e7ff; color:#4338ca; }
.wdp-tab-badge--popular { background:linear-gradient(135deg, #6366f1, #8b5cf6); color:#fff; }
.wdp-plan { min-height:210px; }
.wdp-plan-content { animation:wdpFadeIn .25s ease; }
@keyframes wdpFadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.wdp-price-row { display:flex; align-items:baseline; gap:6px; margin-bottom:4px; }
.wdp-price { font-size:36px; font-weight:800; color:#0f172a; letter-spacing:-1.5px; line-height:1; }
.wdp-price--free { color:#10b981; }
.wdp-price-period { font-size:14px; font-weight:500; color:#94a3b8; }
.wdp-plan-name { font-size:13px; font-weight:600; color:#64748b; margin-bottom:16px; }
.wdp-features { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px; }
.wdp-features li { display:flex; align-items:center; gap:10px; font-size:13px; font-weight:500; color:#334155; line-height:1.3; }
.wdp-features li::before { content:'✓'; display:flex; align-items:center; justify-content:center; width:20px; height:20px; border-radius:6px; background:#ecfdf5; color:#10b981; font-size:11px; font-weight:700; flex-shrink:0; }
.wdp-bundle { border-radius:16px; padding:16px 24px; margin-bottom:16px; display:flex; align-items:center; justify-content:center; gap:12px; animation:wdpSlideUp .3s ease; }
.wdp-bundle--active { background:linear-gradient(135deg, #ede9fe 0%, #e0e7ff 40%, #dbeafe 100%); border:1px solid #c7d2fe; }
.wdp-bundle--hint { background:#f8fafc; border:1px dashed #cbd5e1; }
@keyframes wdpSlideUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.wdp-bundle-icon { font-size:22px; flex-shrink:0; }
.wdp-bundle-text { font-size:14px; font-weight:700; color:#3730a3; letter-spacing:-0.2px; }
.wdp-bundle-saving { font-size:13px; color:#4f46e5; font-weight:600; margin-left:8px; }
.wdp-bundle-hint-text { font-size:13px; color:#64748b; font-weight:500; }
.wdp-summary { background:#fff; border:1px solid #e2e8f0; border-radius:18px; padding:22px 24px; margin-bottom:16px; }
.wdp-summary-lines { margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid #f1f5f9; }
.wdp-summary-line { display:flex; justify-content:space-between; align-items:center; font-size:13px; color:#475569; }
.wdp-summary-line + .wdp-summary-line { margin-top:8px; }
.wdp-summary-line-price { font-weight:600; color:#0f172a; }
.wdp-summary-line-price s { color:#94a3b8; font-weight:400; margin-right:6px; }
.wdp-summary-total { display:flex; justify-content:space-between; align-items:center; }
.wdp-summary-total-label { font-size:15px; font-weight:600; color:#0f172a; }
.wdp-total-num { font-size:30px; font-weight:800; color:#0f172a; letter-spacing:-1px; transition:all .3s ease; }
.wdp-total-period { font-size:14px; font-weight:500; color:#94a3b8; margin-left:4px; }
.wdp-total-free { font-size:30px; font-weight:800; color:#10b981; letter-spacing:-1px; }
.wdp-cta { width:100%; padding:16px 24px; border-radius:14px; border:none; font-size:15px; font-weight:700; cursor:pointer; transition:all .25s ease; font-family:inherit; letter-spacing:-0.2px; }
.wdp-cta--active { background:linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); color:#fff; box-shadow:0 4px 16px rgba(99,102,241,.35); }
.wdp-cta--active:hover { box-shadow:0 8px 28px rgba(99,102,241,.45); transform:translateY(-1px); }
.wdp-cta--disabled { background:#f8fafc; color:#94a3b8; border:1px solid #e2e8f0; cursor:default; }
@media (max-width:768px) {
  .wdp-products { grid-template-columns:1fr; }
  .wdp-header h2 { font-size:24px; }
  .wdp-price { font-size:30px; }
}
@media (max-width:480px) {
  .wdp-wrap { padding:20px 14px 32px; }
  .wdp-tabs { gap:4px; padding:3px; }
  .wdp-tab { font-size:11px; padding:8px 2px; }
  .wdp-card-inner { padding:18px; }
  .wdp-plan { min-height:170px; }
  .wdp-price { font-size:26px; }
  .wdp-total-num, .wdp-total-free { font-size:26px; }
}
/* Chat constructor style step — responsive */
@media (max-width:768px) {
  #chatStep4 > div { flex-direction:column !important; }
  #chatStyleSettings { max-width:100% !important; max-height:none !important; }
  #chatStylePreview { min-height:300px; position:static !important; border-radius:0 0 16px 16px !important; }
  #chatThemePresets { grid-template-columns:repeat(2,1fr) !important; }
  /* Scan results with preview — stack on mobile */
  #chatStep0ResultLayout { flex-direction:column !important; }
  #chatScanSummary { padding-right:0 !important; }
  #chatScanPreview { min-height:300px; border-radius:0 0 16px 16px !important; margin-top:16px; }
}
