/* =========================================================
   ワキザシ チャット受付 — スタイル（#wdx-chat 配下のみ）
   ========================================================= */
#wdx-chat {
  --wdx-ink:    #222222;
  --wdx-ink-2:  #6B6B66;
  --wdx-mist:   #F6F5F0;   /* サイト背景の紙色 */
  --wdx-line:   #E3E1D8;
  --wdx-paper:  #FFFFFF;
  --wdx-accent: #F4E41C;   /* ロゴのイエロー */
  --wdx-accent-2:#E4D300;
  --wdx-seal:   #222222;
  --wdx-font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", YuGothic, Meiryo, system-ui, sans-serif;
  --wdx-r: 14px;
  position: fixed; right: 20px; bottom: 20px; z-index: 99999;
  font-family: var(--wdx-font); font-size: 14px; line-height: 1.65; color: var(--wdx-ink);
  -webkit-font-smoothing: antialiased;
}
#wdx-chat *, #wdx-chat *::before, #wdx-chat *::after { box-sizing: border-box; margin: 0; padding: 0; }
#wdx-chat button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
#wdx-chat :focus-visible { outline: 2px solid var(--wdx-accent); outline-offset: 2px; }

/* ---------- 起動ボタン ---------- */
#wdx-chat .wdx-chat_launcher {
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 20px 0 16px;
  background: var(--wdx-accent); color: var(--wdx-ink); border-radius: 26px;
  box-shadow: 0 8px 24px rgba(34,34,34,.18);
  transition: transform .18s ease, box-shadow .18s ease;
}
#wdx-chat .wdx-chat_launcher:hover { transform: translateY(-2px) rotate(-2deg); box-shadow: 0 12px 28px rgba(34,34,34,.22); }
#wdx-chat .wdx-chat_launcher_dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--wdx-ink);
  box-shadow: 0 0 0 0 rgba(34,34,34,.4); animation: wdx-pulse 2.4s ease-out infinite;
}
#wdx-chat .wdx-chat_launcher_label { font-weight: 700; letter-spacing: .04em; }
#wdx-chat.isActive .wdx-chat_launcher { opacity: 0; pointer-events: none; transform: translateY(8px); }
@keyframes wdx-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,34,34,.4); } 70% { box-shadow: 0 0 0 10px rgba(34,34,34,0); } 100% { box-shadow: 0 0 0 0 rgba(34,34,34,0); } }

/* ---------- パネル ---------- */
#wdx-chat .wdx-chat_panel {
  position: absolute; right: 0; bottom: 0;
  width: 372px; height: min(600px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--wdx-paper); border: 1px solid var(--wdx-line); border-radius: var(--wdx-r);
  box-shadow: 0 20px 60px rgba(28,35,49,.24);
  opacity: 0; transform: translateY(12px) scale(.98); transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease;
}
#wdx-chat .wdx-chat_panel[hidden] { display: none; }
#wdx-chat.isActive .wdx-chat_panel { opacity: 1; transform: none; }

#wdx-chat .wdx-chat_head {
  position: relative; padding: 16px 48px 14px 18px;
  background: var(--wdx-accent); color: var(--wdx-ink);
}
#wdx-chat .wdx-chat_head_title { font-size: 15px; font-weight: 700; letter-spacing: .06em; }
#wdx-chat .wdx-chat_head_title::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px;
  border-radius: 50%; background: var(--wdx-ink); vertical-align: 1px;
}
#wdx-chat .wdx-chat_head_sub { font-size: 11.5px; opacity: .65; margin-top: 2px; letter-spacing: .02em; }
#wdx-chat .wdx-chat_close {
  position: absolute; top: 12px; right: 10px; width: 34px; height: 34px;
  font-size: 22px; line-height: 1; color: var(--wdx-ink); opacity: .7; border-radius: 8px;
}
#wdx-chat .wdx-chat_close:hover { opacity: 1; background: rgba(34,34,34,.1); }

