/* Assistant MSD island styles — self-contained (Astro site). */
:root {
  --msd-chat-ink: #16161d;
  --msd-chat-paper: #faf8f4;
  --msd-chat-white: #ffffff;
  --msd-chat-line: rgba(22, 22, 29, 0.12);
  --msd-chat-violet: #4f46e5;
  --msd-chat-soft: #5c5c68;
}
#msd-chat-root { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.chat-fab {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  width: 3.25rem; height: 3.25rem; border-radius: 50%;
  border: 1px solid var(--msd-chat-line); cursor: pointer;
  background: var(--msd-chat-ink); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(10, 10, 20, 0.35);
}
.chat-fab-dot {
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--msd-chat-violet); color: #fff;
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
}
.chat-panel {
  position: fixed; right: 1rem; bottom: 5.5rem; z-index: 91;
  width: min(24rem, calc(100vw - 2rem)); height: min(30rem, calc(100dvh - 8rem));
  display: grid; grid-template-rows: auto 1fr auto auto;
  background: var(--msd-chat-paper); color: var(--msd-chat-ink);
  border-radius: 1rem; border: 1px solid var(--msd-chat-line);
  box-shadow: 0 24px 60px rgba(10, 10, 20, 0.35); overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--msd-chat-line); background: var(--msd-chat-white); }
.chat-stamp { width: 2rem; height: 2rem; color: var(--msd-chat-violet); }
.chat-stamp-text { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; fill: currentColor; }
.chat-head-txt { min-width: 0; flex: 1; }
.chat-title { margin: 0; font-size: 0.95rem; font-weight: 650; display: flex; align-items: center; gap: 0.4rem; }
.chat-tag { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; color: #fff; background: var(--msd-chat-violet); border-radius: 999px; padding: 0.1rem 0.4rem; }
.chat-identity { margin: 0.1rem 0 0; font-size: 0.72rem; color: var(--msd-chat-soft); }
.chat-close { border: 0; background: none; cursor: pointer; color: inherit; padding: 0.3rem; }
.chat-close svg { width: 1.1rem; height: 1.1rem; display: block; }
.chat-log { overflow-y: auto; padding: 0.9rem; display: grid; gap: 0.55rem; align-content: start; background: var(--msd-chat-paper); }
.chat-msg { max-width: 88%; padding: 0.55rem 0.75rem; border-radius: 0.9rem; font-size: 0.86rem; line-height: 1.45; }
.chat-msg p { margin: 0; }
.chat-msg-ai { background: var(--msd-chat-white); border: 1px solid var(--msd-chat-line); border-bottom-left-radius: 0.25rem; }
.chat-msg-user { justify-self: end; background: var(--msd-chat-ink); color: #fff; border-bottom-right-radius: 0.25rem; }
.chat-mail-link { color: var(--msd-chat-violet); font-weight: 600; word-break: break-all; }
.chat-lead-open { margin-top: 0.4rem; border: 1px solid var(--msd-chat-violet); color: var(--msd-chat-violet); background: none; border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.78rem; cursor: pointer; }
.chat-typing { display: inline-flex; gap: 0.25rem; }
.chat-typing-dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--msd-chat-soft); opacity: 0.6; }
.chat-chips { padding: 0 0.9rem 0.6rem; display: grid; gap: 0.4rem; }
.chat-chips-label { margin: 0; font-size: 0.7rem; font-weight: 600; color: var(--msd-chat-soft); }
.chat-chips-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chat-chip { border: 1px solid var(--msd-chat-line); background: var(--msd-chat-white); border-radius: 999px; padding: 0.35rem 0.65rem; font-size: 0.75rem; cursor: pointer; color: inherit; }
.chat-lead { padding: 0.9rem; display: grid; gap: 0.55rem; border-top: 1px solid var(--msd-chat-line); background: var(--msd-chat-white); }
.chat-lead-title { margin: 0; font-weight: 650; font-size: 0.9rem; }
.chat-field { display: grid; gap: 0.2rem; font-size: 0.78rem; }
.chat-field span { color: var(--msd-chat-soft); }
.chat-field input, .chat-field textarea { border: 1px solid var(--msd-chat-line); border-radius: 0.5rem; padding: 0.45rem 0.6rem; font: inherit; background: var(--msd-chat-paper); color: inherit; }
.chat-lead-submit { display: inline-block; text-align: center; background: var(--msd-chat-violet); color: #fff; text-decoration: none; border-radius: 999px; padding: 0.5rem 0.9rem; font-size: 0.82rem; font-weight: 600; }
.chat-lead-note { margin: 0; font-size: 0.68rem; color: var(--msd-chat-soft); }
.chat-lead-skip { border: 0; background: none; color: var(--msd-chat-soft); font-size: 0.75rem; cursor: pointer; text-align: left; padding: 0; }
.chat-inputrow { display: flex; gap: 0.5rem; padding: 0.7rem 0.9rem; border-top: 1px solid var(--msd-chat-line); background: var(--msd-chat-white); }
.chat-input { flex: 1; min-width: 0; border: 1px solid var(--msd-chat-line); border-radius: 999px; padding: 0.55rem 0.9rem; font: inherit; font-size: 0.88rem; background: var(--msd-chat-paper); color: inherit; }
.chat-send { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; background: var(--msd-chat-violet); color: #fff; display: grid; place-items: center; cursor: pointer; }
.chat-send:disabled { opacity: 0.45; cursor: default; }
.chat-send svg { width: 1.1rem; height: 1.1rem; }
@media (max-width: 40rem) {
  .chat-panel { right: 0.5rem; left: 0.5rem; width: auto; bottom: 5rem; height: min(70dvh, 34rem); }
}
@media (prefers-reduced-motion: reduce) {
  .chat-fab, .chat-panel { transition: none; }
}
