.yl-live-support {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2100;
  font-family: "Segoe UI", Arial, sans-serif;
}

.yl-live-support__fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.yl-live-support__fab-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  user-select: none;
  text-align: right;
}

.yl-live-support__fab-label {
  color: #2563a5;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.yl-live-support__fab-sub {
  color: #2f5f93;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.yl-live-support__toggle {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444 0%, #c4122f 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(204, 39, 66, .42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  position: relative;
  animation: yl-live-fab-breathe 2.15s ease-in-out infinite;
}

.yl-live-support__toggle:hover,
.yl-live-support__toggle:focus {
  transform: translateY(-1px);
}

.yl-live-support--online .yl-live-support__toggle {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  box-shadow: 0 14px 34px rgba(22, 163, 74, .42);
}

.yl-live-support--online .yl-live-support__fab-label {
  color: #177a45;
}

.yl-live-support--online .yl-live-support__fab-sub {
  color: #16703f;
}

.yl-live-support--offline .yl-live-support__toggle {
  background: linear-gradient(135deg, #ef4444 0%, #c4122f 100%);
  box-shadow: 0 14px 34px rgba(204, 39, 66, .42);
}

.yl-live-support--offline .yl-live-support__fab-label {
  color: #b42335;
}

.yl-live-support--offline .yl-live-support__fab-sub {
  color: #8f2533;
}

@keyframes yl-live-fab-breathe {
  0% {
    transform: scale(1);
    filter: saturate(100%);
  }
  50% {
    transform: scale(1.055);
    filter: saturate(113%);
  }
  100% {
    transform: scale(1);
    filter: saturate(100%);
  }
}

.yl-live-support__panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(380px, calc(100vw - 24px));
  height: min(610px, calc(100vh - 110px));
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(14, 30, 68, .24);
  display: none;
  overflow: hidden;
}

.yl-live-support.is-open .yl-live-support__panel {
  display: flex;
  flex-direction: column;
}

.yl-live-support__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #203a74 0%, #2d4f95 100%);
  color: #fff;
}

.yl-live-support__header-main {
  min-width: 0;
  flex: 1 1 auto;
}

.yl-live-support__header-logo-wrap {
  flex: 0 1 160px;
  max-width: 160px;
  min-width: 96px;
  height: 42px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, .85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
}

.yl-live-support__header-logo {
  width: 100%;
  max-width: 132px;
  height: auto;
  max-height: 30px;
  object-fit: contain;
  display: block;
}

.yl-live-support__title {
  display: block;
  font-size: .97rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yl-live-support__status {
  display: block;
  opacity: .88;
  font-size: .78rem;
}

.yl-live-support__close {
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.yl-live-support__end-session {
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
}

.yl-live-support__end-session:hover,
.yl-live-support__end-session:focus,
.yl-live-support__close:hover,
.yl-live-support__close:focus {
  background: rgba(255, 255, 255, .28);
}

.yl-live-support__end-session:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.yl-live-support__messages {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px;
  background: #f6f8fc;
  display: grid;
  align-content: start;
  gap: 10px;
}

.yl-live-support__quick {
  padding: 8px 12px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid #c8d3e6;
  background: #e7edf7;
}

.yl-live-support__quick button {
  border: 1px solid #c6d4ec;
  background: #f6faff;
  color: #21426f;
  border-radius: 999px;
  font-size: .76rem;
  padding: 4px 10px;
}

.yl-live-support__composer {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e6ebf4;
  background: #fff;
}

.yl-live-support__composer textarea {
  resize: none;
  border: 1px solid #cdd6e5;
  border-radius: 10px;
  min-height: 42px;
  max-height: 120px;
  padding: 9px 10px;
  line-height: 1.4;
}

.yl-live-support__composer button {
  border: 0;
  border-radius: 11px;
  background: #14a44d;
  color: #fff;
  font-size: 1.1rem;
}

.yl-live-support__composer--disabled {
  opacity: .72;
}

.yl-live-support__quick.is-disabled {
  opacity: .7;
}

.yl-live-support__offline {
  border-top: 1px solid #e7ecf4;
  background: #f9fbff;
  padding: 10px 12px;
}

.yl-live-support__offline-title {
  font-size: .78rem;
  color: #324968;
  margin-bottom: 8px;
}

.yl-live-support__field-row {
  margin-bottom: 6px;
}

.yl-live-support__field-row:last-child {
  margin-bottom: 0;
}

.yl-live-support__error {
  min-height: 18px;
  padding: 0 12px 8px;
  color: #c32020;
  font-size: .76rem;
}

.yl-live-support__msg {
  max-width: 88%;
  border-radius: 12px;
  border: 1px solid #dde5f2;
  background: #fff;
  padding: 7px 9px;
  justify-self: start;
}

.yl-live-support__msg--visitor {
  justify-self: end;
  border-color: #b2d4be;
  background: #eefdf3;
}

.yl-live-support__msg--agent {
  border-color: #b8d1ff;
  background: #edf4ff;
}

.yl-live-support__msg--bot {
  border-color: #d7deea;
  background: #ffffff;
}

.yl-live-support__msg--bot .yl-live-support__msg-text {
  font-weight: 700;
}

.yl-live-support__msg--bot-warning {
  max-width: 100%;
  border-color: #bf1c2d;
  background: #d7263d;
}

.yl-live-support__msg--bot-warning .yl-live-support__msg-head,
.yl-live-support__msg--bot-warning .yl-live-support__msg-text,
.yl-live-support__msg--bot-warning .yl-live-support__msg-link {
  color: #ffffff;
}

.yl-live-support__msg--bot-warning .yl-live-support__msg-link {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.9);
}

.yl-live-support__msg--easter {
  max-width: 100%;
  border-color: #0e8a4a;
  background: #17a34a;
}

.yl-live-support__msg--easter .yl-live-support__msg-head,
.yl-live-support__msg--easter .yl-live-support__msg-text,
.yl-live-support__msg--easter .yl-live-support__msg-link {
  color: #ffffff;
}

.yl-live-support__msg--easter .yl-live-support__msg-link {
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.9);
}

