#wrag-float-root {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
}

#wrag-float-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99997;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#wrag-float-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

#wrag-float-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

#wrag-float-toggle svg {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  stroke-width: 2.0 !important;
}

#wrag-float-toggle:hover {
  background: #2563eb;
}

#wrag-float-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 120px);
  background: #1a2332;
  color: #e7ecf3;
  border: 1px solid #2d3a4f;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#wrag-float-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.wrag-float-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #243044;
  border-bottom: 1px solid #2d3a4f;
}
.wrag-float-header .title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.wrag-float-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}
.wrag-float-close {
  border: none;
  background: none;
  color: #8b9bb4;
  font-size: 1.4rem;
  cursor: pointer;
}

#wrag-float-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #0f1419;
}
.wrag-float-msg {
  margin-bottom: 12px;
  max-width: 90%;
}
.wrag-float-msg.user {
  margin-left: auto;
  text-align: right;
}
.wrag-float-msg .label {
  font-size: 0.7rem;
  color: #8b9bb4;
  margin-bottom: 4px;
}
.wrag-float-msg .bubble {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}
.wrag-float-msg.user .bubble {
  background: #3b82f6;
  color: #fff;
}
.wrag-float-msg.bot .bubble {
  background: #243044;
  border: 1px solid #2d3a4f;
}
.wrag-float-msg.error .bubble {
  color: #f87171;
}

#wrag-float-feedback {
  display: none;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #2d3a4f;
  font-size: 0.85rem;
}
#wrag-float-feedback button {
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: #fff;
}
#wrag-float-feedback .is-ok { background: #16a34a; }
#wrag-float-feedback .is-no { background: #dc2626; }

.wrag-float-footer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #2d3a4f;
  background: #1a2332;
}
.wrag-float-footer input {
  flex: 1;
  border: 1px solid #2d3a4f;
  border-radius: 8px;
  background: #0f1419;
  color: #e7ecf3;
  padding: 10px 12px;
}
.wrag-float-footer button {
  border: none;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

@media (max-width: 480px) {
  #wrag-float-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 80px;
  }
}

