/* Ask Alpha: the floating AI assistant on every page. Self-contained tokens so it looks the same on the home page and member pages. */
.ask-root {
  --a-gold: #c9973f; --a-gold-ink: #7a5418; --a-gold-light: #e3b85e; --a-ink: #1d1512; --a-ink-2: #645953;
  --a-paper: #f6f3ef; --a-line: #ddd5cc; --a-night: #150e0b;
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 90;
  font-family: "Geist", "Helvetica Neue", Arial, sans-serif; color: var(--a-ink);
}
.ask-launch {
  display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 7px; border-radius: 999px; cursor: pointer;
  background: var(--a-night); color: #fff; border: 1px solid rgba(227, 184, 94, 0.5); font: inherit;
  box-shadow: 0 14px 34px -12px rgba(21, 14, 11, 0.6), 0 0 0 0 rgba(201, 151, 63, 0.5);
  animation: ask-glow 3.2s ease-in-out infinite; transition: transform 0.2s ease;
}
.ask-launch:hover { transform: translateY(-2px); }
.ask-launch:focus-visible { outline: 3px solid var(--a-gold-light); outline-offset: 3px; }
.ask-launch img { width: 34px; height: 34px; border-radius: 50%; }
.ask-launch span { display: grid; text-align: left; line-height: 1.15; }
.ask-launch b { font-size: 0.95rem; }
.ask-launch small { font-size: 0.72rem; color: var(--a-gold-light); letter-spacing: 0.02em; }
.ask-root.is-open .ask-launch { visibility: hidden; }
@keyframes ask-glow { 0%, 100% { box-shadow: 0 14px 34px -12px rgba(21, 14, 11, 0.6), 0 0 0 0 rgba(201, 151, 63, 0.45); } 50% { box-shadow: 0 14px 34px -12px rgba(21, 14, 11, 0.6), 0 0 0 8px rgba(201, 151, 63, 0); } }
@media (prefers-reduced-motion: reduce) { .ask-launch { animation: none; } }

.ask-panel {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 32px));
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--a-line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px -24px rgba(21, 14, 11, 0.55);
  animation: ask-in 0.22s ease-out;
}
.ask-panel[hidden] { display: none; }
@keyframes ask-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.ask-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--a-night); color: #fff; }
.ask-head img { width: 40px; height: 40px; border-radius: 50%; }
.ask-head div { display: grid; flex: 1; min-width: 0; line-height: 1.2; }
.ask-head b { font-size: 1.02rem; }
.ask-head small { color: rgba(255, 255, 255, 0.7); font-size: 0.76rem; }
.ask-new, .ask-x { background: none; border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; border-radius: 999px; font: inherit; font-size: 0.8rem; padding: 5px 11px; cursor: pointer; }
.ask-x { border: 0; font-size: 1.1rem; padding: 4px 8px; }
.ask-new:hover, .ask-x:hover { background: rgba(255, 255, 255, 0.12); }

.ask-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--a-paper); overscroll-behavior: contain; }
.ask-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 0.94rem; line-height: 1.55; overflow-wrap: anywhere; }
.ask-msg p { margin: 0; } .ask-msg p + p, .ask-msg p + ul, .ask-msg ul + p, .ask-msg p + ol, .ask-msg ol + p { margin-top: 8px; }
.ask-msg ul, .ask-msg ol { margin: 0; padding-left: 20px; }
.ask-msg li + li { margin-top: 3px; }
.ask-msg a { color: var(--a-gold-ink); text-decoration: underline; text-underline-offset: 2px; }
.ask-msg code { word-break: break-all; font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.82em; background: rgba(201, 151, 63, 0.14); padding: 1px 4px; border-radius: 4px; }
.ask-msg.user { align-self: flex-end; background: var(--a-night); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ask-msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--a-line); border-bottom-left-radius: 4px; }
.ask-msg.intro { border-left: 3px solid var(--a-gold); }
.ask-dim { color: var(--a-ink-2); font-size: 0.86rem; }
.ask-status { color: var(--a-gold-ink); font-size: 0.84rem; font-style: italic; }
.ask-err { color: #b42318; font-size: 0.88rem; }
.ask-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ask-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-gold); animation: ask-dot 1s infinite ease-in-out; }
.ask-typing i:nth-child(2) { animation-delay: 0.15s; } .ask-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ask-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.ask-chips { display: flex; gap: 8px; padding: 10px 16px 2px; overflow-x: auto; background: var(--a-paper); scrollbar-width: none; }
.ask-chips[hidden] { display: none; }
.ask-chip { flex: none; background: #fff; border: 1px solid var(--a-line); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 0.82rem; color: var(--a-ink); cursor: pointer; }
.ask-chip:hover { border-color: var(--a-gold); color: var(--a-gold-ink); }

.ask-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--a-line); background: #fff; }
.ask-form textarea { flex: 1; resize: none; border: 1px solid var(--a-line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 16px; line-height: 1.4; max-height: 140px; color: var(--a-ink); background: #fff; }
.ask-form textarea:focus { outline: none; border-color: var(--a-gold); box-shadow: 0 0 0 3px rgba(201, 151, 63, 0.2); }
.ask-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--a-gold); color: var(--a-night); cursor: pointer; display: grid; place-items: center; }
.ask-send:hover { background: var(--a-gold-light); }
.ask-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ask-stop { width: 12px; height: 12px; background: currentColor; border-radius: 2px; }
.ask-foot { margin: 0; padding: 0 14px 10px; font-size: 0.72rem; color: var(--a-ink-2); background: #fff; }

@media (max-width: 560px) {
  .ask-launch { padding-right: 14px; }
  .ask-launch small { display: none; }
  .ask-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
}
html:not(.ai-on) [data-ai-only] { display: none !important; }
