:root {
  --dialog-bg: #f5f7fb;
  --dialog-surface: #ffffff;
  --dialog-surface-soft: #f8fafc;
  --dialog-border: #e5e7eb;
  --dialog-text: #101828;
  --dialog-muted: #667085;
  --dialog-brand: #2563eb;
  --dialog-brand-dark: #1d4ed8;
  --dialog-success: #10b981;
  --dialog-warning: #f59e0b;
  --dialog-danger: #ef4444;
  --dialog-radius: 22px;
  --dialog-radius-sm: 14px;
  --dialog-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --dialog-sidebar: 280px;
  --dialog-sidebar-compact: 88px;
}

* {
  box-sizing: border-box;
}

[x-cloak] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--dialog-bg);
  color: var(--dialog-text);
}

body {
  min-height: 100%;
  background:
    radial-gradient(circle at 12% 12%, rgba(37, 99, 235, 0.10), transparent 28rem),
    radial-gradient(circle at 82% 10%, rgba(16, 185, 129, 0.12), transparent 24rem),
    var(--dialog-bg);
  color: var(--dialog-text);
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  font-size: 16px;
}

h1,
h2,
h3,
h4,
p,
strong,
small,
.app-help,
.app-label,
.app-btn,
.app-badge {
  hyphens: none;
  overflow-wrap: normal;
  text-wrap: pretty;
  word-break: normal;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--dialog-sidebar) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns .38s cubic-bezier(.22, 1, .36, 1);
}

.app-shell-compact {
  grid-template-columns: var(--dialog-sidebar-compact) minmax(0, 1fr);
}

.app-sidebar {
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid rgba(229, 231, 235, 0.88);
  backdrop-filter: blur(18px);
  min-height: 100vh;
  padding: 22px;
  position: sticky;
  top: 0;
  transition: padding .38s cubic-bezier(.22, 1, .36, 1), width .38s cubic-bezier(.22, 1, .36, 1);
}

.mobile-app-header,
.mobile-menu-backdrop,
.mobile-sidebar-close {
  display: none;
}

.mobile-app-brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.mobile-menu-button,
.mobile-sidebar-close {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(229, 231, 235, .95);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
  color: #101828;
  cursor: pointer;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.app-sidebar-brand {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  min-width: 0;
}

.app-sidebar-logo {
  align-items: center;
  background: #2563eb;
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .20);
  color: #fff;
  display: grid;
  flex: 0 0 44px;
  height: 44px;
  place-items: center;
  width: 44px;
}

.app-sidebar-brand-text,
.app-nav-link span,
.app-sidebar-plan,
.app-sidebar-logout span {
  opacity: 1;
  overflow: hidden;
  transition: opacity .22s ease, transform .32s cubic-bezier(.22, 1, .36, 1), width .32s cubic-bezier(.22, 1, .36, 1);
  white-space: nowrap;
}

.app-shell-compact .app-sidebar {
  padding-inline: 16px;
}

.app-shell-compact .app-sidebar-brand {
  justify-content: center;
}

.app-shell-compact .app-sidebar-brand-text,
.app-shell-compact .app-nav-link span,
.app-shell-compact .app-sidebar-plan,
.app-shell-compact .app-sidebar-logout span {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  width: 0;
}

.app-shell-compact .app-sidebar-plan {
  height: 0;
  margin: 0;
  padding: 0;
  transform: translateX(-10px) scale(.96);
}

.app-shell-compact .app-nav-link,
.app-shell-compact .app-sidebar-logout {
  gap: 0;
  justify-content: center;
  padding-inline: 0;
}

.app-shell-compact .app-nav-link i,
.app-shell-compact .app-sidebar-logout i {
  flex: 0 0 auto;
}

.app-main {
  min-width: 0;
  padding: 24px;
}

.app-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--dialog-radius);
  box-shadow: var(--dialog-shadow);
}

.app-card-soft {
  background: rgba(248, 250, 252, 0.88);
  border: 1px solid var(--dialog-border);
  border-radius: var(--dialog-radius-sm);
}

.app-toast-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
  position: fixed;
  right: 24px;
  top: 22px;
  z-index: 120;
}

.app-toast {
  align-items: center;
  animation: toastIn .28s cubic-bezier(.22, 1, .36, 1);
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(229, 231, 235, .95);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
  color: #344054;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  gap: 10px;
  line-height: 1.35;
  padding: 13px 15px;
  transform-origin: top right;
}

.app-toast.is-hiding {
  animation: toastOut .22s ease forwards;
}

.app-toast-success {
  color: #047857;
}

.app-toast-warning {
  color: #b45309;
}

.app-toast-error {
  color: #b42318;
}

.app-toast i {
  flex: 0 0 auto;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate3d(16px, -10px, 0) scale(.98);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translate3d(16px, -10px, 0) scale(.98);
  }
}

