/* Question box, bottom right. Colours come from the site where tokens.css is loaded. */
.qa-open,
.qa-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  font-family: var(--font-sans, Arial, sans-serif);
}

.qa-open[hidden],
.qa-panel[hidden] { display: none; }

.qa-open {
  min-height: 48px;
  padding: 0 20px;
  background: #0f172a;
  color: #fff;
  border: 1px solid #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.3);
}

.qa-panel {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0; /* the panel is a <section>, which pages pad heavily */
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 32px));
  height: min(520px, calc(100dvh - 32px));
  background: #fff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.25);
}

.qa-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 4px 16px;
  background: #0f172a;
  color: #fff;
}

.qa-close {
  width: 44px;
  height: 44px;
  background: transparent;
  color: #fff;
  border: 0;
  font-size: 26px;
  cursor: pointer;
}

.qa-log { flex: 1; overflow-y: auto; padding: 14px; }

.qa-log .qa-msg {
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.5;
}

.qa-log .qa-bot { background: #f1f5f9; color: #0f172a; }
.qa-log .qa-you { margin-left: auto; background: #0f172a; color: #fff; }
.qa-msg a { display: block; margin-top: 6px; color: #0369a1; font-weight: 700; }

.qa-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }

.qa-suggestions button {
  min-height: 44px;
  padding: 0 10px;
  background: #fff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.25);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.qa-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(15, 23, 42, 0.12); }

/* 16px stops phones zooming in when the box is tapped. */
.qa-form input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(15, 23, 42, 0.3);
  font: inherit;
  font-size: 16px;
}

.qa-form button {
  min-height: 44px;
  padding: 0 14px;
  background: #0f172a;
  color: #fff;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* Room at the very bottom so the button never covers footer links. */
body:has(.qa-open) footer { padding-bottom: 88px; }
