/* "Ask Daniel" widget. Mount point: <div data-ask-daniel></div>
   Uses the page's own tokens (--accent, --card-bg ...) with fallbacks,
   so it follows light/dark theme like the rest of the site. */
.ask {
  --ask-accent: var(--accent, #0B6B70);
  --ask-soft: var(--accent-soft, #b6e3de);
  --ask-card: var(--card-bg, #ffffff);
  --ask-alt: var(--bg-alt, #f7f8fb);
  --ask-text: var(--text-main, #1f2933);
  --ask-muted: var(--text-muted, #55606B);
  --ask-border: var(--border-soft, #dde5ec);
  max-width: 720px; margin: 0 auto;
  background: var(--ask-card); border: 1px solid var(--ask-border);
  border-radius: 24px; box-shadow: 0 14px 35px rgba(15, 124, 130, 0.10);
  overflow: hidden; text-align: left;
}
.ask-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--ask-border); }
.ask-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex: none; animation: askPulse 2s infinite; }
@keyframes askPulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); } 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.ask-title { font-weight: 700; font-size: .95rem; color: var(--ask-text); }
.ask-sub { font-size: .76rem; color: var(--ask-muted); margin-left: auto; }

.ask-log { padding: 1rem 1.1rem; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: .7rem; scroll-behavior: smooth; }
.ask-msg { max-width: 86%; font-size: .92rem; line-height: 1.55; padding: .65rem .9rem; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; }
.ask-msg.bot { background: var(--ask-alt); color: var(--ask-text); border: 1px solid var(--ask-border); border-bottom-left-radius: 6px; align-self: flex-start; }
.ask-msg.me { background: var(--ask-accent); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.ask-msg a { color: var(--ask-accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.ask-msg.me a { color: #fff; }
.ask-typing { display: inline-flex; gap: 4px; align-items: center; }
.ask-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ask-muted); opacity: .5; animation: askBlink 1.2s infinite; }
.ask-typing i:nth-child(2) { animation-delay: .2s; } .ask-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes askBlink { 50% { opacity: 1; } }

.ask-chips { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0 1.1rem .8rem; }
.ask-chip { font-family: inherit; font-size: .78rem; padding: .38rem .8rem; border-radius: 999px; border: 1px solid var(--ask-border); background: var(--ask-card); color: var(--ask-muted); cursor: pointer; transition: border-color .15s, color .15s; }
.ask-chip:hover { border-color: var(--ask-accent); color: var(--ask-accent); }

.ask-form { display: flex; gap: .5rem; padding: .8rem 1.1rem 1rem; border-top: 1px solid var(--ask-border); }
.ask-input { flex: 1; min-width: 0; font-family: inherit; font-size: .92rem; padding: .65rem .95rem; border-radius: 999px; border: 1px solid #cbd5e1; background: var(--ask-alt); color: var(--ask-text); outline: none; }
.ask-input:focus { border-color: var(--ask-accent); box-shadow: 0 0 0 1px rgba(15,124,130,.22); }
.ask-send { font-family: inherit; font-weight: 600; font-size: .9rem; padding: .6rem 1.15rem; border: none; border-radius: 999px; cursor: pointer; color: #fff; background: radial-gradient(circle at top left, #36b3b8, #0B6B70); }
.ask-send:disabled { opacity: .55; cursor: default; }
.ask-foot { font-size: .7rem; color: var(--ask-muted); padding: 0 1.1rem .9rem; }

/* Compact: sits in the homepage hero where the agent feed was. */
.ask--compact { max-width: none; margin: 0; border-radius: var(--radius-md, 16px); box-shadow: var(--shadow-soft, 0 14px 35px rgba(15,124,130,.10)); }
.ask--compact .ask-head { border-bottom: none; padding: 1.1rem 1.3rem 0; gap: .55rem; }
.ask-eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ask-accent); }
.ask-lead { font-size: .82rem; color: var(--ask-muted); padding: .2rem 1.3rem .7rem; margin: 0; }
.ask--compact .ask-log { padding: .2rem 1.3rem .6rem; max-height: 240px; gap: .5rem; }
.ask--compact .ask-msg { font-size: .84rem; padding: .5rem .75rem; border-radius: 13px; }
.ask--compact .ask-chips { padding: 0 1.3rem .7rem; gap: .35rem; }
.ask--compact .ask-chip { font-size: .72rem; padding: .3rem .7rem; }
.ask--compact .ask-form { border-top: none; padding: 0 1.3rem 1.1rem; }
.ask--compact .ask-input { font-size: .85rem; padding: .5rem .85rem; }
.ask--compact .ask-send { font-size: .82rem; padding: .48rem 1rem; }
.ask--compact .ask-foot { font-size: .66rem; padding: 0 1.3rem .95rem; }

html[data-theme="dark"] .ask-input { border-color: var(--ask-border); }

@media (max-width: 520px) {
  .ask { border-radius: 18px; }
  .ask-sub { display: none; }
  .ask-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .ask-dot, .ask-typing i { animation: none; } }