/* ---------- ログ ---------- */
#wdx-chat .wdx-chat_log {
  flex: 1; overflow-y: auto; padding: 18px 16px 8px;
  background: var(--wdx-mist); scroll-behavior: smooth;
}
#wdx-chat .wdx-chat_msg { max-width: 86%; margin-bottom: 10px; padding: 10px 13px; border-radius: 12px; animation: wdx-in .22s ease both; }
#wdx-chat .wdx-chat_msg p + p { margin-top: 6px; }
#wdx-chat .wdx-chat_msg.isBot { background: var(--wdx-paper); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(28,35,49,.06); }
#wdx-chat .wdx-chat_msg.isUser { margin-left: auto; background: var(--wdx-ink); color: #fff; border-bottom-right-radius: 4px; }
#wdx-chat .wdx-chat_msg.isTyping { display: flex; gap: 4px; padding: 13px 14px; width: 54px; }
#wdx-chat .wdx-chat_msg.isTyping span { width: 6px; height: 6px; border-radius: 50%; background: var(--wdx-ink-2); opacity: .4; animation: wdx-dot 1s infinite; }
#wdx-chat .wdx-chat_msg.isTyping span:nth-child(2) { animation-delay: .15s; }
#wdx-chat .wdx-chat_msg.isTyping span:nth-child(3) { animation-delay: .3s; }
@keyframes wdx-in  { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes wdx-dot { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

/* ---------- 選択肢・CTA ---------- */
#wdx-chat .wdx-chat_choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 18px; padding-right: 4px; animation: wdx-in .25s ease both; }
#wdx-chat .wdx-chat_chip {
  padding: 8px 13px; border-radius: 999px;
  background: var(--wdx-paper); border: 1.5px solid var(--wdx-ink); color: var(--wdx-ink);
  font-size: 13px; font-weight: 700; text-align: left;
  transition: background .15s, transform .15s;
}
#wdx-chat .wdx-chat_chip:hover { background: var(--wdx-accent); transform: translateY(-1px); }
#wdx-chat .wdx-chat_chip.isGhost { border-color: var(--wdx-line); color: var(--wdx-ink-2); font-weight: 500; }
#wdx-chat .wdx-chat_chip.isGhost:hover { background: var(--wdx-paper); color: var(--wdx-ink); border-color: var(--wdx-ink-2); }
#wdx-chat .wdx-chat_cta {
  display: block; width: 100%; padding: 11px 14px; border-radius: 10px;
  background: var(--wdx-accent); color: var(--wdx-ink); text-decoration: none;
  border: 1.5px solid var(--wdx-ink);
  font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
  box-shadow: 3px 3px 0 var(--wdx-ink);
  transition: transform .15s, box-shadow .15s, background .15s;
}
#wdx-chat .wdx-chat_cta::after { content: "→"; float: right; }
#wdx-chat .wdx-chat_cta:hover { background: var(--wdx-accent-2); color: var(--wdx-ink); transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--wdx-ink); }
#wdx-chat .wdx-chat_choices.standby { opacity: .45; pointer-events: none; }

/* ---------- 入力欄 ---------- */
#wdx-chat .wdx-chat_foot {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 10px 10px 8px; background: var(--wdx-paper); border-top: 1px solid var(--wdx-line);
}
#wdx-chat .wdx-chat_home { width: 36px; height: 36px; border-radius: 8px; color: var(--wdx-ink-2); font-size: 18px; }
#wdx-chat .wdx-chat_home:hover { background: var(--wdx-mist); color: var(--wdx-ink); }
#wdx-chat .wdx-chat_input {
  flex: 1; height: 38px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--wdx-ink);
  background: var(--wdx-mist); border: 1px solid transparent; border-radius: 10px; outline: none;
}
#wdx-chat .wdx-chat_input:focus { background: var(--wdx-paper); border-color: var(--wdx-ink); }
#wdx-chat .wdx-chat_send { width: 38px; height: 38px; border-radius: 10px; background: var(--wdx-ink); color: #fff; font-size: 17px; }
#wdx-chat .wdx-chat_send:hover { background: var(--wdx-accent); color: var(--wdx-ink); }

/* ---------- スマホ ---------- */
@media (max-width: 480px) {
  #wdx-chat { right: 12px; bottom: 12px; }
  #wdx-chat .wdx-chat_panel {
    position: fixed; inset: auto 0 0 0; width: 100%; height: 92vh; height: 92dvh;
    border-radius: var(--wdx-r) var(--wdx-r) 0 0; border-bottom: 0;
  }
  #wdx-chat .wdx-chat_input { font-size: 16px; } /* iOS ズーム防止 */
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  #wdx-chat *, #wdx-chat *::before { animation: none !important; transition: none !important; }
}
