#ags-live-chat-root {
  --ags-lc-accent: #45dff5;
  --ags-lc-surface: #081725;
  --ags-lc-text: #eff8fc;
  --ags-lc-muted: #aec1cc;
  --ags-lc-line: rgba(150, 215, 240, .19);
  direction: rtl;
  font-family: Estedad, Vazirmatn, IRANSansX, "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ags-lc-text);
  position: relative;
  z-index: 999998;
}

#ags-live-chat-root *,
#ags-live-chat-root *::before,
#ags-live-chat-root *::after {
  box-sizing: border-box;
}

.ags-lc-launcher {
  position: fixed;
  z-index: 999998;
  right: 22px;
  bottom: 80px;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(10, 30, 46, .98), rgba(5, 15, 27, .99)) padding-box,
    linear-gradient(135deg, #45dff5, #6aa9ff 58%, #9b7cff) border-box;
  color: #a8f5ff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .48), 0 0 28px rgba(69, 223, 245, .24);
  cursor: pointer;
  font: inherit;
  transition: transform .2s ease, color .2s ease, box-shadow .2s ease, filter .2s ease;
}

.ags-lc-launcher::before {
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(69, 223, 245, .24);
  border-radius: inherit;
  content: "";
  pointer-events: none;
  transition: inset .2s ease, border-color .2s ease;
}

.ags-lc-launcher::after {
  position: absolute;
  inset-inline-end: calc(100% + 12px);
  top: 50%;
  padding: 8px 12px;
  border: 1px solid rgba(69, 223, 245, .2);
  border-radius: 999px;
  background: rgba(7, 21, 33, .96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  color: #dffaff;
  content: "پشتیبانی آنلاین";
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(5px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  pointer-events: none;
}

.ags-lc-launcher:hover,
.ags-lc-launcher:focus-visible {
  color: #effdff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .52), 0 0 34px rgba(69, 223, 245, .34), 0 0 20px rgba(155, 124, 255, .17);
  transform: translateY(-3px);
}

.ags-lc-launcher:hover::before,
.ags-lc-launcher:focus-visible::before {
  inset: -8px;
  border-color: rgba(69, 223, 245, .48);
}

.ags-lc-launcher:hover::after,
.ags-lc-launcher:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.ags-lc-launcher.position-left {
  right: auto;
  left: 22px;
}

.ags-lc-launcher.position-left::after {
  inset-inline-end: auto;
  inset-inline-start: calc(100% + 12px);
  transform: translateY(-50%) translateX(-5px);
}

.ags-lc-launcher.position-left:hover::after,
.ags-lc-launcher.position-left:focus-visible::after {
  transform: translateY(-50%) translateX(0);
}

.ags-lc-launcher:focus-visible,
.ags-lc-close:focus-visible,
.ags-lc-send:focus-visible,
.ags-lc-submit:focus-visible,
.ags-lc-new:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.ags-lc-launcher svg {
  display: block;
  width: 28px;
  height: 28px;
}

.ags-lc-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  display: none;
  width: 13px;
  height: 13px;
  border: 2px solid #081725;
  border-radius: 50%;
  background: #62f0b1;
  box-shadow: 0 0 12px rgba(98, 240, 177, .55);
}

.ags-lc-panel {
  position: fixed;
  z-index: 999999;
  right: 20px;
  bottom: 156px;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(400px, calc(100vw - 24px));
  height: min(620px, calc(100dvh - 277px - var(--wp-admin--admin-bar--height, 0px)));
  min-height: min(390px, calc(100dvh - 277px - var(--wp-admin--admin-bar--height, 0px)));
  overflow: hidden;
  border: 1px solid rgba(69, 223, 245, .3);
  border-radius: 23px;
  background:
    radial-gradient(ellipse at 100% 0, rgba(69, 223, 245, .1), transparent 44%),
    radial-gradient(ellipse at 0 100%, rgba(155, 124, 255, .07), transparent 38%),
    #081725;
  color: var(--ags-lc-text);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .56), 0 0 30px rgba(69, 223, 245, .08);
  isolation: isolate;
  font: inherit;
}

