.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Noto Sans JP', sans-serif;
}
.chat-widget__trigger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.chat-widget__trigger:hover { transform: scale(1.1); }
.chat-widget__bubble {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: #2a2d3e;
  color: #ccc;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  opacity: 0;
  animation: chatBubbleFade 5s ease-in-out 2s forwards;
}
.chat-widget__bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 22px;
  width: 12px;
  height: 12px;
  background: #2a2d3e;
  transform: rotate(45deg);
}
@keyframes chatBubbleFade {
  0%,100% { opacity: 0; }
  10%,80% { opacity: 1; }
}
.chat-widget__window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  height: 440px;
  background: #1a1d2e;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}
.chat-widget__header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #4ade80, #22d3ee);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-widget__header-title { font-size: 14px; font-weight: 700; color: #000; margin: 0; }
.chat-widget__header-sub { font-size: 10px; color: #0a0e1a; margin: 0; }
.chat-widget__close {
  background: none; border: none; color: #000; font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.chat-widget__messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-widget__msg {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 85%;
  word-break: break-word;
}
.chat-widget__msg--bot {
  background: #2a2d3e; color: #ccc; border-bottom-left-radius: 2px; align-self: flex-start;
}
.chat-widget__msg--user {
  background: #4ade80; color: #000; border-bottom-right-radius: 2px; align-self: flex-end;
}
.chat-widget__msg--loading {
  background: #2a2d3e; color: #888; align-self: flex-start;
}
.chat-widget__msg--error {
  background: #3a1a1a; color: #ef4444; align-self: flex-start;
}
.chat-widget__msg strong { font-weight: 700; }
.chat-widget__msg ul { margin: 4px 0; padding-left: 16px; }
.chat-widget__msg li { margin: 2px 0; }
.chat-widget__input-area {
  padding: 12px; border-top: 1px solid #333; display: flex; gap: 8px;
}
.chat-widget__input {
  flex: 1; padding: 10px 14px; background: #2a2d3e; border: 1px solid #333;
  border-radius: 8px; color: #fff; font-size: 13px; outline: none;
}
.chat-widget__input:focus { border-color: #4ade80; }
.chat-widget__input::placeholder { color: #666; }
.chat-widget__send {
  width: 40px; height: 40px; background: #4ade80; border: none; border-radius: 8px;
  color: #000; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.chat-widget__send:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 767px) {
  .chat-widget { bottom: 80px; right: 12px; }
  .chat-widget__window { width: calc(100vw - 24px); right: -8px; height: 380px; }
  .chat-widget__bubble { display: none; }
}
