/* Floating live-support chat — loaded as external CSS (CSP-safe). */

#_csc_root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2147483647;
  display: block;
}

#_csc_btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #34d399, #059669);
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(5, 150, 105, 0.5), 0 3px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

#_csc_btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 32px rgba(5, 150, 105, 0.6), 0 3px 8px rgba(0, 0, 0, 0.4);
}

#_csc_btn svg {
  display: block;
  pointer-events: none;
}

#_csc_badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: system-ui, sans-serif;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid #080a0d;
  line-height: 1;
}

#_csc_badge.is-visible {
  display: grid;
}

#_csc_panel {
  display: none;
  position: fixed;
  bottom: 96px;
  right: 20px;
  width: min(390px, calc(100vw - 28px));
  height: min(540px, calc(100dvh - 120px));
  background: #12161c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 2147483600;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #f3f5f7;
}

#_csc_panel.open {
  display: flex;
  animation: _csc_in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes _csc_in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#_csc_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(110, 231, 183, 0.1), transparent);
}

#_csc_head h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

#_csc_head p {
  margin: 3px 0 0;
  font-size: 0.76rem;
  color: #9aa3af;
}

#_csc_close {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: #9aa3af;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

#_csc_close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f3f5f7;
}

#_csc_msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.csc_empty {
  margin: auto;
  text-align: center;
  color: #9aa3af;
  font-size: 0.88rem;
  line-height: 1.55;
  padding: 16px;
}

.csc_m {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 0.9rem;
  word-break: break-word;
  white-space: pre-wrap;
}

.csc_m.u {
  align-self: flex-end;
  background: rgba(110, 231, 183, 0.15);
  border: 1px solid rgba(110, 231, 183, 0.28);
}

.csc_m.o {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.csc_mt {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  color: #6b7a8d;
}

#_csc_typing {
  min-height: 18px;
  font-size: 0.78rem;
  color: #9aa3af;
  font-style: italic;
  padding: 0 14px 6px;
}

#_csc_foot {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 12px 12px;
  flex-shrink: 0;
}

#_csc_foot.is-hidden {
  display: none;
}

#_csc_status {
  min-height: 15px;
  font-size: 0.75rem;
  color: #fca5a5;
  margin-bottom: 6px;
}

#_csc_compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#_csc_input {
  flex: 1;
  min-height: 44px;
  max-height: 110px;
  resize: none;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0e1116;
  color: #f3f5f7;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
}

#_csc_send {
  height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid rgba(110, 231, 183, 0.35);
  cursor: pointer;
  background: rgba(110, 231, 183, 0.18);
  color: #6ee7b7;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background 0.14s;
}

#_csc_send:hover {
  background: rgba(110, 231, 183, 0.3);
}

#_csc_send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#_csc_gate {
  padding: 28px 20px;
  text-align: center;
  color: #9aa3af;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: auto;
}

#_csc_gate a {
  color: #6ee7b7;
  font-weight: 700;
}