.ags-lc-panel::before {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 20px;
  left: 20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #45dff5 35%, #9b7cff 72%, transparent);
  content: "";
  pointer-events: none;
}

.ags-lc-panel[hidden] {
  display: none !important;
}

.ags-lc-panel.position-left {
  right: auto;
  left: 20px;
}

.ags-lc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ags-lc-line);
  background:
    radial-gradient(ellipse at 95% 0, rgba(69, 223, 245, .16), transparent 55%),
    linear-gradient(145deg, #0b2031, #091927);
}

.ags-lc-avatar {
  display: grid;
  flex: 0 0 46px;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 15px;
  background: linear-gradient(145deg, #45dff5, #758aff 72%, #9b7cff);
  box-shadow: 0 5px 18px rgba(69, 180, 255, .18);
  color: #061522;
  font-size: 20px;
  font-weight: 900;
}

.ags-lc-headcopy {
  flex: 1;
  min-width: 0;
}

.ags-lc-headcopy strong {
  display: block;
  color: var(--ags-lc-text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.6;
}

.ags-lc-headcopy small {
  display: block;
  margin-top: 2px;
  color: var(--ags-lc-muted);
  font-size: 12px;
  line-height: 1.7;
}

.ags-lc-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ags-lc-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .045);
  color: var(--ags-lc-text);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
}

.ags-lc-close:hover {
  border-color: rgba(69, 223, 245, .4);
  background: rgba(69, 223, 245, .08);
}

.ags-lc-content {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  overflow: hidden;
}

.ags-lc-intro {
  max-height: min(120px, 22dvh);
  overflow: auto;
  padding: 14px 17px 11px;
  color: #bed0db;
  font-size: 14px;
  line-height: 1.9;
}

.ags-lc-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 14px 14px;
}

.ags-lc-status {
  min-height: 25px;
  margin: 0 4px 5px;
  color: var(--ags-lc-muted);
  font-size: 12px;
  line-height: 1.7;
}

.ags-lc-error {
  color: #ffacba;
}

.ags-lc-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.ags-lc-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 5px 4px 4px;
}

.ags-lc-field {
  display: grid;
  gap: 6px;
}

.ags-lc-field label {
  color: var(--ags-lc-text);
  font-size: 14px;
  font-weight: 700;
}

