/* Ask GrantHub: one bounded conversation surface, shared across portal pages.
   Component button radii override the legacy global !important pill-button rule. */
#gh-chat-panel {
  position: fixed; z-index: 1000; right: 24px; bottom: 80px;
  width: 420px; max-width: calc(100vw - 32px);
  height: min(600px, calc(100dvh - 112px)); min-height: 0;
  padding: 0; margin: 0; gap: 0; overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff; border: 1px solid #dfe9e5; border-radius: 20px;
  box-shadow: 0 16px 48px #1c3a2d1c; color: var(--ink, #233342);
  font-family: inherit; font-size: 14px; line-height: 1.6;
}
#gh-chat-panel[hidden] { display: none; }
#gh-chat-panel:not([hidden]) { display: grid; }
#gh-chat-panel *, #gh-chat-panel *::before, #gh-chat-panel *::after { box-sizing: border-box; }
#gh-chat-panel .gh-chat-header {
  display: flex; align-items: center; justify-content: flex-start; gap: 11px;
  min-height: 76px; padding: 16px 18px; margin: 0;
  background: #fff; border-bottom: 1px solid #edf1ef;
}
#gh-chat-panel .gh-chat-assistant-icon {
  display: grid; place-items: center; flex: 0 0 36px;
  width: 36px; height: 36px; border-radius: 11px; background: #eaf6ef; color: #12805f;
}
#gh-chat-panel .gh-chat-heading { flex: 1; min-width: 0; }
#gh-chat-panel .gh-chat-heading h2 { margin: 0; font-size: 15px; line-height: 1.5; font-weight: 650; letter-spacing: -.02em; color: var(--ink, #233342); }
#gh-chat-panel .gh-chat-heading p { margin: 2px 0 0; font-size: 11px; line-height: 1.5; color: #718378; }
#gh-chat-close {
  display: grid; place-items: center; flex: 0 0 32px;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px !important;
  background: transparent; color: #64776e; cursor: pointer;
  transition: color .15s, background .15s;
}
#gh-chat-close:hover { color: #174a36; background: #eff6f2; }
#gh-chat-panel #gh-chat-messages {
  display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  min-height: 0; padding: 20px; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9d9d0 transparent;
}
#gh-chat-messages::-webkit-scrollbar { width: 5px; }
#gh-chat-messages::-webkit-scrollbar-thumb { background: #c9d9d0; border-radius: 8px; }
#gh-chat-panel .gh-chat-welcome { flex-shrink: 0; width: 100%; margin-block: auto; padding: 12px 0; text-align: center; }
#gh-chat-panel .gh-chat-welcome[hidden] { display: none; }
#gh-chat-panel .gh-chat-welcome h3 { margin: 0 0 9px; font-size: 23px; font-weight: 650; line-height: 1.3; letter-spacing: -.035em; }
#gh-chat-panel .gh-chat-welcome > p { max-width: 34ch; margin: 0 auto 24px; font-size: 13px; line-height: 1.7; color: #6b7d73; }
#gh-chat-welcome .gh-chat-prompts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px;
  padding: 0; margin: 0; text-align: left;
}
#gh-chat-welcome .gh-chat-prompts button {
  display: flex; align-items: center; min-width: 0; min-height: 46px; height: auto;
  padding: 11px 12px; border: 1px solid #e6ede9; border-radius: 11px !important;
  background: #f8faf9; color: #3b5648; font-family: inherit; font-size: 12px; font-weight: 500;
  line-height: 1.5; white-space: normal; text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