.app-input,
.app-select,
.app-textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 14px;
  background: #fff;
  color: var(--dialog-text);
  outline: none;
  padding: 12px 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus {
  border-color: var(--dialog-brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.app-label {
  display: block;
  color: #344054;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.app-help {
  color: var(--dialog-muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-btn {
  align-items: center;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.app-btn:hover {
  transform: translateY(-1px);
}

.app-btn-primary {
  background: linear-gradient(135deg, var(--dialog-brand), var(--dialog-brand-dark));
  color: #fff;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.22);
}

.app-btn-secondary {
  background: #fff;
  border: 1px solid var(--dialog-border);
  color: #111827;
}

.app-btn-ghost {
  background: transparent;
  color: #475467;
}

.app-nav-link {
  align-items: center;
  border-radius: 16px;
  color: #475467;
  display: flex;
  font-weight: 800;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, gap .28s ease, padding .28s ease;
}

.app-nav-link:hover,
.app-nav-link.is-active {
  background: #eef4ff;
  color: #1d4ed8;
}

.app-badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  padding: 6px 10px;
}

.app-badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.app-badge-green {
  background: #d1fae5;
  color: #047857;
}

.app-badge-gray {
  background: #f2f4f7;
  color: #475467;
}

.builder-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
}

.builder-desktop-page {
  min-width: 0;
}

.builder-workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: 230px minmax(0, 1fr);
}

.builder-tabs {
  align-self: start;
  position: sticky;
  top: 24px;
}

.builder-tab {
  align-items: center;
  border: 0;
  border-radius: 16px;
  color: #667085;
  cursor: pointer;
  display: flex;
  font-weight: 800;
  gap: 10px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.builder-tab:hover,
.builder-tab.is-active {
  background: #eef4ff;
  color: #1d4ed8;
}

.preview-rail {
  align-self: start;
  position: sticky;
  top: 24px;
}

.widget-preview-stage {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 64, 175, 0.75)),
    url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.08'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3C/g%3E%3C/svg%3E");
  border-radius: 28px;
  min-height: 660px;
  overflow: hidden;
  position: relative;
}

.widget-preview-stage.is-mobile {
  border-radius: 34px;
  margin-inline: auto;
  min-height: 680px;
  max-width: 360px;
}

.preset-card {
  border: 1px solid var(--dialog-border);
  border-radius: 18px;
  cursor: pointer;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.preset-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .10);
}

.experience-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.experience-card {
  background: linear-gradient(180deg, #fff, #f8fafc);
  border: 1px solid var(--dialog-border);
  border-radius: 20px;
  color: #101828;
  cursor: pointer;
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.experience-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .10);
  transform: translateY(-1px);
}

.experience-card i {
  color: #2563eb;
}

.experience-card strong {
  font-weight: 900;
}

.experience-card span {
  color: var(--dialog-muted);
  font-size: 12px;
  line-height: 1.35;
}

.button-live-summary {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--dialog-border);
  border-radius: 999px;
  display: inline-flex;
  gap: 8px;
  padding: 8px;
}

