:root {
  --acs-bg: #fff7fb;
  --acs-panel: #ffffff;
  --acs-text: #3b2430;
  --acs-muted: #8a5368;
  --acs-line: #f9cfe0;
  --acs-brand: #ec4899;
  --acs-brand-hover: #db2777;
  --acs-brand-dark: #9d174d;
  --acs-brand-soft: #fce7f3;
  --acs-brand-soft-2: #fff1f7;
  --acs-success: #16a34a;
  --acs-warning-bg: #fff7ed;
  --acs-warning-border: #fed7aa;
  --acs-warning-text: #9a3412;
  --acs-danger: #be123c;
  --acs-shadow: 0 28px 70px rgba(190, 24, 93, .24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--acs-text);
  background:
    radial-gradient(circle at top left, rgba(244, 114, 182, .22), transparent 34%),
    radial-gradient(circle at bottom right, rgba(251, 207, 232, .55), transparent 32%),
    var(--acs-bg);
}

.demo-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
}

.demo-page section {
  max-width: 720px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 7px 12px;
  border: 1px solid rgba(236, 72, 153, .22);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--acs-brand-dark);
  background: rgba(252, 231, 243, .75);
}

.demo-page h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  letter-spacing: -.04em;
}

.demo-page p {
  margin-top: 20px;
  font-size: 18px;
  color: var(--acs-muted);
}

.acs-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  min-width: 60px;
  min-height: 60px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: white;
  background: linear-gradient(135deg, #f472b6, var(--acs-brand), #db2777);
  box-shadow: 0 18px 42px rgba(219, 39, 119, .36);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.acs-launcher:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 22px 50px rgba(219, 39, 119, .42);
}

.acs-launcher.left {
  left: 24px;
  right: auto;
}

.acs-launcher-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 17px;
  background: rgba(255, 255, 255, .22);
}

.acs-launcher-label {
  font-weight: 800;
  letter-spacing: .01em;
}

.acs-unread {
  position: absolute;
  top: -5px;
  right: -2px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  color: white;
  background: #f43f5e;
}

.acs-widget {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 2147482999;
  width: min(408px, calc(100vw - 32px));
  height: min(690px, calc(100vh - 120px));
  min-height: 500px;
  border: 1px solid rgba(249, 207, 224, .95);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--acs-shadow);
  animation: acs-open .18s ease-out;
  backdrop-filter: blur(14px);
}

.acs-widget.left {
  left: 24px;
  right: auto;
}

@keyframes acs-open {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.acs-hidden {
  display: none !important;
}

.acs-header {
  min-height: 82px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .32), transparent 30%),
    linear-gradient(135deg, #f472b6, var(--acs-brand), #db2777);
}

.acs-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 17px;
  font-weight: 900;
  color: var(--acs-brand-dark);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px rgba(157, 23, 77, .18);
}

.acs-header-copy {
  min-width: 0;
  flex: 1;
}

.acs-header-copy strong,
.acs-header-copy span {
  display: block;
}

.acs-header-copy strong {
  letter-spacing: .01em;
}

.acs-header-copy span {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, .82);
}

.acs-icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  font-size: 19px;
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .12);
  cursor: pointer;
  transition: background .12s ease, transform .12s ease;
}

.acs-icon-button:hover {
  background: rgba(255, 255, 255, .22);
  transform: translateY(-1px);
}

.acs-messages {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background:
    linear-gradient(180deg, rgba(255, 241, 247, .72), rgba(255, 255, 255, .96));
}

.acs-row {
  display: flex;
  margin: 12px 0;
}

.acs-row.user {
  justify-content: flex-end;
}

.acs-bubble {
  max-width: 80%;
  padding: 12px 15px;
  border-radius: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 22px rgba(157, 23, 77, .06);
}

.acs-row.bot .acs-bubble {
  border: 1px solid var(--acs-line);
  border-bottom-left-radius: 8px;
  color: var(--acs-text);
  background: white;
}

.acs-row.user .acs-bubble {
  border-bottom-right-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--acs-brand), var(--acs-brand-hover));
}

.acs-menu {
  max-width: 90%;
}

.acs-menu-title {
  margin-bottom: 10px;
  font-weight: 750;
}

.acs-menu-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.acs-menu-btn {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--acs-line);
  border-radius: 14px;
  font-size: 14px;
  color: var(--acs-text);
  background: var(--acs-brand-soft-2);
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s, box-shadow .12s;
}

.acs-menu-btn:hover {
  border-color: rgba(236, 72, 153, .5);
  background: var(--acs-brand-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(219, 39, 119, .12);
}

.acs-ticket {
  margin: 0 12px 10px;
  padding: 10px;
  border: 1px solid var(--acs-warning-border);
  border-radius: 14px;
  color: var(--acs-warning-text);
  background: var(--acs-warning-bg);
}

.acs-order {
  margin: 12px 12px 0;
  border: 1px solid var(--acs-line);
  border-radius: 18px;
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 24px rgba(190, 24, 93, .08);
}

.acs-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  font-size: 14px;
  font-weight: 800;
  border-bottom: 1px solid var(--acs-line);
  background: var(--acs-brand-soft-2);
}

.acs-order-head .acs-icon-button {
  color: var(--acs-muted);
  background: transparent;
}

.acs-order-head .acs-icon-button:hover {
  background: rgba(236, 72, 153, .12);
}

.acs-order-body {
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.acs-order-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acs-order label {
  font-size: 12px;
  color: var(--acs-muted);
}

.acs-order input {
  padding: 11px;
  border: 1px solid #f3bad3;
  border-radius: 12px;
  color: var(--acs-text);
  outline: none;
  background: #fffafd;
}

.acs-order input:focus,
.acs-form textarea:focus {
  border-color: var(--acs-brand);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, .13);
}

.acs-order button {
  padding: 11px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--acs-brand);
  cursor: pointer;
}

.acs-order button:hover {
  background: var(--acs-brand-hover);
}

.acs-order button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.acs-order-help {
  margin-top: 2px;
  padding: 6px;
  border: 0;
  font-size: 13px;
  color: var(--acs-brand-dark);
  background: transparent;
  text-decoration: underline;
}

.acs-order-help:hover {
  color: var(--acs-brand-hover);
  background: transparent;
}

.acs-order-result {
  padding: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  color: var(--acs-success);
  background: #f0fdf4;
}

.acs-order-error {
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--acs-danger);
  background: #fff1f2;
}

.acs-form {
  padding: 12px;
  display: flex;
  gap: 9px;
  border-top: 1px solid var(--acs-line);
  background: white;
}

.acs-form textarea {
  min-height: 46px;
  max-height: 120px;
  flex: 1;
  resize: none;
  padding: 12px;
  border: 1px solid #f3bad3;
  border-radius: 15px;
  outline: none;
  color: var(--acs-text);
  background: #fffafd;
}

.acs-form textarea::placeholder {
  color: #bd7a96;
}

.acs-send {
  width: 50px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, var(--acs-brand), var(--acs-brand-hover));
  cursor: pointer;
}

.acs-send:hover {
  filter: saturate(1.08);
}

.acs-send:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.acs-footer {
  padding: 0 12px 10px;
  text-align: center;
  font-size: 10px;
  color: #b47a92;
  background: white;
}

@media (max-width: 520px) {
  .acs-launcher {
    right: 14px;
    bottom: 14px;
    width: 60px;
    padding: 0;
  }

  .acs-launcher.left {
    left: 14px;
  }

  .acs-launcher-label {
    display: none;
  }

  .acs-widget,
  .acs-widget.left {
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }
}
