/* assistant.css — floating "Ask" assistant widget (Phase 6). ATB tokens. */

#atb-ask { position: fixed; right: 18px; bottom: 18px; z-index: 9000; font-family: 'Geist', system-ui, sans-serif; }

.ask-launch {
  display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--teal, #0c9a73) 0%, var(--teal-deep, #0c7a5b) 100%);
  color: #fff; border-radius: 99px; padding: 12px 18px; font: 600 14px/1 inherit;
  box-shadow: 0 10px 26px -8px rgba(0,75,59,.5); transition: transform .15s ease, box-shadow .2s ease;
}
.ask-launch:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -8px rgba(0,75,59,.6); }
#atb-ask.open .ask-launch { display: none; }

.ask-panel {
  width: 360px; max-width: calc(100vw - 36px); height: 520px; max-height: calc(100vh - 110px);
  background: #fff; border: 1px solid var(--hairline, #e7ece9); border-radius: 18px;
  box-shadow: 0 24px 60px -16px rgba(11,31,23,.4); display: none; flex-direction: column; overflow: hidden;
}
/* Visibility is driven by the .open class (not the hidden attr, which a
   display rule would override) so openPanel()'s intro greeting always gates. */
#atb-ask.open .ask-panel { display: flex; }
.ask-head {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  border-bottom: 1px solid var(--hairline, #e7ece9); background: var(--teal-wash, #e8f3ef);
}
.ask-head b { font-family: 'Newsreader', serif; font-weight: 500; font-size: 1.05rem; color: var(--ink, #16241d); }
.ask-close { border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--ink-mute, #5f6d62); }

.ask-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface, #fbfcfb); }
.ask-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.ask-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--hairline, #e7ece9); color: var(--ink, #16241d); }
.ask-msg.me  { align-self: flex-end; background: var(--teal-deep, #0c7a5b); color: #fff; }
.ask-msg.bot a { color: var(--teal-deep, #0c7a5b); text-decoration: underline; }
.ask-src { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.ask-src a { font-size: 11.5px; color: var(--teal-deep, #0c7a5b); background: var(--teal-wash, #e8f3ef); border: 1px solid rgba(0,75,59,.18); border-radius: 99px; padding: 3px 9px; text-decoration: none; }
.ask-src a:hover { background: #dcebe5; }
.ask-msg.typing { color: var(--ink-mute, #5f6d62); font-style: italic; }

.ask-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--hairline, #e7ece9); background: #fff; }
.ask-form input {
  flex: 1; min-width: 0; box-sizing: border-box; padding: 10px 13px; border: 1px solid var(--hairline-2, #d4ddd8);
  border-radius: 10px; font: 400 14px/1.2 inherit; color: var(--ink, #16241d); background: #fff;
}
.ask-form input:focus { outline: none; border-color: var(--teal, #0c9a73); box-shadow: 0 0 0 3px var(--teal-wash, #e8f3ef); }
.ask-send { flex: none; border: 0; cursor: pointer; width: 40px; border-radius: 10px; background: var(--teal-deep, #0c7a5b); color: #fff; display: grid; place-items: center; }
.ask-send:disabled { opacity: .5; cursor: default; }

.ask-foot { padding: 9px 14px 12px; font-size: 11px; color: var(--ink-mute, #5f6d62); line-height: 1.4; background: #fff; }
.ask-foot a { color: var(--teal-deep, #0c7a5b); }

@media (max-width: 480px) {
  #atb-ask { right: 12px; bottom: 12px; }
  /* Shorter on mobile so it doesn't dominate the screen; max-height leaves room
     for the top nav and any raised offset (sticky CTA bar — see assistant.js). */
  .ask-panel { width: calc(100vw - 24px); height: 58vh; max-height: calc(100vh - 150px); }
  /* 16px stops iOS Safari auto-zooming when the field is focused. */
  .ask-form input { font-size: 16px; }
}