.button-live-summary span {
  background: #fff;
  border: 1px solid rgba(229, 231, 235, .9);
  border-radius: 999px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.settings-field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.settings-field-grid-relaxed {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.settings-field-full {
  grid-column: 1 / -1;
}

.features-settings-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.feature-settings-card {
  background: linear-gradient(180deg, rgba(248, 250, 252, .94), #fff);
  border: 1px solid var(--dialog-border);
  border-radius: 24px;
  min-width: 0;
  padding: 18px;
}

.is-plan-locked {
  position: relative;
}

.builder-tab.is-plan-locked {
  color: #64748b;
}

.builder-tab.is-plan-locked span::after {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #c2410c;
  content: "MAX";
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  margin-left: 8px;
  padding: 2px 6px;
  vertical-align: middle;
}

.paid-lock-banner {
  align-items: center;
  background: linear-gradient(135deg, #fff7ed, #eff6ff);
  border: 1px solid #fed7aa;
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(234, 88, 12, .08);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 14px;
}

.paid-lock-banner-hero {
  border-radius: 22px;
  padding: 16px;
}

.paid-lock-banner strong {
  color: #9a3412;
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.paid-lock-banner span {
  color: #64748b;
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.42;
  margin-top: 3px;
}

.paid-lock-banner .app-btn {
  flex: 0 0 auto;
}

.paid-lock-content {
  filter: grayscale(.65);
  opacity: .42;
  pointer-events: none;
  user-select: none;
}

.feature-settings-wide {
  grid-column: 1 / -1;
}

.feature-card-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.feature-card-head h3 {
  font-size: 17px;
  font-weight: 900;
  margin: 0;
}

.feature-card-head p {
  color: var(--dialog-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.feature-card-head i {
  background: #eef4ff;
  border-radius: 14px;
  color: #2563eb;
  flex: 0 0 auto;
  padding: 9px;
}

.feature-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-preset-row button {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 9px 12px;
}

.feature-toggle-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.feature-toggle-card {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.feature-toggle-card input {
  flex: 0 0 auto;
  margin-top: 4px;
}

.feature-toggle-card strong {
  color: #101828;
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.feature-toggle-card small {
  color: var(--dialog-muted);
  display: block;
  font-size: 12px;
  line-height: 1.38;
  margin-top: 3px;
}

.ai-settings-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.ai-settings-card {
  background: linear-gradient(180deg, rgba(248, 250, 252, .94), #fff);
  border: 1px solid var(--dialog-border);
  border-radius: 24px;
  min-width: 0;
  padding: 18px;
}

.ai-settings-wide {
  grid-column: 1 / -1;
}

.ai-card-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ai-card-head h3 {
  font-size: 17px;
  font-weight: 900;
  margin: 0;
}

.ai-card-head p {
  color: var(--dialog-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.ai-card-head i {
  background: linear-gradient(135deg, rgba(37, 99, 235, .14), rgba(16, 185, 129, .14));
  border-radius: 14px;
  color: #2563eb;
  flex: 0 0 auto;
  padding: 9px;
}

.knowledge-create-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, .06), rgba(16, 185, 129, .06));
  border: 1px solid #dbeafe;
  border-radius: 24px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  padding: 18px;
}

.knowledge-create-wide {
  grid-column: 1 / -1;
}

.knowledge-list-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.knowledge-item-card {
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 20px;
  min-width: 0;
  padding: 16px;
}

.knowledge-item-card.is-disabled {
  opacity: .62;
}

.knowledge-meta {
  color: var(--dialog-muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 4px;
}

.knowledge-source {
  color: #2563eb;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  margin-top: 10px;
  text-decoration: none;
}

.button-settings-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.button-control-card {
  background: linear-gradient(180deg, rgba(248, 250, 252, .94), #fff);
  border: 1px solid var(--dialog-border);
  border-radius: 24px;
  min-width: 0;
  padding: 16px;
}

.button-control-wide {
  grid-column: 1 / -1;
}

.button-control-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.button-control-head h3 {
  font-size: 16px;
  font-weight: 900;
  margin: 0;
}

.button-control-head p {
  color: var(--dialog-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.button-control-head i {
  background: #eef4ff;
  border-radius: 14px;
  color: #2563eb;
  flex: 0 0 auto;
  padding: 9px;
}

.button-shape-grid,
.button-shadow-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.button-shape-card,
.button-shadow-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 18px;
  color: #334155;
  cursor: pointer;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 92px;
  padding: 12px 8px;
  text-align: center;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.button-shadow-card {
  min-height: 82px;
}

.button-shape-card:hover,
.button-shadow-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .10);
  transform: translateY(-1px);
}

.button-shape-card.is-active,
.button-shadow-card.is-active {
  background: #eff6ff;
  border-color: #60a5fa;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .14);
  color: #1d4ed8;
}

.button-shape-card strong,
.button-shadow-card strong {
  font-size: 12px;
  font-weight: 900;
}

.button-shape-swatch,
.button-shadow-dot {
  background: linear-gradient(135deg, #2563eb, #10b981);
  display: block;
  height: 38px;
  width: 38px;
}

.button-shape-swatch.is-circle {
  border-radius: 999px;
}

.button-shape-swatch.is-squircle {
  border-radius: 18px;
}

.button-shape-swatch.is-rounded {
  border-radius: 12px;
}

.button-shape-swatch.is-square {
  border-radius: 7px;
}

.button-shadow-dot {
  border-radius: 16px;
}

.button-shadow-dot.is-deep {
  box-shadow: 0 15px 26px rgba(15, 23, 42, .28);
}

.button-shadow-dot.is-soft {
  box-shadow: 0 10px 18px rgba(15, 23, 42, .14);
}

.button-shadow-dot.is-glow {
  box-shadow: 0 14px 24px rgba(37, 99, 235, .28), 0 0 0 8px rgba(37, 99, 235, .14);
}

.button-shadow-dot.is-none {
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .35);
}

.button-backdrop-card {
  background: linear-gradient(180deg, rgba(248, 250, 252, .94), #fff);
  border: 1px solid var(--dialog-border);
  border-radius: 20px;
  padding: 16px;
}

.button-backdrop-card h4 {
  color: #101828;
  font-size: 15px;
  font-weight: 900;
  margin: 0;
}

.button-backdrop-card p {
  color: var(--dialog-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 5px 0 0;
}

.button-backdrop-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.button-backdrop-presets button {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 11px;
}

.greeting-control-card {
  background: linear-gradient(180deg, rgba(248, 250, 252, .94), #fff);
  border: 1px solid var(--dialog-border);
  border-radius: 24px;
  padding: 18px;
}

.greeting-rules-panel {
  scroll-margin-top: 18px;
}

.greeting-control-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.greeting-control-head h3 {
  font-size: 17px;
  font-weight: 900;
  margin: 0;
}

.greeting-control-head p {
  color: var(--dialog-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.greeting-rule-head-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.greeting-rules-workbar {
  align-items: center;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  border: 1px solid #dbeafe;
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .08);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, auto);
  margin-bottom: 16px;
  padding: 14px;
}

.greeting-rules-workbar > div:first-child {
  max-width: 620px;
  min-width: 0;
}

.greeting-rules-workbar strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.greeting-rules-workbar p {
  color: var(--dialog-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  margin: 4px 0 0;
  max-width: 560px;
}

.greeting-quick-rule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.greeting-quick-rule-row button {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
  transition: background .18s ease, transform .18s ease;
}

.greeting-quick-rule-row button:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.greeting-rules-list {
  display: grid;
  gap: 14px;
}

.greeting-rule-card {
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 22px;
  padding: 16px;
}

.greeting-rule-card.is-active {
  border-color: #93c5fd;
  box-shadow: 0 16px 34px rgba(37, 99, 235, .10);
}

.greeting-rule-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.greeting-rule-title {
  align-items: center;
  background: transparent;
  border: 0;
  color: #101828;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  gap: 10px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.greeting-rule-title > span {
  display: grid;
  gap: 3px;
}

.greeting-rule-title strong {
  font-weight: 900;
}

.greeting-rule-title small {
  color: var(--dialog-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.greeting-empty {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  color: #475569;
  display: flex;
  gap: 12px;
  padding: 16px;
}

.greeting-rules-footer {
  border-top: 1px solid var(--dialog-border);
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
}

.greeting-empty strong {
  color: #101828;
  display: block;
  font-weight: 900;
}

.greeting-empty p {
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.trigger-preset-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.trigger-preset-card {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 18px;
  color: #101828;
  cursor: pointer;
  display: flex;
  gap: 12px;
  min-height: 96px;
  padding: 14px;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.trigger-preset-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .10);
  transform: translateY(-1px);
}

.trigger-preset-card i,
.trigger-help-card i,
.trigger-options-head i {
  background: #eef4ff;
  border-radius: 14px;
  color: #2563eb;
  flex: 0 0 auto;
  padding: 9px;
}

.trigger-preset-card strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.trigger-preset-card small {
  color: var(--dialog-muted);
  display: block;
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
}

.trigger-help-card,
.trigger-options-panel {
  background: linear-gradient(135deg, rgba(37, 99, 235, .07), rgba(16, 185, 129, .07));
  border: 1px solid #dbeafe;
  border-radius: 18px;
  color: #334155;
}

.trigger-help-card {
  align-items: flex-start;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 12px;
  line-height: 1.45;
  padding: 14px;
}

.trigger-options-panel {
  padding: 16px;
}

.trigger-options-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.trigger-options-head strong {
  display: block;
  font-weight: 900;
}

.trigger-options-head p {
  color: var(--dialog-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 4px 0 0;
}

.rule-trigger-tools {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--dialog-border);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.rule-trigger-tools button {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
  transition: background .18s ease, transform .18s ease;
}

.rule-trigger-tools button:hover {
  background: #eff6ff;
  transform: translateY(-1px);
}

.preset-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.preset-dots span {
  border-radius: 999px;
  height: 18px;
  width: 18px;
}

.appearance-mini-preview {
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 18px;
  display: grid;
  gap: 5px;
  min-height: 88px;
  overflow: hidden;
  padding: 0 12px 12px;
}

.appearance-mini-preview span {
  border-radius: 0 0 16px 16px;
  display: block;
  height: 30px;
  margin-inline: -12px;
}

.appearance-mini-preview strong {
  font-size: 14px;
  font-weight: 900;
}

.appearance-mini-preview small {
  color: var(--dialog-muted);
  font-size: 12px;
}

.appearance-mini-preview.is-shadow-deep {
  box-shadow: 0 18px 36px rgba(15, 23, 42, .16);
}

.appearance-mini-preview.is-shadow-soft {
  box-shadow: 0 12px 26px rgba(15, 23, 42, .08);
}

.appearance-assets-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.appearance-control-card,
.appearance-upload-card {
  background: linear-gradient(180deg, rgba(248, 250, 252, .9), #fff);
  border: 1px solid var(--dialog-border);
  border-radius: 18px;
  min-width: 0;
  padding: 14px;
}

.appearance-control-card {
  grid-column: 1 / -1;
}

.appearance-control-wide {
  grid-column: 1 / -1;
}

.appearance-section-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.appearance-range-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.appearance-range-grid label {
  background: #f8fafc;
  border: 1px solid var(--dialog-border);
  border-radius: 16px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.appearance-range-grid span {
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.appearance-upload-card {
  display: grid;
  gap: 10px;
}

.appearance-value {
  background: #eef4ff;
  border-radius: 999px;
  color: #1d4ed8;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 11px;
}

.appearance-preview-button {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(16, 185, 129, .08)),
    #f8fafc;
  border: 1px dashed #bfdbfe;
  color: #64748b;
  cursor: pointer;
  display: grid;
  height: 86px;
  justify-items: center;
  overflow: hidden;
  place-items: center;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  width: 100%;
}

.appearance-preview-button:hover {
  border-color: #60a5fa;
  box-shadow: 0 14px 28px rgba(37, 99, 235, .12);
  transform: translateY(-1px);
}

.appearance-preview-button img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.appearance-preview-button.is-avatar {
  border-radius: 18px;
}

.appearance-preview-button.is-icon {
  border-radius: 999px;
  height: 86px;
  justify-self: center;
  width: 86px;
}

.animation-settings-panel {
  background: linear-gradient(180deg, rgba(248, 250, 252, .94), #fff);
  border: 1px solid var(--dialog-border);
  border-radius: 22px;
  padding: 14px;
}

.animation-settings-panel summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  list-style: none;
}

.animation-settings-panel summary::-webkit-details-marker {
  display: none;
}

.animation-settings-panel summary span {
  align-items: center;
  display: inline-flex;
  font-weight: 900;
  gap: 10px;
}

.animation-settings-panel summary strong {
  background: #eef4ff;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 12px;
  padding: 7px 11px;
}

.animation-options-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.animation-option-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 18px;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: auto auto minmax(0, 1fr);
  padding: 13px;
}

.animation-option-card:has(input:checked) {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .10);
}

.animation-option-card input {
  height: 18px;
  width: 18px;
}

.animation-option-card strong,
.animation-option-card small {
  display: block;
}

.animation-option-card small {
  color: var(--dialog-muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 3px;
}

.animation-option-icon {
  background: #2563eb;
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .24);
  display: inline-block;
  height: 34px;
  position: relative;
  width: 34px;
}

.animation-option-icon.is-pulse-demo {
  animation: dialogPulse 2.1s ease-in-out infinite;
}

.animation-option-icon.is-glint-demo {
  overflow: hidden;
}

.animation-option-icon.is-glint-demo::after {
  animation: dialogGlint 2.8s ease-in-out infinite;
  background: linear-gradient(100deg, transparent 18%, rgba(255,255,255,.7) 50%, transparent 82%);
  background-position: 180% 0;
  background-size: 220% 100%;
  border-radius: inherit;
  content: "";
  inset: 0;
  position: absolute;
}

.animation-option-icon.is-ring-demo::before {
  animation: dialogRing 2s ease-out infinite;
  border: 2px solid #2563eb;
  border-radius: inherit;
  content: "";
  inset: -8px;
  opacity: .42;
  position: absolute;
}

.preview-chat-button {
  --launcher-shadow-normal: 0 18px 36px rgba(0, 0, 0, .20);
  --launcher-shadow-pulse: 0 22px 42px color-mix(in srgb, var(--launcher-primary, #2563eb) 36%, transparent);
  align-items: center;
  border: 0;
  bottom: 24px;
  box-sizing: border-box;
  box-shadow: var(--launcher-shadow-normal);
  color: #fff;
  display: flex;
  height: 62px;
  justify-content: center;
  overflow: visible;
  padding: var(--launcher-icon-padding, 10px);
  position: absolute;
  right: 24px;
  width: 62px;
}

.preview-button-shape {
  border-radius: inherit;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.preview-chat-button > img,
.preview-chat-button > svg {
  max-height: 100%;
  max-width: 100%;
  position: relative;
  z-index: 2;
}

.preview-chat-button.is-style-glass {
  backdrop-filter: blur(18px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--launcher-primary, #2563eb) 72%, white), color-mix(in srgb, var(--launcher-accent, #10b981) 72%, white)) !important;
  border: 1px solid rgba(255, 255, 255, .58);
}

.preview-chat-button.is-style-outline {
  background: rgba(255, 255, 255, .92) !important;
}

.preview-chat-button.is-shadow-deep {
  --launcher-shadow-normal: 0 18px 36px rgba(0, 0, 0, .20);
  --launcher-shadow-pulse: 0 24px 48px color-mix(in srgb, var(--launcher-primary, #2563eb) 38%, transparent);
  box-shadow: var(--launcher-shadow-normal);
}

.preview-chat-button.is-shadow-soft {
  --launcher-shadow-normal: 0 12px 26px rgba(15, 23, 42, .14);
  --launcher-shadow-pulse: 0 16px 34px color-mix(in srgb, var(--launcher-primary, #2563eb) 24%, transparent);
  box-shadow: var(--launcher-shadow-normal);
}

.preview-chat-button.is-shadow-glow {
  --launcher-shadow-normal: 0 18px 38px color-mix(in srgb, var(--launcher-primary, #2563eb) 42%, transparent), 0 0 0 9px color-mix(in srgb, var(--launcher-primary, #2563eb) 13%, transparent), 0 0 34px color-mix(in srgb, var(--launcher-accent, #10b981) 30%, transparent);
  --launcher-shadow-pulse: 0 22px 46px color-mix(in srgb, var(--launcher-primary, #2563eb) 50%, transparent), 0 0 0 13px color-mix(in srgb, var(--launcher-primary, #2563eb) 11%, transparent), 0 0 44px color-mix(in srgb, var(--launcher-accent, #10b981) 40%, transparent);
  box-shadow: var(--launcher-shadow-normal);
}

.preview-chat-button.is-shadow-none {
  --launcher-shadow-normal: none;
  --launcher-shadow-pulse: none;
  box-shadow: none;
}

.preview-chat-button.is-pulse {
  animation: dialogPulse 2.1s ease-in-out infinite;
}

.preview-chat-button.is-ring::before {
  animation: dialogRing 2s ease-out infinite;
  border: 2px solid currentColor;
  border-radius: inherit;
  content: "";
  inset: -8px;
  opacity: .42;
  position: absolute;
}

.preview-chat-button.is-glint::after {
  display: none;
}

.preview-chat-button.is-glint .preview-button-shape::after {
  animation: dialogGlint 2.8s ease-in-out infinite;
  background: linear-gradient(100deg, transparent 18%, rgba(255,255,255,.58) 50%, transparent 82%);
  background-position: 180% 0;
  background-size: 220% 100%;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.preview-launcher-badge {
  align-items: center;
  background: #ef4444;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 5px;
  position: absolute;
  right: -3px;
  top: -4px;
  z-index: 3;
}

.preview-launcher-badge.is-pulse {
  animation: badgePulse 1.8s ease-in-out infinite;
}

.preview-window {
  bottom: 98px;
  display: flex;
  flex-direction: column;
  max-height: 510px;
  overflow: hidden;
  position: absolute;
  right: 24px;
  transform-origin: calc(100% - 24px) 100%;
  width: min(330px, calc(100% - 48px));
  z-index: 4;
}

.preview-open-backdrop {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.preview-backdrop-enter,
.preview-backdrop-leave {
  transition: opacity .22s ease, backdrop-filter .22s ease;
}

.preview-backdrop-enter-start,
.preview-backdrop-leave-end {
  opacity: 0;
}

.preview-backdrop-enter-end,
.preview-backdrop-leave-start {
  opacity: 1;
}

.preview-window.is-shadow-deep {
  box-shadow: 0 28px 70px rgba(15, 23, 42, .24);
}

.preview-window.is-shadow-soft {
  box-shadow: 0 18px 42px rgba(15, 23, 42, .13);
}

.preview-window.is-shadow-none {
  box-shadow: none;
}

.preview-header {
  overflow: hidden;
  position: relative;
}

.preview-header::after {
  background: radial-gradient(circle at 82% 0%, rgba(255,255,255,.36), transparent 34%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.preview-online-status {
  align-items: center;
  display: flex;
  font-size: 11px;
  font-weight: 800;
  gap: 6px;
  margin-top: 4px;
  opacity: .9;
}

.preview-online-status span {
  animation: statusPulse 1.8s ease-in-out infinite;
  background: #34d399;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .16);
  height: 7px;
  width: 7px;
}

.preview-online-status em {
  font-style: normal;
}

.preview-enter {
  transition: opacity .24s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
}

.preview-enter-start,
.preview-leave-end {
  opacity: 0;
  transform: translateY(14px) scale(.97);
}

.preview-enter-end,
.preview-leave-start {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.preview-leave {
  transition: opacity .18s ease, transform .22s cubic-bezier(.55, .06, .68, .19);
}

.preview-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.preview-message {
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.42;
  padding: 11px 13px;
}

.preview-message-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-message-stack-visitor {
  align-items: flex-end;
}

.preview-message-operator {
  background: #f1f5f9;
  color: #334155;
}

.preview-message-visitor {
  color: #fff;
  margin-left: 32px;
}

.preview-read-status {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  padding-right: 2px;
  text-align: right;
}

.preview-window.is-message-soft .preview-message {
  border-radius: 14px;
}

.preview-window.is-message-minimal .preview-message {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .18);
  padding: 9px 11px;
}

.preview-window.is-message-minimal .preview-message-operator {
  background: transparent;
}

.preview-composer {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
  padding: 10px;
}

.preview-composer.is-comfort {
  gap: 8px;
  padding: 12px;
}

.preview-compose-action,
.preview-send-action {
  align-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  justify-content: center;
  place-items: center;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  width: 38px;
}

.preview-compose-action {
  background: #f1f5f9;
  color: #475569;
}

.preview-send-action {
  color: #fff;
}

.preview-compose-action:hover,
.preview-send-action:hover {
  transform: translateY(-1px);
}

.preview-voice-action.is-recording {
  background: #fee2e2;
  color: #dc2626;
}

.preview-voice-action.is-recording::before,
.preview-voice-action.is-recording::after {
  animation: voiceWave 1.35s ease-out infinite;
  border: 1px solid currentColor;
  border-radius: inherit;
  content: "";
  inset: -5px;
  opacity: .48;
  position: absolute;
}

.preview-voice-action.is-recording::after {
  animation-delay: .32s;
}

.preview-textarea {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  font-size: 16px;
  height: 38px;
  line-height: 1.35;
  max-height: 128px;
  min-height: 38px;
  min-width: 0;
  outline: none;
  overflow-y: hidden;
  padding: 8px 13px;
  resize: none;
  transition: border-radius .18s ease, height .08s ease;
  width: 100%;
}

.preview-textarea.is-multiline {
  border-radius: 18px;
}

.preview-textarea.is-scrollable {
  overflow-y: auto;
}

.preview-composer.is-comfort .preview-textarea {
  border-radius: 16px;
  height: 46px;
  min-height: 46px;
}

.preview-composer.is-comfort .preview-textarea.is-multiline {
  border-radius: 18px;
}

.preview-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-quick-replies.is-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-quick-replies.is-compact {
  gap: 6px;
}

.preview-quick-reply {
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.preview-quick-replies.is-cards .preview-quick-reply {
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .08);
  text-align: left;
}

.preview-quick-replies.is-compact .preview-quick-reply {
  font-size: 11px;
  padding: 6px 8px;
}

.preview-contact-card {
  background: #eff6ff;
  border: 1px dashed #bfdbfe;
  border-radius: 18px;
  color: #1e40af;
  font-size: 12px;
  font-weight: 700;
  padding: 10px;
}

.preview-contact-card span {
  display: block;
}

.preview-contact-card button {
  background: #2563eb;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  margin-top: 8px;
  padding: 7px 10px;
}

.preview-typing,
.dai-typing {
  align-items: center;
  background: #f1f5f9;
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  padding: 9px 12px;
  width: max-content;
}

.preview-typing span,
.dai-typing span {
  animation: typingDot 1.1s ease-in-out infinite;
  border-radius: 999px;
  height: 7px;
  opacity: .45;
  width: 7px;
}

.preview-typing span:nth-child(2),
.dai-typing span:nth-child(2) {
  animation-delay: .16s;
}

.preview-typing span:nth-child(3),
.dai-typing span:nth-child(3) {
  animation-delay: .32s;
}

.preview-greeting-card {
  filter: none;
  max-width: min(334px, calc(100% - var(--preview-launcher-size, 62px) - 34px));
  position: absolute;
  transform: translateZ(0);
  width: min(334px, calc(100% - var(--preview-launcher-size, 62px) - 34px));
  z-index: 3;
}

.preview-greeting-bubble {
  align-items: center;
  background: #fff;
  border: 2px solid rgba(245, 240, 230, .95);
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .18);
  color: #101828;
  cursor: pointer;
  display: flex;
  gap: 13px;
  isolation: isolate;
  min-height: 94px;
  overflow: visible;
  padding: 16px 38px 16px 17px;
  position: relative;
  text-align: left;
  width: 100%;
}

.preview-greeting-bubble::after {
  background: #fff;
  border-radius: 3px;
  border-right: 2px solid rgba(245, 240, 230, .95);
  border-top: 2px solid rgba(245, 240, 230, .95);
  content: "";
  height: 18px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 18px;
  z-index: 0;
}

.preview-greeting-card.is-right .preview-greeting-bubble::after {
  right: -9px;
}

.preview-greeting-card.is-left .preview-greeting-bubble::after {
  border-left: 2px solid rgba(245, 240, 230, .95);
  border-right: 0;
  left: -9px;
}

.preview-greeting-avatar {
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  border-radius: 999px;
  color: #64748b;
  display: grid;
  flex: 0 0 52px;
  height: 52px;
  overflow: hidden;
  place-items: center;
  position: relative;
  width: 52px;
  z-index: 1;
}

.preview-greeting-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.preview-greeting-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.preview-greeting-copy strong {
  color: #101828;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.12;
}

.preview-greeting-copy span {
  color: #4b5563;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.28;
}

.preview-greeting-action {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  justify-content: center;
  margin-top: 2px;
  padding: 7px 11px;
  width: max-content;
}

.preview-greeting-action.is-primary {
  background: var(--preview-accent, #2563eb);
  color: #fff;
}

.preview-greeting-action.is-soft {
  background: #eff6ff;
  color: #1d4ed8;
}

.preview-greeting-action.is-outline {
  background: #fff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
  color: #1d4ed8;
}

.preview-greeting-close {
  align-items: center;
  background: transparent;
  border: 0;
  color: #d1d5db;
  display: flex;
  height: 28px;
  justify-content: center;
  position: absolute;
  right: 9px;
  top: 9px;
  width: 28px;
  z-index: 2;
}

@media (max-width: 560px) {
  .preview-greeting-card {
    max-width: 172px;
    width: 172px;
  }

  .preview-greeting-bubble {
    border: 1px solid rgba(245, 240, 230, .95);
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
    display: grid;
    gap: 5px;
    justify-items: center;
    min-height: 92px;
    padding: 18px 10px 11px;
    text-align: center;
    width: 172px;
  }

  .preview-greeting-bubble::after {
    bottom: -6px;
    height: 14px;
    right: 26px;
    top: auto;
    transform: rotate(45deg);
    width: 14px;
  }

  .preview-greeting-card.is-left .preview-greeting-bubble::after {
    left: 26px;
    right: auto;
  }

  .preview-greeting-avatar {
    flex-basis: 32px;
    height: 32px;
    position: absolute;
    top: -12px;
    width: 32px;
  }

  .preview-greeting-copy {
    gap: 3px;
  }

  .preview-greeting-copy strong {
    font-size: 11px;
    letter-spacing: -.02em;
  }

  .preview-greeting-copy span {
    font-size: 11px;
    line-height: 1.22;
  }

  .preview-greeting-action {
    font-size: 10px;
    padding: 5px 8px;
  }

  .preview-greeting-close {
    height: 18px;
    right: 2px;
    top: 0;
    width: 18px;
  }
}

.preview-video-mini {
  aspect-ratio: 9 / 16;
  background: linear-gradient(160deg, #111827, #2563eb);
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .25);
  color: #fff;
  overflow: hidden;
  width: 138px;
}

.preview-video-expanded {
  aspect-ratio: 9 / 16;
  background: #111827;
  border-radius: 28px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .28);
  color: #fff;
  overflow: hidden;
  width: min(260px, calc(100vw - 96px));
}

.crop-modal {
  align-items: center;
  background: rgba(15, 23, 42, .58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 60;
}

.crop-panel {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
  max-width: 760px;
  overflow: hidden;
  width: min(100%, 760px);
}

.crop-canvas {
  background: #0f172a;
  max-height: 58vh;
  overflow: hidden;
}

.crop-canvas img {
  display: block;
  max-width: 100%;
}

.billing-plan-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.billing-plan-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.billing-plan-card {
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  position: relative;
}

.billing-plan-card.is-current {
  border-color: #bfdbfe;
  box-shadow: 0 18px 42px rgba(37, 99, 235, .1);
}

.billing-plan-card-pro {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, .16), transparent 34%),
    linear-gradient(145deg, #f8fbff 0%, #fff 58%, #ecfdf5 100%);
  border-color: #bfdbfe;
}

.billing-plan-top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.billing-plan-label {
  color: #2563eb;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.billing-plan-card h3 {
  color: #0f172a;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.03em;
  margin: 0;
}

.billing-plan-card p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin: 8px 0 0;
}

.billing-current-badge {
  background: #dcfce7;
  border-radius: 999px;
  color: #166534;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.billing-price {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-price strong {
  color: #0f172a;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.04em;
}

.billing-price span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.billing-feature-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.billing-feature-list li {
  align-items: flex-start;
  color: #334155;
  display: flex;
  font-size: 14px;
  font-weight: 750;
  gap: 9px;
  line-height: 1.35;
}

.billing-feature-list i {
  color: #16a34a;
  flex: 0 0 auto;
  margin-top: 2px;
}

.billing-plan-note {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  margin-top: auto;
  padding: 12px;
}

.install-page {
  overflow: hidden;
}

.install-hero {
  align-items: flex-start;
  background:
    radial-gradient(circle at 8% 0%, rgba(59, 130, 246, .16), transparent 32%),
    linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
  border: 1px solid rgba(191, 219, 254, .9);
  border-radius: 26px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 22px;
}

.install-kicker {
  color: #2563eb;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.install-hero h2 {
  color: #0f172a;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1;
  margin: 0;
}

.install-hero p {
  color: #475569;
  font-size: 15px;
  line-height: 1.55;
  margin: 10px 0 0;
  max-width: 720px;
}

.install-ready {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .12);
  color: #1d4ed8;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  padding: 10px 14px;
}

.install-sequence {
  display: grid;
  gap: 16px;
  position: relative;
}

.install-step-card {
  align-items: flex-start;
  display: grid;
  gap: 14px;
  grid-template-columns: 44px minmax(0, 1fr);
  position: relative;
}

.install-step-card:not(:last-child)::before {
  background: linear-gradient(#bfdbfe, rgba(191, 219, 254, .25));
  content: "";
  height: calc(100% + 16px);
  left: 21px;
  position: absolute;
  top: 44px;
  width: 2px;
}

.install-step-mark {
  align-items: center;
  background: linear-gradient(135deg, #2563eb, #0f172a);
  border: 4px solid #fff;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .22);
  color: #fff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 900;
  height: 44px;
  justify-content: center;
  position: relative;
  width: 44px;
  z-index: 1;
}

.install-step-body {
  background: #fff;
  border: 1px solid var(--dialog-border);
  border-radius: 24px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .05);
  padding: 18px;
}

.install-section-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.install-section-head h3,
.install-checklist h3 {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  margin: 0;
}

.install-section-head p,
.install-checklist p {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin: 5px 0 0;
}

.install-choice-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.install-choice {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  color: #334155;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  padding: 12px;
}

.install-choice > i {
  align-items: center;
  background: #fff;
  border-radius: 14px;
  color: #2563eb;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.install-choice strong {
  color: #0f172a;
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.install-choice span {
  color: #64748b;
  display: block;
  font-size: 13px;
  line-height: 1.35;
  margin-top: 2px;
}

.install-choice em {
  background: #dbeafe;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  padding: 6px 9px;
  white-space: nowrap;
}

.install-choice.is-primary {
  background: linear-gradient(135deg, #eff6ff, #fff);
  border-color: #bfdbfe;
}

.install-code {
  background: #0f172a;
  border-radius: 18px;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.install-section-head + .install-code {
  margin-top: 14px;
}

.install-mini-tips {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.install-mini-tips span {
  align-items: center;
  color: #475569;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
}

.install-mini-tips i {
  color: #16a34a;
  flex: 0 0 auto;
}

.install-checklist {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 18px;
}

.install-checklist-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
}

.install-checklist-head > i {
  color: #2563eb;
  flex: 0 0 auto;
  margin-top: 2px;
}

.install-checks {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.install-checks span {
  align-items: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  color: #334155;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  gap: 8px;
  padding: 11px 12px;
}

.install-checks span::before {
  background: #22c55e;
  border-radius: 999px;
  content: "";
  height: 8px;
  width: 8px;
}

@keyframes dialogPulse {
  0%, 100% { transform: scale(1); box-shadow: var(--launcher-shadow-normal, 0 18px 34px rgba(15,23,42,.24)); }
  50% { transform: scale(1.06); box-shadow: var(--launcher-shadow-pulse, 0 22px 42px rgba(37,99,235,.32)); }
}

@keyframes dialogRing {
  0% { transform: scale(.88); opacity: .55; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes dialogGlint {
  0%, 45% { background-position: 180% 0; }
  80%, 100% { background-position: -80% 0; }
}

@keyframes typingDot {
  0%, 80%, 100% {
    opacity: .36;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes voiceWave {
  0% {
    opacity: .52;
    transform: scale(.82);
  }

  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .32);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    transform: scale(1.06);
  }
}

@keyframes statusPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .18);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0);
  }
}

.typing-live-dot {
  animation: statusPulse 1.4s ease-in-out infinite;
  background: #2563eb;
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.messages-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  min-height: calc(100vh - 48px);
}

.conversation-list {
  max-height: calc(100vh - 160px);
  overflow: auto;
}

.conversation-thread {
  min-height: calc(100vh - 160px);
}

@media (max-width: 1180px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }

  .builder-workspace {
    grid-template-columns: 1fr;
  }

  .appearance-assets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .animation-options-grid {
    grid-template-columns: 1fr;
  }

  .experience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-field-grid {
    grid-template-columns: 1fr;
  }

  .greeting-rules-workbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .greeting-quick-rule-row {
    justify-content: flex-start;
  }

  .preview-rail {
    position: static;
  }

  .builder-tabs {
    position: static;
  }
}

@media (max-width: 720px) {
  .experience-grid {
    grid-template-columns: 1fr;
  }

  .button-shape-grid,
  .button-shadow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appearance-assets-grid {
    grid-template-columns: 1fr;
  }

  .appearance-control-card {
    grid-column: auto;
  }

}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .app-shell-compact {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    border: 1px solid rgba(229, 231, 235, .95);
    border-radius: 26px;
    bottom: 12px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, .22);
    left: 12px;
    min-height: auto;
    opacity: 0;
    overflow-y: auto;
    pointer-events: none;
    position: fixed;
    top: 12px;
    transform: translateX(calc(-100% - 24px));
    transition: opacity .2s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
    width: min(336px, calc(100vw - 24px));
    z-index: 80;
  }

  .app-sidebar.is-mobile-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .mobile-app-header {
    align-items: center;
    background: rgba(245, 247, 251, .86);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(229, 231, 235, .78);
    display: flex;
    justify-content: space-between;
    left: 0;
    padding: 12px 16px;
    position: sticky;
    right: 0;
    top: 0;
    z-index: 60;
  }

  .mobile-menu-button,
  .mobile-sidebar-close {
    display: inline-flex;
  }

  .mobile-menu-backdrop {
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(4px);
    border: 0;
    cursor: pointer;
    display: block;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .22s ease;
    z-index: 70;
  }

  .mobile-menu-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell-compact .app-sidebar {
    padding: 22px;
  }

  .app-sidebar-brand {
    justify-content: space-between;
  }

  .app-shell-compact .app-sidebar-brand {
    justify-content: space-between;
  }

  .app-shell-compact .app-sidebar-brand-text,
  .app-shell-compact .app-nav-link span,
  .app-shell-compact .app-sidebar-plan,
  .app-shell-compact .app-sidebar-logout span {
    height: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    width: auto;
  }

  .app-shell-compact .app-sidebar-plan {
    margin-top: 32px;
    padding: 16px;
  }

  .app-shell-compact .app-nav-link,
  .app-shell-compact .app-sidebar-logout {
    gap: 12px;
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .app-main {
    padding: 16px;
  }

  .app-toast-stack {
    left: 16px;
    max-width: none;
    right: 16px;
    top: 76px;
  }

  .messages-layout {
    grid-template-columns: 1fr;
  }

  .billing-plan-head,
  .billing-plan-top {
    flex-direction: column;
  }

  .billing-plan-grid {
    grid-template-columns: 1fr;
  }

  .paid-lock-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .install-hero,
  .install-section-head {
    flex-direction: column;
  }

  .install-step-card {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .install-step-card:not(:last-child)::before {
    left: 17px;
    top: 36px;
  }

  .install-step-mark {
    border-radius: 14px;
    border-width: 3px;
    height: 36px;
    width: 36px;
  }

  .install-choice {
    align-items: flex-start;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .install-choice em {
    grid-column: 2;
    justify-self: flex-start;
  }

  .install-checks {
    grid-template-columns: 1fr;
  }

  .app-shell-compact[data-compact-sidebar="true"] .app-sidebar {
    padding: 22px;
  }

  .app-shell-compact[data-compact-sidebar="true"] .app-sidebar-brand {
    justify-content: space-between;
  }

  .app-shell-compact[data-compact-sidebar="true"] .app-sidebar-brand-text,
  .app-shell-compact[data-compact-sidebar="true"] .app-nav-link span,
  .app-shell-compact[data-compact-sidebar="true"] .app-sidebar-plan,
  .app-shell-compact[data-compact-sidebar="true"] .app-sidebar-logout span {
    height: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    width: auto;
  }

  .app-shell-compact[data-compact-sidebar="true"] .app-sidebar-plan {
    margin-top: 32px;
    padding: 16px;
    transform: none;
  }

  .app-shell-compact[data-compact-sidebar="true"] .app-nav-link,
  .app-shell-compact[data-compact-sidebar="true"] .app-sidebar-logout {
    gap: 12px;
    justify-content: flex-start;
    padding: 12px 14px;
  }

  .app-shell-compact[data-compact-sidebar="true"] .app-main {
    padding: 16px;
  }
}
