/* Ask Goldie: corner button and chat panel. Uses the brand tokens from theme.css. */
.goldie-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 14px;
  background: var(--purple); color: var(--white); border: 1px solid rgba(255, 255, 255, 0.18);
  font: 500 15px var(--font-display); cursor: pointer; box-shadow: 0 16px 40px -12px rgba(41, 38, 43, 0.6);
  transition: background 0.2s, transform 0.2s;
}
.goldie-launcher:hover { background: var(--dark); transform: translateY(-2px); }
/* Out of the way while the panel or HubSpot's chat (which uses the same corner) is open. */
.goldie-launcher[aria-expanded="true"], html.goldie-chat-on .goldie-launcher { display: none; }
.goldie-launcher-mark { width: 22px; height: 22px; flex: none; background: url("images/cube-white.svg") center / contain no-repeat; }
.goldie-launcher-mark::after { content: ""; display: block; width: 7px; height: 7px; margin: 15px 0 0 17px; background: var(--yellow); }

/* HubSpot's chat button and welcome message stay hidden until "Talk to a person" or a #live-chat link opens the chat
   (goldie.js adds goldie-chat-on). HubSpot sets display with !important, so this uses visibility. */
html:not(.goldie-chat-on) body #hubspot-messages-iframe-container { visibility: hidden !important; }

.goldie-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 61; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 40px));
  display: flex; flex-direction: column; background: var(--white); color: var(--dark);
  border: 1px solid var(--line-light); box-shadow: 0 30px 80px -20px rgba(41, 38, 43, 0.55); font-family: var(--font-body);
}
.goldie-panel[hidden] { display: none; }
.goldie-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 14px 16px; background: var(--purple); color: var(--white); }
.goldie-title { display: flex; align-items: center; gap: 12px; }
.goldie-title b { display: block; font: 500 17px var(--font-display); }
.goldie-title small { display: block; font-size: 12px; color: var(--muted-dark); }
.goldie-head-btns { display: flex; gap: 4px; }
.goldie-icon { width: 34px; height: 34px; border: 0; background: transparent; color: var(--white); font-size: 16px; cursor: pointer; }
.goldie-icon:hover { background: rgba(255, 255, 255, 0.1); color: var(--yellow); }

.goldie-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--grey-light-1); }
.goldie-empty p { color: var(--grey-dark); font-size: 15px; margin-bottom: 14px; }
.goldie-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.goldie-suggest button { border: 1px solid var(--line-light); background: var(--white); padding: 8px 12px; font: 400 14px var(--font-display); color: var(--dark); cursor: pointer; text-align: left; }
.goldie-suggest button:hover { border-color: var(--purple); color: var(--purple); }

.goldie-msg { display: flex; flex-direction: column; max-width: 88%; }
.goldie-user { align-self: flex-end; align-items: flex-end; }
.goldie-assistant { align-self: flex-start; }
.goldie-bubble { padding: 10px 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.goldie-user .goldie-bubble { background: var(--purple); color: var(--white); white-space: pre-wrap; }
.goldie-assistant .goldie-bubble { background: var(--white); border: 1px solid var(--line-light); }
.goldie-bubble p { font-size: 15px; margin: 0 0 8px; }
.goldie-bubble p:last-child, .goldie-bubble ul:last-child { margin-bottom: 0; }
.goldie-bubble ul { margin: 0 0 8px; padding-left: 18px; }
.goldie-bubble a { color: var(--purple); }
.goldie-copy { align-self: flex-start; margin-top: 4px; border: 0; background: none; padding: 2px 0; font: 12px var(--font-display); color: var(--grey-dark); cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.goldie-msg:hover .goldie-copy, .goldie-copy:focus { opacity: 1; }

.goldie-thinking .goldie-bubble { display: flex; gap: 5px; padding: 14px; }
.goldie-thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); animation: goldie-dot 1.2s infinite ease-in-out; }
.goldie-thinking i:nth-child(2) { animation-delay: 0.15s; }
.goldie-thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes goldie-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.goldie-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line-light); }
#page_slide .goldie-form textarea, .goldie-form textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 140px; padding: 10px 12px; border: 1px solid var(--line-light); border-radius: 0;
  font: 15px/1.4 var(--font-body); color: var(--dark); background: var(--white); outline: none;
}
.goldie-form textarea:focus { border-color: var(--purple); }
.goldie-send, .goldie-stop { width: 42px; height: 42px; flex: none; border: 0; background: var(--yellow); color: var(--dark); font-size: 18px; cursor: pointer; }
.goldie-send:hover { background: var(--purple); color: var(--white); }
.goldie-stop { background: var(--dark); color: var(--white); font-size: 13px; }
.goldie-send[hidden], .goldie-stop[hidden] { display: none; }
.goldie-note { margin: 0; padding: 0 12px 10px; font-size: 11px; line-height: 1.4; color: var(--grey-dark); }
.goldie-note a { color: var(--purple); }
.goldie-person { float: right; margin: -2px 0 0 8px; border: 0; background: none; padding: 0; font: 600 12px var(--font-display); color: var(--purple); text-decoration: underline; cursor: pointer; }
.goldie-person:hover { color: var(--dark); }
.goldie-handoff { align-self: flex-start; margin-top: 8px; border: 0; background: var(--yellow); color: var(--dark); padding: 8px 14px; font: 500 14px var(--font-display); cursor: pointer; }
.goldie-handoff:hover { background: var(--purple); color: var(--white); }
.goldie-going { margin: 6px 0 0; font: 500 13px var(--font-display); color: var(--grey-dark); }

/* "Talk to a person" out of hours: HubSpot's contact form in place of the conversation. */
.goldie-log[hidden], .goldie-form[hidden], .goldie-team[hidden] { display: none; }
.goldie-team { flex: 1; overflow-y: auto; padding: 14px 16px; background: var(--white); }
.goldie-back { border: 0; background: none; padding: 0; margin-bottom: 10px; font: 500 13px var(--font-display); color: var(--purple); cursor: pointer; }
.goldie-team-intro { font-size: 14px; color: var(--grey-dark); margin: 0 0 12px; }
.goldie-team-loading { font-size: 14px; color: var(--grey-dark); }

@media (max-width: 560px) {
  .goldie-launcher { right: 12px; bottom: 12px; }
  .goldie-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border: 0; }
}
@media (prefers-reduced-motion: reduce) { .goldie-thinking i { animation: none; opacity: 0.6; } }
