/* ask-ai.css
   Themeable via CSS variables â€” override these in your site's own stylesheet
   (e.g. inside your existing [data-theme="dark"] / light rules) to match
   your palette instead of the standalone defaults below. */

.ask-ai-widget {
  --ask-ai-bg: #15120d;
  --ask-ai-panel: #1c1811;
  --ask-ai-text: #f1ece0;
  --ask-ai-muted: #998d78;
  --ask-ai-border: #3a3326;
  --ask-ai-accent: #d4a24e;
  --ask-ai-accent-2: #7fb69e;
  --ask-ai-user-bg: #262013;

  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: inherit;
  color: var(--ask-ai-text);
}

@media (prefers-color-scheme: light) {
  .ask-ai-widget:not([data-force-dark]) {
    --ask-ai-bg: #faf7f0;
    --ask-ai-panel: #ffffff;
    --ask-ai-text: #241f16;
    --ask-ai-muted: #7a7363;
    --ask-ai-border: #ddd4bf;
    --ask-ai-accent: #a9762d;
    --ask-ai-accent-2: #3f8a72;
    --ask-ai-user-bg: #f1ead9;
  }
}

.ask-ai-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--ask-ai-panel);
  color: var(--ask-ai-text);
  border: 1px solid var(--ask-ai-border);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: none;
}

.ask-ai-toggle:hover { border-color: var(--ask-ai-accent); }

.ask-ai-toggle:focus-visible,
.ask-ai-widget button:focus-visible,
.ask-ai-widget a:focus-visible,
.ask-ai-widget input:focus-visible {
  outline: 2px solid var(--ask-ai-accent);
  outline-offset: 2px;
}

.ask-ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ask-ai-accent-2);
}

@media (prefers-reduced-motion: no-preference) {
  .ask-ai-dot { animation: ask-ai-pulse 2.4s ease-in-out infinite; }
}

@keyframes ask-ai-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.ask-ai-panel {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: 340px;
  max-width: calc(100vw - 40px);
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: var(--ask-ai-panel);
  border: 1px solid var(--ask-ai-border);
  border-radius: 6px;
  overflow: hidden;
}

.ask-ai-panel[hidden] { display: none; }

.ask-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ask-ai-border);
  font-size: 13px;
}

.ask-ai-head button {
  background: none;
  border: none;
  color: var(--ask-ai-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.ask-ai-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}

.ask-ai-intro { color: var(--ask-ai-muted); }

.ask-ai-msg-user {
  align-self: flex-end;
  max-width: 85%;
  background: var(--ask-ai-user-bg);
  border-radius: 5px;
  padding: 7px 10px;
}

.ask-ai-msg-ai {
  padding-top: 10px;
  border-top: 1px solid var(--ask-ai-border);
}

.ask-ai-msg-ai:first-child { border-top: none; padding-top: 0; }

.ask-ai-sources {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--ask-ai-muted);
  font-size: 11.5px;
}

.ask-ai-sources span.ask-ai-sources-label { color: var(--ask-ai-muted); }

.ask-ai-source {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ask-ai-accent-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--ask-ai-accent-2);
}

.ask-ai-source:hover { border-bottom-style: solid; }

.ask-ai-thinking { color: var(--ask-ai-muted); font-style: italic; }

.ask-ai-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--ask-ai-border);
}

.ask-ai-form input {
  flex: 1;
  background: var(--ask-ai-bg);
  color: var(--ask-ai-text);
  border: 1px solid var(--ask-ai-border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: inherit;
}

.ask-ai-form button {
  background: var(--ask-ai-accent);
  color: var(--ask-ai-bg);
  border: none;
  border-radius: 4px;
  padding: 0 14px;
  font-size: 13px;
  cursor: pointer;
}

.ask-ai-form button:disabled { opacity: 0.5; cursor: default; }
