/* Comuncyber chat widget */
.cy-chat-root {
  --cy-chat-bg: #0f1011;
  --cy-chat-panel: #141516;
  --cy-chat-border: rgba(255, 255, 255, 0.1);
  --cy-chat-text: #f7f8f8;
  --cy-chat-muted: #8a8f98;
  --cy-chat-accent: #7170ff;
  --cy-chat-accent-2: #22d3ee;
  --cy-chat-user: rgba(113, 112, 255, 0.22);
  --cy-chat-bot: rgba(255, 255, 255, 0.04);
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  font-family: var(--font, Inter, system-ui, sans-serif);
  color: var(--cy-chat-text);
}

.cy-chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0.7rem 1rem 0.7rem 0.85rem;
  border: 1px solid rgba(113, 112, 255, 0.45);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(113, 112, 255, 0.95), rgba(99, 102, 241, 0.9));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.cy-chat-fab:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cy-chat-fab:focus-visible { outline: 2px solid var(--cy-chat-accent-2); outline-offset: 3px; }

.cy-chat-fab-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.85rem;
}

.cy-chat-panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 1.5rem));
  height: min(560px, calc(100vh - 5.5rem));
  border: 1px solid var(--cy-chat-border);
  border-radius: 18px;
  background: var(--cy-chat-panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.cy-chat-root.is-open .cy-chat-panel { display: flex; }
.cy-chat-root.is-open .cy-chat-fab { display: none; }

.cy-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--cy-chat-border);
  background:
    radial-gradient(circle at 0% 0%, rgba(113, 112, 255, 0.18), transparent 55%),
    rgba(8, 9, 10, 0.9);
}

.cy-chat-header strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.cy-chat-header span {
  display: block;
  color: var(--cy-chat-muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.cy-chat-header-actions {
  display: flex;
  gap: 0.35rem;
}

.cy-chat-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--cy-chat-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--cy-chat-text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.cy-chat-icon-btn:hover { background: rgba(255, 255, 255, 0.07); }

.cy-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--cy-chat-bg);
  -webkit-overflow-scrolling: touch;
}

.cy-chat-bubble {
  max-width: 88%;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  border: 1px solid transparent;
}

.cy-chat-bubble.bot {
  align-self: flex-start;
  background: var(--cy-chat-bot);
  border-color: var(--cy-chat-border);
  color: var(--cy-chat-text);
  border-bottom-left-radius: 5px;
}

.cy-chat-bubble.user {
  align-self: flex-end;
  background: var(--cy-chat-user);
  border-color: rgba(113, 112, 255, 0.35);
  border-bottom-right-radius: 5px;
}

.cy-chat-bubble .meta {
  display: block;
  margin-top: 0.35rem;
  color: var(--cy-chat-muted);
  font-size: 0.72rem;
}

.cy-chat-status {
  padding: 0.35rem 0.9rem 0;
  color: var(--cy-chat-muted);
  font-size: 0.78rem;
  min-height: 1.2rem;
}

.cy-chat-status.is-error { color: #fca5a5; }
.cy-chat-status.is-ok { color: #6ee7b7; }

.cy-chat-compose {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid var(--cy-chat-border);
  background: rgba(8, 9, 10, 0.92);
}

.cy-chat-compose input[type="text"],
.cy-chat-compose textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--cy-chat-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--cy-chat-text);
  font: inherit;
  padding: 0.65rem 0.75rem;
}

.cy-chat-compose textarea {
  min-height: 72px;
  max-height: 140px;
  resize: vertical;
}

.cy-chat-compose input:focus-visible,
.cy-chat-compose textarea:focus-visible {
  outline: 2px solid var(--cy-chat-accent-2);
  outline-offset: 1px;
}

.cy-chat-row {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}

.cy-chat-send {
  flex: 0 0 auto;
  min-width: 96px;
  border: 0;
  border-radius: 10px;
  background: var(--cy-chat-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.9rem;
}

.cy-chat-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cy-chat-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
  color: #a5f3fc;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.cy-chat-tg:hover { background: rgba(34, 211, 238, 0.14); }

@media (max-width: 480px) {
  .cy-chat-root {
    right: 0.65rem;
    bottom: 0.65rem;
  }
  .cy-chat-panel {
    width: min(100vw - 1.2rem, 420px);
    height: min(70vh, 560px);
  }
  .cy-chat-fab-label { display: none; }
  .cy-chat-fab {
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
  }
}
