#pac-chat-root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
  z-index: 99999;
}
#pac-chat-root * { box-sizing: border-box; }
#pac-chat-toggle {
  position: fixed; right: 24px; bottom: 24px; z-index: 99999;
  max-width: calc(100vw - 32px); border: 0; border-radius: 28px;
  background: var(--pac-primary, #5B4BDB); color: #fff;
  padding: 14px 20px; cursor: pointer; box-shadow: 0 4px 18px #0002;
  font-size: 14px; font-weight: 600;
}
#pac-chat-panel {
  position: fixed; right: 24px; bottom: 82px; z-index: 99999;
  display: flex; flex-direction: column;
  width: min(360px, calc(100vw - 32px)); height: 480px;
  max-height: calc(100dvh - 110px); background: #fff; color: #202124;
  border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 35px #0002;
}
#pac-chat-panel[hidden] { display: none; }
.pac-header {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; background: var(--pac-primary, #5B4BDB); color: #fff;
}
.pac-header button { border: 0; background: transparent; color: #fff; font-size: 24px; cursor: pointer; }
#pac-chat-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; }
.pac-bot, .pac-user { max-width: 90%; padding: 10px 12px; border-radius: 12px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.pac-bot { background: #f3f4f6; color: #222; margin: 8px 0; }
.pac-user { background: var(--pac-primary, #5B4BDB); color: #fff; margin: 8px 0 8px auto; }
.pac-source { font-size: 12px; margin: 4px 0 8px; overflow-wrap: anywhere; }
.pac-source a { color: var(--pac-primary, #5B4BDB); }
#pac-chat-form { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eee; background: #fff; }
#pac-chat-input { min-width: 0; width: 100%; flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 8px; color: #222; background: #fff; }
#pac-chat-form button { flex: 0 0 auto; border: 0; border-radius: 8px; padding: 10px 14px; background: var(--pac-primary, #5B4BDB); color: #fff; cursor: pointer; }
#pac-chat-form button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 480px) {
  #pac-chat-toggle { right: 16px; bottom: 16px; }
  #pac-chat-panel { right: 8px; bottom: 72px; width: calc(100vw - 16px); max-height: calc(100dvh - 88px); }
}
