/* Live chat: tab vertikal kanan tengah + panel melayang */
.hb-chat-tab {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 9998; padding: 14px 0; width: 28px; min-height: 118px; display: block; text-align: center;
  border: 1px solid var(--line); border-right: 0; border-radius: 14px 0 0 14px;
  background: #2563eb; color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .14em; cursor: pointer; box-shadow: 0 10px 24px rgba(37, 99, 235, .35);
}
.hb-chat-tab span { display: inline-block; writing-mode: vertical-rl; white-space: nowrap; }
.hb-chat-tab svg { display: block; width: 15px; height: 15px; margin: 0 auto 8px; }
.hb-chat-tab.geser { right: 374px; }

.hb-chat-panel {
  position: fixed; top: 50%; bottom: auto; right: 14px; transform: translateY(-50%);
  width: 360px; max-width: calc(100vw - 24px); height: min(560px, 70vh); z-index: 9999;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: var(--card);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}

.hbc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.hbc-titles { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.hbc-titles strong { font-weight: 700; }
.hbc-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.hbc-on { font-size: 11px; color: var(--muted); }
.hbc-acts { display: flex; gap: 6px; }
.hbc-ic {
  width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); cursor: pointer; font-size: 13px; line-height: 1;
}
.hbc-close { font-size: 17px; background: var(--bg2); border-color: transparent; }
.hbc-close:hover { background: #1f2937; color: #fff; }

.hbc-note {
  padding: 9px 14px; background: var(--bg2); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.hbc-note b { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hbc-note span { font-size: 12px; color: var(--muted); line-height: 1.4; }

.hbc-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.hbc-item { display: flex; gap: 9px; }
.hbc-av {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff;
  font-size: 11px; font-weight: 700;
}
.hbc-body { min-width: 0; }
.hbc-who { font-size: 11px; font-weight: 700; color: var(--text); }
.hbc-body p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--text); word-break: break-word; }
.hbc-empty { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.hbc-empty b { font-size: 13px; }
.hbc-empty span { font-size: 12px; color: var(--muted); }

.hbc-form { border-top: 1px solid var(--line); padding: 10px; }
.hbc-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.hbc-row:focus-within { border-color: var(--accent); }
.hbc-row input { flex: 1; border: 0; background: transparent; color: var(--text); font-size: 13px; padding: 4px 6px; outline: none; }
.hbc-send {
  width: 32px; height: 32px; border-radius: 10px; border: 0; cursor: pointer;
  background: #2563eb; color: #fff; font-size: 14px;
}

@media (max-width: 600px) {
  .hb-chat-tab.geser { right: 16px; }
  .hb-chat-panel { left: 8px; right: 8px; width: auto; height: min(520px, 72vh); }
}

.hb-chat-panel[hidden] { display: none !important; }

.hbc-auth { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); }
.hbc-auth-label { font-size: 11px; color: var(--muted); }
.hbc-mode {
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--muted);
  text-decoration: none; cursor: pointer;
}
.hbc-mode.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.hbc-auth { padding-bottom: 10px; }
.hbc-ic svg { display: block; margin: 0 auto; }
.hbc-av-img { object-fit: cover; }
.hbc-mode:disabled { opacity: .6; }

.hbc-name {
  flex: 1; min-width: 0; font-size: 12px; padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
}
.hbc-name:disabled { opacity: .7; }
.hbc-who { display: flex; align-items: center; gap: 5px; }
.hbc-rank { font-size: 9px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; text-transform: uppercase; }
.r-baru { background: #e2e8f0; color: #475569; }
.r-aktif { background: #dbeafe; color: #1d4ed8; }
.r-senior { background: #fef3c7; color: #b45309; }
.r-legend { background: #ede9fe; color: #6d28d9; }
.footer-partner { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.footer-partner a { color: var(--accent); text-decoration: none; }
.footer-partner a:hover { text-decoration: underline; }
