.glc-root {
  position: fixed;
  z-index: 9999;
  right: max(20px, calc(((100vw - 1210px) / 2) - 50px));
  bottom: 20px;
  width: min(460px, calc(100vw - 32px));
  color: #122033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.glc-root .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.glc-panel,
.glc-launcher {
  border: 1px solid #b8dced;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(18, 32, 51, 0.16);
}

.glc-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: min(780px, calc(100vh - 80px));
  min-height: 560px;
  border-radius: 14px;
  overflow: hidden;
  transform: translateY(0);
  opacity: 1;
  transition: transform 240ms ease, opacity 240ms ease;
}

.glc-root.is-minimized .glc-panel {
  pointer-events: none;
  transform: translateY(16px);
  opacity: 0;
}

.glc-launcher {
  width: 100%;
  display: none;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 13px 15px;
  color: #122033;
  text-align: left;
}

.glc-root.is-minimized .glc-launcher {
  display: flex;
}

.glc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #d8edf6;
  background: linear-gradient(180deg, #f8fcff, #ffffff);
}

.glc-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #b8dced;
  border-radius: 50%;
  background: #e9f8fb;
  color: #097f96;
  font-weight: 800;
  overflow: hidden;
}

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

.glc-title {
  min-width: 0;
  flex: 1 1 auto;
}

.glc-title strong,
.glc-launcher strong {
  display: block;
  overflow: hidden;
  color: #122033;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.glc-title span,
.glc-launcher span,
.glc-status {
  color: #53667c;
  font-size: 0.82rem;
}

.glc-icon-button,
.glc-send,
.glc-launcher {
  cursor: pointer;
}

.glc-icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #53667c;
}

.glc-icon-button:hover,
.glc-icon-button:focus-visible {
  background: #e9f8fb;
  color: #097f96;
}

.glc-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.glc-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  background: #ffffff;
}

.glc-message {
  max-width: 84%;
  padding: 10px 12px;
  border: 1px solid #d8edf6;
  border-radius: 12px;
  background: #f5fbfe;
  color: #122033;
  font-size: 0.94rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.glc-message.visitor {
  align-self: flex-end;
  border-color: #a8dfe8;
  background: #e8f9fb;
}

.glc-message.support,
.glc-message.system {
  align-self: flex-start;
}

.glc-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-top: 1px solid #d8edf6;
}

.glc-input {
  width: 100%;
  height: 56px;
  min-height: 52px;
  max-height: 112px;
  resize: vertical;
  border: 1px solid #bdd6e4;
  border-radius: 10px;
  padding: 8px 10px;
  color: #122033;
  font: inherit;
  line-height: 1.35;
}

.glc-send {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  min-height: 52px;
  padding: 0 16px;
  background: #08a6bd;
  color: #ffffff;
  font-weight: 800;
}

.glc-send:disabled,
.glc-input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.glc-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px 12px;
}

.glc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #08a6bd;
}

.glc-error {
  color: #8a1f1f;
}

.glc-root.is-hidden {
  display: none;
}

@media (max-width: 1180px) {
  .glc-root {
    right: 16px;
  }
}

@media (min-width: 781px) and (max-width: 1180px) {
  .glc-root {
    bottom: 16px;
    width: calc(100vw - 32px);
  }

  .glc-panel {
    height: min(40vh, 420px);
    min-height: 320px;
  }
}

@media (min-width: 1600px) {
  .glc-root {
    right: max(32px, calc(((100vw - 1210px) / 2) - 70px));
    width: min(480px, calc(100vw - 64px));
  }
}

@media (max-width: 780px) {
  .glc-root {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .glc-panel {
    height: min(82vh, 680px);
    min-height: 420px;
    border-radius: 14px 14px 10px 10px;
  }

  .glc-composer {
    grid-template-columns: 1fr;
  }

  .glc-send {
    justify-content: center;
    min-height: 44px;
  }
}
