/* IBHighway HelperBot widget — matches the site's existing design tokens
   (indigo/amber, Space Grotesk + Inter) from assets/style.css. Scoped
   under #ibh-helperbot-root so it can't leak into/collide with page styles. */

#ibh-helperbot-root {
  --hb-ink: #0f1222;
  --hb-muted: #646b7d;
  --hb-paper: #ffffff;
  --hb-line: #e8eaf1;
  --hb-brand: #5b5bd6;
  --hb-brand-deep: #4338ca;
  --hb-brand-soft: #eeeefc;
  --hb-amber: #f59e0b;
  --hb-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hb-font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 999999;
  font-family: var(--hb-font);
}

#ibh-helperbot-root * { box-sizing: border-box; }

.hb-bubble {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(120deg, #4f46e5, #7c3aed);
  box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .5);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--hb-font-head);
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease;
}
.hb-bubble:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 14px 28px -8px rgba(79, 70, 229, .6); }

.hb-panel {
  display: none;
  flex-direction: column;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 480px;
  max-height: calc(100vh - 90px);
  background: var(--hb-paper);
  border: 1px solid var(--hb-line);
  border-radius: 16px;
  box-shadow: 0 32px 64px -20px rgba(15, 18, 34, .22);
  position: absolute;
  top: 52px;
  right: 0;
  overflow: hidden;
}
.hb-panel.open { display: flex; }

.hb-header {
  background: linear-gradient(120deg, #4f46e5, #7c3aed);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--hb-font-head);
  font-weight: 600;
}
.hb-header .hb-title { font-size: 15px; }
.hb-header .hb-sub { font-size: 11px; opacity: .85; font-weight: 400; }
.hb-close { background: none; border: none; color: white; font-size: 18px; cursor: pointer; opacity: .85; }
.hb-close:hover { opacity: 1; }

.hb-mode-toggle {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hb-line);
}
.hb-mode-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--hb-line);
  background: var(--hb-paper);
  color: var(--hb-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.hb-mode-btn.active {
  background: var(--hb-brand-soft);
  color: var(--hb-brand-deep);
  border-color: var(--hb-brand);
}

.hb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.hb-msg { max-width: 85%; padding: 8px 11px; border-radius: 12px; word-wrap: break-word; white-space: pre-wrap; }
.hb-msg.user { align-self: flex-end; background: var(--hb-brand); color: white; border-bottom-right-radius: 4px; }
.hb-msg.assistant { align-self: flex-start; background: #f2f3f8; color: var(--hb-ink); border-bottom-left-radius: 4px; }
.hb-msg a { color: inherit; text-decoration: underline; }
.hb-msg.system { align-self: center; color: var(--hb-muted); font-size: 11px; font-style: italic; }

.hb-empty { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 10px; }
.hb-empty-greeting { font-family: var(--hb-font-head); font-weight: 600; font-size: 14px; color: var(--hb-ink); text-align: center; margin-top: 4px; }
.hb-chip-group { display: flex; flex-direction: column; gap: 6px; }
.hb-chip-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--hb-muted); }
.hb-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.hb-chip {
  border: 1px solid var(--hb-line);
  background: var(--hb-paper);
  color: var(--hb-ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--hb-font);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.hb-chip:hover { background: var(--hb-brand-soft); border-color: var(--hb-brand); color: var(--hb-brand-deep); }

.hb-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--hb-line);
}
.hb-input {
  flex: 1;
  border: 1px solid var(--hb-line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--hb-font);
  resize: none;
}
.hb-send {
  background: var(--hb-brand);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.hb-send:disabled { opacity: .5; cursor: default; }

.hb-voice-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
}
.hb-mic-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: var(--hb-brand);
  color: white;
  font-size: 28px;
  cursor: pointer;
}
.hb-mic-btn.recording { background: #dc2626; animation: hb-pulse 1.4s infinite; }
@keyframes hb-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); }
  70% { box-shadow: 0 0 0 14px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
.hb-voice-status { font-size: 12px; color: var(--hb-muted); text-align: center; }
.hb-voice-timer { font-size: 11px; color: var(--hb-muted); }
