.local-aichatbot {
  position: fixed;
  right: 80px;
  bottom: 10px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.local-aichatbot__launcher {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .22);
}

.local-aichatbot__launcher-icon--close {
  display: none;
}

.local-aichatbot__launcher.is-open .local-aichatbot__launcher-icon--chat {
  display: none;
}

.local-aichatbot__launcher.is-open .local-aichatbot__launcher-icon--close {
  display: inline-flex;
}

.local-aichatbot__launcher-icon {
  font-size: 24px;
  width: 24px;
  height: 24px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.local-aichatbot__panel {
  width: min(400px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 130px));
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(213, 221, 234, .9);
  box-shadow: 0 24px 48px rgba(29, 33, 37, .22);
  position: absolute;
  right: calc(100% + 16px);
  bottom: 0;
  display: flex;
  flex-direction: column;
}

.local-aichatbot__panel[hidden] {
  display: none !important;
}

.local-aichatbot__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 30px;
}

.local-aichatbot__messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.local-aichatbot__msg {
  margin: .4rem 0;
  display: flex;
}

.local-aichatbot__bubble {
  max-width: 88%;
  border-radius: 16px;
  padding: .65rem .85rem;
  font-size: .95rem;
  line-height: 1.35rem;
  white-space: pre-wrap;
}

.local-aichatbot__msg.user {
  justify-content: flex-end;
}

.local-aichatbot__msg.user .local-aichatbot__bubble {
  background: rgba(13, 110, 253, .12);
}

.local-aichatbot__msg.assistant {
  justify-content: flex-start;
}

.local-aichatbot__msg.assistant .local-aichatbot__bubble {
  background: rgba(33, 37, 41, .06);
}

.local-aichatbot__sources {
  margin-top: .45rem;
  font-size: .85rem;
}

.local-aichatbot__feedback {
  margin-top: .6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .78rem;
}

.local-aichatbot__feedback-buttons {
  display: flex;
  gap: .35rem;
}

.local-aichatbot__feedback-note {
  color: rgba(33, 37, 41, .72);
}

.local-aichatbot__debug {
  margin-top: .45rem;
  font-size: .8rem;
  color: rgba(33, 37, 41, .72);
}

.local-aichatbot__debug-details {
  margin-top: .3rem;
  font-size: .78rem;
  color: rgba(33, 37, 41, .78);
  display: grid;
  gap: .15rem;
}

.local-aichatbot__retrieval-debug {
  margin-top: .55rem;
  font-size: .8rem;
  border-top: 1px solid rgba(33, 37, 41, .12);
  padding-top: .45rem;
}

.local-aichatbot__retrieval-debug summary {
  cursor: pointer;
  color: rgba(33, 37, 41, .82);
  font-weight: 600;
}

.local-aichatbot__retrieval-debug-content {
  margin-top: .45rem;
  display: grid;
  gap: .25rem;
}

.local-aichatbot__retrieval-candidates {
  margin-top: .25rem;
}

.local-aichatbot__retrieval-candidate {
  margin-top: .2rem;
}

.local-aichatbot__retrieval-score {
  display: inline-block;
  min-width: 72px;
  color: rgba(33, 37, 41, .72);
}

.local-aichatbot__sources a {
  text-decoration: none;
}

.local-aichatbot__quick {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .4rem;
}

.local-aichatbot__links {
  display: flex;
  gap: .75rem;
  margin-top: .55rem;
  margin-bottom: .2rem;
  align-items: center;
  flex-wrap: wrap;
}

.local-aichatbot__composer {
  flex: 0 0 auto;
  margin-top: 12px;
}

.local-aichatbot__hint {
  flex: 0 0 auto;
  margin-bottom: 30px;
}

.local-aichatbot__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
}

.local-aichatbot__close {
  cursor: pointer;
}

.local-aichatbot__disclaimer {
  border-radius: 12px;
}

.local-aichatbot-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.local-aichatbot-admin-card {
  border: 1px solid rgba(213, 221, 234, .9);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  background: #fff;
  box-shadow: 0 12px 30px rgba(29, 33, 37, .08);
}

.local-aichatbot-admin-card__label {
  font-size: .86rem;
  color: rgba(33, 37, 41, .72);
}

.local-aichatbot-admin-card__value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: .25rem;
  line-height: 1.1;
}

.local-aichatbot-health-list {
  display: grid;
  gap: 1rem;
}

.local-aichatbot-health-item {
  border: 1px solid rgba(213, 221, 234, .9);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  background: #fff;
  box-shadow: 0 12px 30px rgba(29, 33, 37, .08);
}

.local-aichatbot-health-item__title {
  font-weight: 600;
}

.local-aichatbot-health-item__detail {
  margin-top: .45rem;
  color: rgba(33, 37, 41, .78);
}

.local-aichatbot-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .76rem;
  font-weight: 600;
}

.local-aichatbot-status--pass {
  background: rgba(34, 197, 94, .14);
  color: #15803d;
}

.local-aichatbot-status--warn {
  background: rgba(245, 158, 11, .14);
  color: #b45309;
}

.local-aichatbot-status--fail {
  background: rgba(220, 53, 69, .12);
  color: #b91c1c;
}

@media (max-width: 767px) {
  .local-aichatbot {
    right: 16px;
    bottom: 16px;
    gap: 12px;
  }

  .local-aichatbot__launcher {
    width: 52px;
    height: 52px;
  }

  .local-aichatbot__panel {
    position: fixed;
    width: 100%;
    left: 12px;
    right: 12px;
    height: min(70vh, 520px);
    bottom: 84px;
  }
}