.ags-lc-field input,
.ags-lc-field textarea,
.ags-lc-compose textarea {
  width: 100%;
  border: 1px solid var(--ags-lc-line);
  border-radius: 13px;
  padding: 11px 13px;
  background: rgba(1, 9, 16, .62);
  box-shadow: none;
  color: var(--ags-lc-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.8;
}

.ags-lc-field input {
  min-height: 48px;
}

.ags-lc-field textarea {
  min-height: 112px;
  resize: vertical;
}

.ags-lc-field input::placeholder,
.ags-lc-field textarea::placeholder,
.ags-lc-compose textarea::placeholder {
  color: #9bb0bd;
  opacity: 1;
}

.ags-lc-field input:focus,
.ags-lc-field textarea:focus,
.ags-lc-compose textarea:focus {
  border-color: var(--ags-lc-accent);
  outline: 2px solid var(--ags-lc-accent);
  outline-offset: 2px;
}

.ags-lc-hint {
  margin: 0;
  color: #b2c4cf;
  font-size: 12px;
  line-height: 1.8;
}

.ags-lc-submit,
.ags-lc-new {
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  padding: 11px 16px;
  background: linear-gradient(105deg, #45dff5, #71a4ff 68%, #9b7cff);
  box-shadow: 0 8px 22px rgba(69, 180, 255, .15);
  color: #06131c;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.ags-lc-submit:hover,
.ags-lc-new:hover {
  filter: brightness(1.06);
}

.ags-lc-submit:disabled,
.ags-lc-send:disabled {
  opacity: .58;
  cursor: wait;
}

.ags-lc-trap {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.ags-lc-thread {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 11px;
  min-height: 0;
  overflow: auto;
  padding: 6px 3px 10px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.ags-lc-empty {
  max-width: 270px;
  margin: auto;
  color: var(--ags-lc-muted);
  font-size: 13px;
  line-height: 1.9;
  text-align: center;
}

.ags-lc-message {
  max-width: 90%;
  align-self: flex-start;
  border: 1px solid var(--ags-lc-line);
  border-radius: 16px;
  padding: 11px 13px;
  background: rgba(255, 255, 255, .055);
}

.ags-lc-message.visitor {
  align-self: flex-end;
  border-color: rgba(69, 223, 245, .3);
  border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, rgba(69, 223, 245, .13), rgba(104, 130, 255, .09));
}

.ags-lc-message.staff {
  border-bottom-left-radius: 5px;
}

.ags-lc-message p {
  margin: 0;
  color: var(--ags-lc-text);
  font-size: 14px;
  line-height: 1.9;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ags-lc-message time {
  display: block;
  margin-top: 6px;
  color: #b2c4cf;
  direction: ltr;
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
}

.ags-lc-compose {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  border-top: 1px solid var(--ags-lc-line);
  padding: 11px 2px 0;
}

.ags-lc-compose textarea {
  min-height: 50px;
  max-height: 125px;
  resize: vertical;
}

.ags-lc-send {
  display: grid;
  flex: 0 0 50px;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 15px;
  background: linear-gradient(145deg, #45dff5, #59b9ff);
  box-shadow: 0 6px 18px rgba(69, 223, 245, .18);
  color: #06131c;
  cursor: pointer;
}

.ags-lc-send:hover {
  filter: brightness(1.06);
}

.ags-lc-send svg {
  width: 24px;
  height: 24px;
  transition: transform .18s ease;
}

.ags-lc-send:hover svg {
  transform: translateY(-1px);
}

.ags-lc-closed {
  border: 1px solid var(--ags-lc-line);
  border-radius: 14px;
  padding: 13px;
  background: rgba(255, 255, 255, .04);
  color: #bdcbd5;
  font-size: 13px;
  line-height: 1.9;
}

.ags-lc-new {
  width: 100%;
  margin-top: 10px;
}

.ags-lc-privacy {
  margin: 8px 4px 0;
  color: #b2c4cf;
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

@media (max-width: 640px) {
  .ags-lc-launcher {
    right: 16px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: 60px;
    height: 60px;
  }

  .ags-lc-launcher.position-left {
    right: auto;
    left: 16px;
  }

  .ags-lc-panel,
  .ags-lc-panel.position-left {
    inset: 10px 10px calc(154px + env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    border-radius: 21px;
  }

  .ags-lc-panel.position-left {
    right: 10px;
    left: 10px;
  }

  #ags-live-chat-root.ags-lc-keyboard-open .ags-lc-panel,
  #ags-live-chat-root.ags-lc-keyboard-open .ags-lc-panel.position-left {
    top: calc(var(--ags-lc-visual-top, 0px) + 8px);
    bottom: auto;
    height: calc(var(--ags-lc-visual-height, 100dvh) - 16px);
    max-height: none;
    min-height: 0;
  }

  #ags-live-chat-root.ags-lc-keyboard-open .ags-lc-intro {
    display: none;
  }

  .ags-lc-field input,
  .ags-lc-submit,
  .ags-lc-new,
  .ags-lc-close,
  .ags-lc-send {
    min-height: 48px;
  }
}

@media (hover: none) {
  .ags-lc-launcher::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ags-lc-launcher,
  .ags-lc-launcher::before,
  .ags-lc-launcher::after,
  .ags-lc-thread {
    transition: none;
    scroll-behavior: auto;
  }
}
