/* DarkHub Messages — header icon + compact panel */
.dh-msg-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #ff9900;
  background: #141414;
  color: #ff9900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.dh-msg-btn:hover,
.dh-msg-btn.is-open {
  background: #111;
  border-color: #ffb000;
  color: #ffb000;
}
.dh-msg-btn .dh-msg-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff9900;
  color: #111;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  display: none;
}
.dh-msg-btn .dh-msg-badge.show { display: block; }

.dh-help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99985;
  background: rgba(0, 0, 0, 0.45);
}
.dh-help-panel {
  position: fixed;
  z-index: 99990;
  right: 16px;
  top: 72px;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - 90px));
  display: flex;
  flex-direction: column;
  background: #0c0c0c;
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 153, 0, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.75);
  font-family: "Segoe UI", system-ui, sans-serif;
}
.dh-help-panel[hidden],
.dh-help-backdrop[hidden] { display: none !important; }

.dh-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(180deg, #181410, #101010);
  border-bottom: 1px solid #262626;
}
.dh-help-brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.dh-help-brand .mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: #ff9900; color: #111;
  font-weight: 900; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
.dh-help-brand .title {
  color: #fff; font-weight: 800; font-size: 0.95rem; letter-spacing: 0.02em;
}
.dh-help-brand .sub { color: #888; font-size: 0.72rem; margin-top: 1px; }
.dh-help-actions { display: flex; gap: 6px; }
.dh-help-ico {
  background: transparent; border: 1px solid #333; color: #ccc;
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 0.78rem;
}
.dh-help-ico:hover { border-color: #ff9900; color: #ff9900; }

.dh-help-quick {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px 0; flex-shrink: 0;
}
.dh-help-quick button {
  border: 1px solid #2f2f2f; background: #141414; color: #ccc;
  border-radius: 999px; padding: 5px 10px; font-size: 0.72rem; cursor: pointer;
}
.dh-help-quick button:hover { border-color: #ff9900; color: #ff9900; }

.dh-help-msgs {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  background:
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(255,153,0,0.06), transparent 55%),
    #0a0a0a;
}
.dh-help-bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
}
.dh-help-bubble.agent {
  align-self: flex-start;
  background: #171717;
  border: 1px solid #2a2a2a;
  color: #e8e8e8;
  border-bottom-left-radius: 4px;
}
.dh-help-bubble.user {
  align-self: flex-end;
  background: #ff9900;
  color: #111;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}
.dh-help-bubble img {
  max-width: 100%; border-radius: 8px; display: block; margin-top: 4px;
}
.dh-help-typing {
  align-self: flex-start; color: #ff9900; font-size: 0.78rem; opacity: 0.85;
}

.dh-help-foot {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px 12px;
  border-top: 1px solid #222;
  background: #101010;
}
.dh-help-attach span {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #333; color: #ff9900; cursor: pointer; font-size: 1.2rem;
}
.dh-help-foot input[type="text"] {
  flex: 1; min-width: 0;
  background: #161616; border: 1px solid #2c2c2c; color: #eee;
  border-radius: 12px; padding: 10px 12px; font-size: 0.9rem; outline: none;
}
.dh-help-foot input[type="text"]:focus { border-color: #ff9900; }
.dh-help-send {
  width: 40px; height: 40px; border: none; border-radius: 12px;
  background: #ff9900; color: #111; font-weight: 800; cursor: pointer;
}
.dh-help-send:hover { background: #ffb000; }

.dh-help-login {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(8,8,8,0.94);
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; color: #ccc; padding: 24px;
}
.dh-help-login:not([hidden]) {
  display: flex;
}
.dh-help-login[hidden] {
  display: none !important;
}
.dh-help-login a {
  background: #ff9900; color: #111; text-decoration: none;
  padding: 10px 18px; border-radius: 10px; font-weight: 800;
}
.dh-help-login a.ghost {
  background: transparent; border: 1px solid #ff9900; color: #ff9900;
}

body.dh-help-open { overflow: hidden; }

@media (max-width: 520px) {
  .dh-help-panel {
    right: 0; left: 0; top: auto; bottom: 0;
    width: 100%; height: min(78dvh, 620px);
    border-radius: 18px 18px 0 0;
  }
}
