.grc-root {
  position: fixed;
  z-index: 999999;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

.grc-pos-br { right: 18px; }
.grc-pos-bl { left: 18px; }

.grc-launcher {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: var(--grc-primary, #1877F2);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.25), 0 0 0 3px rgba(255,255,255,.9);
  display: grid;
  place-items: center;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

.grc-launcher:hover {
  background: #2563EB;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,.3), 0 0 0 3px rgba(255,255,255,1);
}

.grc-launcher__icon {
  display: grid;
  place-items: center;
}

.grc-launcher__icon svg {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}

.grc-launcher__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9);
  opacity: 0;
}

.grc-panel {
  position: absolute;
  bottom: 76px;
  width: var(--grc-w, 360px);
  height: var(--grc-h, 520px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  overflow: hidden;
  display: none;
}

.grc-pos-br .grc-panel { right: 0; }
.grc-pos-bl .grc-panel { left: 0; }

.grc-root.grc-open .grc-panel { display: flex; flex-direction: column; }

.grc-header {
  padding: 12px 12px;
  background: var(--grc-primary, #1877F2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grc-header__title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .2px;
}

.grc-close {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.92);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

.grc-log {
  flex: 1;
  padding: 12px;
  overflow: auto;
  background: #f5f6f7;
}

.grc-row {
  display: flex;
  margin: 8px 0;
}
.grc-row.is-user { justify-content: flex-end; }
.grc-row.is-bot { justify-content: flex-start; }

.grc-bubble {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.grc-row.is-bot .grc-bubble {
  background: #fff;
  color: #0f1419;
  border: 1px solid rgba(0,0,0,.06);
  border-bottom-left-radius: 6px;
}

.grc-row.is-user .grc-bubble {
  background: var(--grc-primary, #1877F2);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.grc-compose {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(0,0,0,.06);
  background: #fff;
}

.grc-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 999px;
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
}

.grc-input:focus {
  border-color: color-mix(in srgb, var(--grc-primary, #1877F2) 60%, #ffffff);
  box-shadow: 0 0 0 3px rgba(24,119,242,.14);
}

.grc-send {
  border: 0;
  background: var(--grc-primary, #1877F2);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
}

.grc-send:disabled,
.grc-input:disabled {
  opacity: .6;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  .grc-root {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .grc-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 88px;
    width: auto;
    height: var(--grc-mobile-h, min(80vh, 640px));
  }
  .grc-pos-bl .grc-panel,
  .grc-pos-br .grc-panel { left: 12px; right: 12px; }
}

