:root {
  --hpg-chat-bg: #080b0a;
  --hpg-chat-panel: #101512;
  --hpg-chat-line: rgba(255, 122, 24, 0.58);
  --hpg-chat-green: #6dff9a;
  --hpg-chat-text: #edf7ef;
  --hpg-chat-muted: #9db5a6;
}

#hpg-assistant-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--hpg-chat-text);
}

.hpg-assistant-toggle {
  border: 1px solid var(--hpg-chat-line);
  background: linear-gradient(135deg, #111711 0%, #060806 100%);
  color: var(--hpg-chat-text);
  border-radius: 999px;
  padding: 11px 15px;
  box-shadow: 0 12px 35px rgba(0,0,0,.46), inset 0 0 0 1px rgba(109,255,154,.08);
  cursor: pointer;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-size: 13px;
}

.hpg-assistant-toggle::before {
  content: "●";
  color: var(--hpg-chat-green);
  margin-right: 8px;
}

.hpg-assistant-panel {
  width: min(390px, calc(100vw - 28px));
  height: min(575px, calc(100vh - 90px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hpg-chat-line);
  border-radius: 16px;
  background: rgba(8, 11, 10, .97);
  box-shadow: 0 18px 50px rgba(0,0,0,.58);
}

#hpg-assistant-root.hpg-open .hpg-assistant-panel { display: flex; }
#hpg-assistant-root.hpg-open .hpg-assistant-toggle { display: none; }

.hpg-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,122,24,.35);
  background: #0d120f;
}

.hpg-assistant-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hpg-assistant-subtitle {
  color: var(--hpg-chat-muted);
  font-size: 11px;
  margin-top: 2px;
}

.hpg-assistant-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hpg-assistant-iconbtn {
  border: 1px solid rgba(255,122,24,.42);
  background: #121913;
  color: var(--hpg-chat-text);
  border-radius: 9px;
  padding: 7px 9px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.hpg-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hpg-msg {
  max-width: 88%;
  padding: 10px 11px;
  border-radius: 12px;
  line-height: 1.45;
  font-size: 13px;
  white-space: pre-wrap;
}

.hpg-msg-bot {
  align-self: flex-start;
  border: 1px solid rgba(109,255,154,.23);
  background: #101812;
}

.hpg-msg-bot a {
  color: var(--hpg-chat-green);
  text-decoration: underline;
  text-decoration-color: rgba(109,255,154,.4);
  text-underline-offset: 2px;
}

.hpg-msg-bot a:hover {
  text-decoration-color: var(--hpg-chat-green);
}

.hpg-msg-user {
  align-self: flex-end;
  border: 1px solid rgba(255,122,24,.35);
  background: #21150c;
}

.hpg-msg-system {
  align-self: center;
  color: var(--hpg-chat-muted);
  border: 1px dashed rgba(255,122,24,.25);
  background: transparent;
  font-size: 12px;
}

.hpg-assistant-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255,122,24,.35);
  background: #0d120f;
}

.hpg-assistant-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(109,255,154,.24);
  background: #050706;
  color: var(--hpg-chat-text);
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  font-size: 13px;
}

.hpg-assistant-send {
  border: 1px solid var(--hpg-chat-line);
  background: #ff7a18;
  color: #160b02;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}

.hpg-assistant-footnote {
  color: var(--hpg-chat-muted);
  font-size: 10px;
  padding: 0 12px 10px;
  background: #0d120f;
}

@media (max-width: 520px) {
  #hpg-assistant-root { right: 10px; bottom: 10px; }
  .hpg-assistant-panel { width: calc(100vw - 20px); height: min(590px, calc(100vh - 24px)); }
}