#gh-chat-welcome .gh-chat-prompts button:nth-child(3) { grid-column: 1 / -1; }
#gh-chat-welcome .gh-chat-prompts button:hover { background: #edf7f1; border-color: #c0ddce; color: #087557; }
#gh-chat-panel .gh-chat-message {
  flex: 0 0 auto; width: fit-content; max-width: 92%; margin: 0;
  padding: 11px 14px; border: 0; border-radius: 14px;
  font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere;
}
#gh-chat-panel .gh-chat-bot { align-self: flex-start; margin-right: auto; margin-left: 0; background: #f2f6f4; color: #30483b; border-bottom-left-radius: 5px; }
#gh-chat-panel .gh-chat-user { align-self: flex-end; max-width: 84%; margin-left: auto; margin-right: 0; background: #12805f; color: #fff; border-bottom-right-radius: 5px; }
#gh-chat-panel .gh-chat-message a { display: block; margin: 8px 0 0; font-size: 12px; font-weight: 600; line-height: 1.5; color: #087557; text-decoration: none; }
#gh-chat-panel .gh-chat-message a:hover { text-decoration: underline; }
#gh-chat-panel .gh-chat-error { background: #fdf4f2; color: #8d463c; }
#gh-chat-panel .gh-chat-error > button { display: block; width: auto; min-height: 32px; padding: 6px 12px; margin: 9px 0 0; font-size: 12px; }
#gh-chat-panel .gh-chat-pending { min-width: 62px; padding: 15px; }
#gh-chat-panel .gh-chat-typing { display: flex; align-items: center; gap: 4px; height: 10px; }
#gh-chat-panel .gh-chat-typing i { width: 5px; height: 5px; border-radius: 50%; background: #609d81; animation: gh-chat-dot 1.2s ease-in-out infinite; }
#gh-chat-panel .gh-chat-typing i:nth-child(2) { animation-delay: .15s; }
#gh-chat-panel .gh-chat-typing i:nth-child(3) { animation-delay: .3s; }
#gh-chat-panel #gh-chat-form { display: block; padding: 14px 16px 16px; margin: 0; border: 0; background: #fff; }
#gh-chat-panel .gh-chat-composer { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid #dfe8e3; border-radius: 15px; background: #fafcfb; transition: border-color .15s, box-shadow .15s; }
#gh-chat-panel .gh-chat-composer:focus-within { border-color: #7abda0; box-shadow: 0 0 0 3px #12805f0d; }
#gh-chat-panel #gh-chat-input { flex: 1; min-width: 0; width: 100%; min-height: 36px; margin: 0; padding: 7px 9px; border: 0; border-radius: 9px; outline: none; background: transparent; box-shadow: none; font-family: inherit; font-size: 13px; line-height: 1.5; color: #284536; }
#gh-chat-panel #gh-chat-input::placeholder { color: #8a9b91; }
#gh-chat-panel .gh-chat-send { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; padding: 0; margin: 0; border: 0; border-radius: 10px !important; background: #12805f; color: #fff; cursor: pointer; transition: background .15s, opacity .15s; }
#gh-chat-panel .gh-chat-send:hover { background: #096f51; }
#gh-chat-panel .gh-chat-send:disabled { opacity: .55; cursor: wait; }
#gh-chat-panel .gh-chat-send.gh-action-loading svg { display: none; }
#gh-chat-panel .gh-chat-send.gh-action-loading::before { margin: 0; }
#gh-chat-panel :is(button, a):focus-visible { outline: 2px solid #12805f; outline-offset: 3px; }
body.gh-chat-open .gh-chat-launcher { visibility: hidden; pointer-events: none; }
@keyframes gh-chat-dot { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-3px); opacity: 1; } }
@media (max-width: 640px) {
  body.gh-chat-open { overflow: hidden; }
  #gh-chat-panel { top: calc(var(--gh-chat-offset, 0px) + 8px); bottom: auto; right: 8px; left: 8px; width: auto; max-width: none; height: calc(var(--gh-chat-viewport, 100dvh) - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  #gh-chat-panel .gh-chat-header { min-height: 72px; padding: 14px 16px; }
  #gh-chat-panel #gh-chat-messages { padding: 18px 16px; }
  #gh-chat-panel #gh-chat-form { padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
  #gh-chat-panel #gh-chat-input { font-size: 16px; }
  #gh-chat-panel .gh-chat-message { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #gh-chat-panel *, #gh-chat-panel *::before { animation: none; transition: none; scroll-behavior: auto; }
}
