/* トップページのミル（docs/watch-guide-ai.md）。右下のミルを押すと開く、使い方の質問の窓。 */
/* The site-wide button:hover (style.css) turns buttons blue; the mascot's button stays invisible. */
.mascot .mascot-ask, .mascot .mascot-ask:hover, .mascot .mascot-ask:active { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; cursor: pointer; }
.mascot-ask[hidden] { display: none; }
/* index.html outlines every focused button; a click on Mac Chrome focuses it too. Only keyboard focus shows a ring. */
.mascot .mascot-ask:focus { outline: none; }
.mascot .mascot-ask:focus-visible { outline: 3px solid var(--primary-color, #f00); outline-offset: 4px; }

.site-guide { position: fixed; right: 20px; bottom: 180px; z-index: 1001; display: flex; flex-direction: column; width: min(360px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 220px)); border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); color: var(--text-color, #333); overflow: hidden; }
.site-guide[hidden] { display: none; }
.site-guide-header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #eee; }
.site-guide-header img { width: 36px; height: 36px; border-radius: 50%; background: #fff; }
.site-guide-header div { flex: 1 1 auto; display: flex; flex-direction: column; }
.site-guide-header strong { font-size: 15px; }
.site-guide-header span { color: #777; font-size: 11px; }
.site-guide-header button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: #555; font-size: 20px; cursor: pointer; }
.site-guide-header button:hover { background: #f2f2f2; }

.site-guide-log { flex: 1 1 auto; min-height: 160px; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: #fafafa; }
.site-guide-message { display: flex; align-items: flex-start; gap: 8px; max-width: 92%; }
.site-guide-message p { margin: 0; padding: 8px 10px; border-radius: 12px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-guide-message.miru p { background: #fff; border: 1px solid #eee; }
.site-guide-message.visitor { align-self: flex-end; }
.site-guide-message.visitor p { background: #fff1ec; }
.site-guide-avatar { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 1px solid #eee; }
.site-guide-message.typing p { color: #999; }
.site-guide-message.typing p::after { content: ""; display: inline-block; width: 1.2em; animation: site-guide-dots 1s steps(3, end) infinite; }
@keyframes site-guide-dots { 0% { content: ""; } 33% { content: "."; } 66% { content: ".."; } }
@media (prefers-reduced-motion: reduce) { .site-guide-message.typing p::after { animation: none; } }
.site-guide-quick { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 36px; }
.site-guide-quick button { min-height: 32px; padding: 4px 12px; border: 1px solid #ddd; border-radius: 999px; background: #fff; color: #333; font-size: 13px; cursor: pointer; }
.site-guide-quick button:hover { border-color: #FF6B35; }

.site-guide-note { margin: 0; padding: 6px 12px 0; color: #888; font-size: 11px; }
.site-guide-form { display: flex; gap: 8px; padding: 8px 12px; }
.site-guide-form textarea { flex: 1 1 auto; min-height: 44px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 10px; font: inherit; font-size: 14px; resize: none; }
.site-guide-form button { flex: none; min-width: 64px; border: 0; border-radius: 10px; background: #FF6B35; color: #fff; font-weight: 700; cursor: pointer; }
.site-guide-form button:disabled, .site-guide-form textarea:disabled { opacity: 0.6; cursor: default; }
.site-guide-status { margin: 0; padding: 0 12px 10px; color: #c0392b; font-size: 12px; }
.site-guide-status:empty { display: none; }

/* スマホ: ミルは小さく右下に出し、窓は画面の下に広げる。質問できないときはミルを出さない。 */
@media (max-width: 768px) {
  .mascot.site-guide-ready { display: block; width: 72px; height: 72px; right: 12px; bottom: 12px; animation: none; }
  .mascot.site-guide-ready .mascot-speech { display: none !important; }
  .site-guide { right: 8px; left: 8px; bottom: 92px; width: auto; max-height: calc(100vh - 120px); }
}
