/* 盛岡白百合学園同窓会 AIコンシェルジュ ウィジェット。
   既存ページに影響しないよう全クラスを shc- で名前空間化している。 */
.shc-root {
  --shc-purple: #5d4278;
  --shc-purple-deep: #432d61;
  --shc-gold: #97735b;
  --shc-cream: #fbf6ee;
  --shc-ink: #211c2c;
  --shc-muted: #6f6676;
  --shc-line: #e2d4c5;
  position: fixed;
  right: clamp(16px, 4vw, 28px);
  bottom: clamp(16px, 4vw, 28px);
  z-index: 2147483000;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
}

.shc-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--shc-purple), var(--shc-purple-deep));
  box-shadow: 0 10px 28px rgba(67, 45, 97, 0.35);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.shc-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(67, 45, 97, 0.42); }
.shc-launcher:focus-visible { outline: 3px solid var(--shc-gold); outline-offset: 2px; }
.shc-launcher svg { width: 20px; height: 20px; }
.shc-root[data-open="true"] .shc-launcher { display: none; }

.shc-panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 110px));
  background: var(--shc-cream);
  border: 1px solid var(--shc-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(33, 28, 44, 0.28);
}
.shc-root[data-open="true"] .shc-panel { display: flex; }

.shc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--shc-purple), var(--shc-purple-deep));
}
.shc-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.shc-subtitle { font-size: 11px; opacity: 0.85; margin-top: 2px; }
.shc-close {
  border: none; background: rgba(255, 255, 255, 0.15); color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.shc-close:hover { background: rgba(255, 255, 255, 0.28); }

.shc-log {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--shc-cream);
}
.shc-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.shc-msg-bot { align-self: flex-start; background: #fff; color: var(--shc-ink); border: 1px solid var(--shc-line); border-bottom-left-radius: 4px; }
.shc-msg-user { align-self: flex-end; background: var(--shc-purple); color: #fff; border-bottom-right-radius: 4px; }
.shc-msg a { color: inherit; text-decoration: underline; }
.shc-msg-bot a { color: var(--shc-purple-deep); }

.shc-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--shc-line); border-radius: 14px; }
.shc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--shc-purple-soft, #8b6ca3); opacity: 0.5; animation: shc-bounce 1.2s infinite; }
.shc-typing span:nth-child(2) { animation-delay: 0.2s; }
.shc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes shc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

.shc-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.shc-chip {
  border: 1px solid var(--shc-line); background: #fff; color: var(--shc-purple-deep);
  padding: 6px 11px; border-radius: 999px; font-size: 12px; cursor: pointer;
}
.shc-chip:hover { background: #fff7ef; }

.shc-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--shc-line); background: #fff; }
.shc-input {
  flex: 1; resize: none; border: 1px solid var(--shc-line); border-radius: 12px;
  padding: 10px 12px; font-size: 14px; line-height: 1.4; max-height: 96px; font-family: inherit; color: var(--shc-ink);
}
.shc-input:focus { outline: 2px solid var(--shc-purple-soft, #8b6ca3); border-color: transparent; }
.shc-send {
  border: none; background: var(--shc-purple); color: #fff; width: 42px; border-radius: 12px;
  cursor: pointer; display: grid; place-items: center; flex: 0 0 auto;
}
.shc-send:hover { background: var(--shc-purple-deep); }
.shc-send:disabled { opacity: 0.5; cursor: not-allowed; }
.shc-send svg { width: 18px; height: 18px; }

.shc-note { font-size: 10.5px; color: var(--shc-muted); text-align: center; padding: 0 12px 10px; background: #fff; }

@media (prefers-reduced-motion: reduce) {
  .shc-launcher, .shc-typing span { transition: none; animation: none; }
}
