/* "Ask about the program" chat panel (js/ask.js). Uses the site's
   variables from style.css. */
.ask-launcher {
  /* --ask-top is the bottom edge of the sticky menu bar, kept current by js/ask.js */
  position: fixed; right: 20px; top: calc(var(--ask-top, 128px) + 12px); z-index: 90;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.15rem;
  border: 0; border-radius: 6px;
  background: var(--teal, #194056); color: #fff;
  font: 700 0.95rem/1 var(--body, Helvetica, Arial, sans-serif);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 3px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  animation: ask-float 3.2s ease-in-out infinite;   /* hovers gently over the page */
  transition: box-shadow 0.2s, background 0.2s;
}
.ask-launcher:hover, .ask-launcher:focus-visible {
  background: #0d2b3a;
  animation-play-state: paused;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2);
}
@keyframes ask-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.ask-launcher:focus-visible, .ask-panel button:focus-visible, .ask-input:focus-visible {
  outline: 3px solid #f2b705; outline-offset: 2px;
}
.ask-launcher svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.ask-launcher.is-open { display: none; }

.ask-panel {
  position: fixed; right: 20px; top: calc(var(--ask-top, 128px) + 12px); z-index: 91;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - var(--ask-top, 128px) - 32px);
  display: flex; flex-direction: column;
  background: #fff; color: var(--ink, #2b2b2b);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  font-family: var(--body, Helvetica, Arial, sans-serif);
  font-weight: 400;
}
.ask-panel[hidden] { display: none; }

.ask-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  background: var(--teal, #194056); color: #fff;
}
.ask-title {
  flex: 1; margin: 0;
  font: 400 1.15rem/1.2 var(--heading, Georgia, serif); color: #fff;
}
.ask-reset, .ask-close {
  border: 0; background: transparent; color: #fff; cursor: pointer;
  font: inherit; border-radius: 4px;
}
.ask-reset { font-size: 0.85rem; padding: 0.3rem 0.5rem; text-decoration: underline; }
.ask-close { font-size: 1.6rem; line-height: 1; width: 36px; height: 36px; }
.ask-reset:hover, .ask-close:hover { background: rgba(255, 255, 255, 0.15); }

.ask-log {
  flex: 1; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--panel, #f5f5f5);
}
.ask-intro p { color: var(--ink, #2b2b2b); font-size: 0.95rem; margin: 0 0 0.6rem; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ask-chips[hidden] { display: none; }
.ask-chip {
  padding: 0.4rem 0.7rem; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--teal, #194056); background: #fff; color: var(--teal, #194056);
  font: 400 0.85rem/1.3 var(--body, Helvetica, Arial, sans-serif); text-align: left;
}
.ask-chip:hover { background: #e6eef2; }

.ask-msg {
  max-width: 88%; padding: 0.6rem 0.8rem; border-radius: 8px;
  font-size: 0.95rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.ask-msg--user { align-self: flex-end; background: var(--teal, #194056); color: #fff; }
.ask-msg--user a { color: #fff; }
.ask-msg--assistant { align-self: flex-start; background: #fff; color: var(--ink, #2b2b2b); border: 1px solid var(--line, #e2e2e2); }
.ask-msg--error { border-color: #b3261e; color: #8c1d18; }
.ask-msg.is-typing::after { content: "\2026"; animation: ask-pulse 1s infinite; }
@keyframes ask-pulse { 50% { opacity: 0.3; } }

.ask-form {
  display: flex; gap: 0.5rem; align-items: flex-end;
  padding: 0.6rem; border-top: 1px solid var(--line, #e2e2e2); background: #fff;
}
.ask-input {
  flex: 1; resize: none; min-height: 40px; max-height: 120px;
  padding: 0.55rem 0.7rem; border: 1px solid #9a9a9a; border-radius: 6px;
  font: 400 1rem/1.4 var(--body, Helvetica, Arial, sans-serif); color: var(--ink, #2b2b2b);
}
.ask-send {
  height: 40px; padding: 0 1rem; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--teal, #194056); color: #fff; font: 700 0.95rem/1 var(--body, Helvetica, Arial, sans-serif);
}
.ask-send:disabled { opacity: 0.55; cursor: default; }

.ask-note {
  margin: 0; padding: 0 0.8rem 0.6rem; background: #fff;
  font-size: 0.75rem; line-height: 1.4; color: var(--muted, #4a4a4a);
}

@media (max-width: 520px) {
  .ask-launcher { right: 12px; top: calc(var(--ask-top, 92px) + 10px); padding: 0.65rem 0.9rem; font-size: 0.9rem; }
  .ask-panel { right: 0; top: var(--ask-top, 92px); bottom: 0; width: 100vw; max-width: 100vw; height: auto; max-height: none; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .ask-msg.is-typing::after, .ask-launcher { animation: none; } }