.yl-live-support__msg--system {
  border-color: #8fd2aa;
  background: #eafaf1;
}

.yl-live-support__msg--system .yl-live-support__msg-text {
  color: #137a43;
  font-weight: 700;
}

.yl-live-support__msg--moderation-final {
  max-width: 100%;
  border-color: #bf1c2d;
  background: #ffecee;
}

.yl-live-support__msg--moderation-final .yl-live-support__msg-head,
.yl-live-support__msg--moderation-final .yl-live-support__msg-text,
.yl-live-support__msg--moderation-final .yl-live-support__msg-link {
  color: #b00020;
  font-weight: 800;
}

.yl-live-support__msg-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
  font-size: .72rem;
  color: #6b7485;
}

.yl-live-support__msg-text {
  font-size: .85rem;
  color: #162031;
  white-space: pre-wrap;
  word-break: break-word;
}

.yl-live-support__msg-text--streaming::after {
  content: "▋";
  display: inline-block;
  margin-left: 1px;
  opacity: .9;
  animation: yl-live-stream-caret .72s steps(1, end) infinite;
}

.yl-live-support__system {
  font-size: .78rem;
  color: #6f7786;
  text-align: center;
}

.yl-live-support__typing {
  max-width: 86%;
  justify-self: start;
  border: 1px dashed #ef9aa8;
  background: #fff1f3;
  color: #c1122f;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .01em;
  animation: yl-live-typing-pulse 1s ease-in-out infinite;
}

@keyframes yl-live-typing-pulse {
  0%, 100% {
    opacity: .45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes yl-live-stream-caret {
  0%, 48% {
    opacity: .2;
  }
  50%, 100% {
    opacity: 1;
  }
}

.yl-live-support__confirm {
  position: absolute;
  inset: 0;
  z-index: 9;
  background: rgba(10, 18, 33, .48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.yl-live-support__confirm-dialog {
  width: min(320px, calc(100% - 8px));
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d8e0ef;
  box-shadow: 0 16px 32px rgba(9, 18, 36, .25);
  padding: 14px 14px 12px;
}

.yl-live-support__confirm-title {
  display: block;
  font-size: .95rem;
  color: #17253e;
  margin-bottom: 6px;
}

.yl-live-support__confirm-text {
  margin: 0;
  font-size: .82rem;
  color: #44506a;
}

.yl-live-support__confirm-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 575.98px) {
  .yl-live-support {
    right: 10px;
    bottom: 10px;
  }

  .yl-live-support__fab {
    gap: 8px;
  }

  .yl-live-support__fab-label {
    font-size: .95rem;
  }

  .yl-live-support__fab-sub {
    font-size: .68rem;
  }

  .yl-live-support__panel {
    width: calc(100vw - 14px);
    height: min(78vh, 620px);
    bottom: 66px;
  }

  .yl-live-support__header-logo-wrap {
    max-width: 132px;
    min-width: 88px;
    height: 38px;
    padding: 3px 10px;
  }

  .yl-live-support__header-logo {
    max-width: 108px;
    max-height: 26px;
  }

  .yl-live-support__toggle {
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 767.98px) {
  .yl-live-support__fab-text {
    display: none;
  }

  .yl-live-support__fab {
    gap: 0;
  }
}
