.ai-guide-bubble { white-space: pre-wrap; }
/* v0.7.15: thinking indicator while waiting for AI response */
.ai-guide-bubble.is-typing {
  opacity: .88;
  animation: docoiku-ai-thinking-pulse 2.1s ease-in-out infinite;
}
@keyframes docoiku-ai-thinking-pulse {
  0%, 100% { opacity: .88; }
  50% { opacity: .42; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-guide-bubble.is-typing {
    animation: none;
    opacity: .72;
  }
}
.ai-guide-bubble.is-animating::after { content: '▋'; display: inline-block; margin-left: 2px; opacity: .55; animation: docoiku-ai-caret 1s steps(1) infinite; }
@keyframes docoiku-ai-caret { 50% { opacity: 0; } }
.ai-guide-privacy { padding: 0 !important; overflow: hidden; }
.ai-guide-privacy__toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; text-align: left; cursor: pointer; }
.ai-guide-privacy__state { flex: 0 0 auto; font-size: 12px; font-weight: 900; color: #9a3412; }
.ai-guide-privacy__body { padding: 0 12px 12px; font-size: 13px; line-height: 1.65; color: #7c2d12; }
.ai-guide-privacy__list {
  margin: 0;
  padding-left: 1.25em;
}
.ai-guide-privacy__list li {
  margin: 0 0 6px;
}
.ai-guide-privacy__list li:last-child {
  margin-bottom: 0;
}

.ai-guide-sources { max-width: 86%; align-self: flex-start; margin-top: -4px; padding: 9px 11px; border-radius: 14px; background: #f8fafc; border: 1px solid rgba(15,23,42,.08); font-size: 12px; color: #475569; }
.ai-guide-sources__title { font-weight: 900; margin-bottom: 5px; color: #334155; }
.ai-guide-sources__list { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-guide-sources__list a { display: inline-flex; max-width: 100%; padding: 5px 8px; border-radius: 999px; background: #fff; color: #4c1d95; text-decoration: none; border: 1px solid rgba(124,58,237,.18); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* v0.2.1: mobile keyboard guard for standalone /ai-guide/ */
:root { --docoiku-ai-keyboard-offset: 0px; --docoiku-ai-visual-height: 100dvh; }
body.docoiku-ai-guide-standalone {
  height: var(--docoiku-ai-visual-height) !important;
  min-height: var(--docoiku-ai-visual-height) !important;
  overflow: hidden !important;
}
body.docoiku-ai-guide-standalone .ai-guide-app {
  height: var(--docoiku-ai-visual-height) !important;
  min-height: var(--docoiku-ai-visual-height) !important;
}
body.docoiku-ai-guide-standalone .ai-guide-body {
  padding-bottom: calc(92px + var(--docoiku-ai-keyboard-offset, 0px)) !important;
}
body.docoiku-ai-guide-standalone .ai-guide-form {
  bottom: calc(var(--docoiku-ai-keyboard-offset, 0px)) !important;
  padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  transition: bottom .16s ease;
}
body.docoiku-ai-keyboard-open .ai-guide-quick {
  padding-bottom: 6px !important;
}
body.docoiku-ai-keyboard-open .ai-guide-chat__log {
  padding-bottom: 18px !important;
}
@supports (-webkit-touch-callout: none) {
  body.docoiku-ai-guide-standalone .ai-guide-form input,
  body.docoiku-ai-guide-standalone .ai-guide-form textarea {
    font-size: 16px !important;
  }
}

/* v0.2.2: archive links before individual store links */
.ai-guide-sources__title:not(:first-child) { margin-top: 9px; }
.ai-guide-sources__list a.is-archive { background: #111827; color: #fff; border-color: rgba(17,24,39,.2); }


/* v0.4.3: user-side 24h chat history */
.ai-guide-history-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(248, 250, 252, .92);
  border: 1px solid rgba(15, 23, 42, .08);
  font-size: 12px;
  color: #64748b;
}
.ai-guide-history-tools__note {
  line-height: 1.45;
}
.ai-guide-history-tools__clear {
  flex: 0 0 auto;
  border: 1px solid rgba(124, 58, 237, .18);
  background: #fff;
  color: #4c1d95;
  border-radius: 999px;
  padding: 5px 9px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.ai-guide-history-tools__clear:active {
  transform: translateY(1px);
}
