.hrx-chat-bubble {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 160;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  padding: 12px 17px;
  background: #0b7a8e;
  color: #fff;
  font: 700 14px/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 12px 30px rgba(11, 122, 142, 0.32);
  cursor: pointer;
}
.hrx-chat-bubble:hover { transform: translateY(-2px); background: #075f70; }
.hrx-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 142px;
  z-index: 170;
  width: min(390px, calc(100vw - 28px));
  height: min(610px, calc(100vh - 175px));
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid #d9e5e8;
  border-radius: 18px;
  background: #f4f8f9;
  box-shadow: 0 26px 75px rgba(5, 30, 40, 0.28);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.hrx-chat-panel.open { display: grid; }
.hrx-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 15px;
  color: #fff;
  background: #102a33;
}
.hrx-chat-head strong { display: block; font-size: 14px; }
.hrx-chat-head small { display: block; margin-top: 2px; color: #a7c6cd; font-size: 11px; }
.hrx-chat-head small.warn { color: #fbbf24; }
.hrx-chat-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}
.hrx-chat-messages {
  overflow: auto;
  padding: 14px;
}
.hrx-chat-msg { display: flex; margin-bottom: 11px; }
.hrx-chat-msg.visitor { justify-content: flex-end; }
.hrx-chat-msg.ai, .hrx-chat-msg.agent { justify-content: flex-start; }
.hrx-chat-msg .hrx-chat-bubble-text {
  max-width: 84%;
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  color: #17262f;
  box-shadow: 0 2px 8px rgba(15, 50, 62, .05);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.hrx-chat-msg.visitor .hrx-chat-bubble-text {
  color: #fff;
  background: #0b7a8e;
  border-bottom-right-radius: 5px;
}
.hrx-chat-msg.ai .hrx-chat-bubble-text, .hrx-chat-msg.agent .hrx-chat-bubble-text {
  border-bottom-left-radius: 5px;
}
.hrx-chat-msg.agent .hrx-chat-bubble-text { border: 1px solid #b7dfe3; background: #f0fbfc; }
.hrx-chat-sender {
  margin-bottom: 4px;
  color: #657680;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.hrx-chat-sources { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.hrx-chat-sources a {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e6f5f6;
  color: #075766;
  font-size: 10px;
  text-decoration: none;
}
.hrx-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}
.hrx-chat-suggestions button {
  border: 1px solid #cfe0e4;
  border-radius: 999px;
  padding: 6px 9px;
  background: #fff;
  color: #36515b;
  font-size: 11px;
  cursor: pointer;
}
.hrx-chat-thinking {
  padding: 0 14px 8px;
  color: #607680;
  font-size: 11px;
  display: none;
}
.hrx-chat-thinking.show { display: block; }
.hrx-chat-agent-typing {
  display: none;
  width: fit-content;
  margin: 0 14px 9px;
  padding: 7px 10px;
  border-radius: 12px;
  color: #45606a;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 50, 62, .05);
  font-size: 11px;
}
.hrx-chat-agent-typing.show { display: block; }
.hrx-chat-agent-typing .dots {
  display: inline-block;
  margin-left: 3px;
  color: #0b7a8e;
  letter-spacing: 2px;
}
.hrx-chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 11px 12px;
  border-top: 1px solid #dce7ea;
  background: #fff;
}
.hrx-chat-compose textarea {
  width: 100%;
  min-height: 42px;
  max-height: 105px;
  resize: none;
  border: 1px solid #b9ccd2;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  color: #17262f;
}
.hrx-chat-compose textarea:focus { outline: 2px solid rgba(11, 122, 142, .2); border-color: #0b7a8e; }
.hrx-chat-send {
  align-self: end;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: #0b7a8e;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.hrx-chat-send:disabled { opacity: .5; cursor: wait; }
.hrx-chat-actions {
  display: flex;
  gap: 7px;
  padding: 0 12px 11px;
  background: #fff;
}
.hrx-chat-actions button {
  flex: 1;
  border: 1px solid #cfe0e4;
  border-radius: 9px;
  padding: 8px;
  background: #f7fafb;
  color: #28444e;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.hrx-chat-actions button.accent { color: #fff; border-color: #0b7a8e; background: #0b7a8e; }
.hrx-chat-actions button:disabled { opacity: .55; cursor: default; }
@media (max-width: 680px) {
  .hrx-chat-bubble { right: 16px; bottom: 78px; padding: 11px 13px; }
  .hrx-chat-bubble .label { display: none; }
  .hrx-chat-panel {
    right: 10px;
    bottom: 128px;
    width: calc(100vw - 20px);
    height: min(650px, calc(100vh - 145px));
  }
}
