/* ============================================================
   chatbot.css — Voyager AI chat widget / キャラ：ナビ
   ============================================================ */

/* ── Floating button (closed) ─────────────────────────────── */
.cb-fab {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 9990;
  display: flex;
  align-items: flex-end;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: opacity .22s, transform .22s;
}
.cb-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(.85) translateY(16px);
}
.cb-fab__char {
  width: 90px;
  height: auto;
  margin-right: -20px;
  position: relative;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(37, 66, 107, .30));
  transition: transform .22s;
}
.cb-fab:hover .cb-fab__char { transform: translateY(-4px); }
.cb-fab__pill {
  background: #1c3254;
  border-radius: 14px;
  padding: 15px 20px 13px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 6px 28px rgba(0, 0, 0, .32);
  min-width: 130px;
  border: none;
  cursor: pointer;
  transition: background .18s, box-shadow .18s;
}
.cb-fab:hover .cb-fab__pill {
  background: #25426B;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .36);
}
.cb-fab__main {
  color: #fff;
  font-weight: 900;
  font-size: 17px;
  line-height: 1.3;
  font-family: 'Noto Sans JP', sans-serif;
  text-align: center;
  pointer-events: none;
}
.cb-fab__sub {
  color: rgba(255, 255, 255, .65);
  font-size: 11px;
  margin-top: 3px;
  font-family: 'Noto Sans JP', sans-serif;
  pointer-events: none;
}

/* ── Panel ────────────────────────────────────────────────── */
.cb-panel {
  position: fixed;
  bottom: 20px;
  right: 16px;
  width: 340px;
  max-height: 580px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 52px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .10);
  display: flex;
  flex-direction: column;
  z-index: 9989;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(.90) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.34, 1.56, .64, 1), opacity .2s;
}
.cb-panel.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ───────────────────────────────────────────────── */
.cb-hdr {
  background: #1c3254;
  padding: 0 14px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.cb-hdr__agent {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.cb-hdr__av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-hdr__av img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.cb-hdr__info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cb-hdr__name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.cb-hdr__status {
  font-size: 10.5px;
  color: rgba(255, 255, 255, .55);
  display: flex;
  align-items: center;
  gap: 4px;
}
.cb-hdr__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}
.cb-hdr__ico {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .70);
  transition: background .15s, color .15s;
  padding: 0;
}
.cb-hdr__ico:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.cb-hdr__ico svg   { pointer-events: none; }
.cb-hdr__ico--close:hover { background: rgba(220, 60, 60, .25); color: #fff; }

/* ── Messages area ────────────────────────────────────────── */
.cb-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
}
.cb-msgs::-webkit-scrollbar { width: 4px; }
.cb-msgs::-webkit-scrollbar-track { background: transparent; }
.cb-msgs::-webkit-scrollbar-thumb { background: #d4dae3; border-radius: 2px; }

/* ── Bot message ──────────────────────────────────────────── */
.cb-msg {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.cb-msg__av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e8f1fb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.cb-msg__av img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.cb-msg__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.cb-msg__bbl {
  background: #EFF5FB;
  border-radius: 4px 12px 12px 12px;
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.75;
  color: #1a1a1a;
  word-break: break-word;
}

/* ── User message ─────────────────────────────────────────── */
.cb-msg--u {
  flex-direction: row-reverse;
  gap: 0;
}
.cb-msg--u .cb-msg__bbl {
  background: #1c3254;
  color: #fff;
  border-radius: 12px 4px 12px 12px;
  max-width: calc(100% - 8px);
  align-self: flex-end;
}

/* ── Typing indicator ─────────────────────────────────────── */
.cb-typing .cb-msg__bbl {
  padding: 13px 16px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.cb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7a8fa6;
  animation: cb-bounce .9s ease-in-out infinite;
}
.cb-dot:nth-child(2) { animation-delay: .15s; }
.cb-dot:nth-child(3) { animation-delay: .30s; }
@keyframes cb-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-5px); }
}

/* ── Option buttons ───────────────────────────────────────── */
.cb-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cb-opt {
  background: #fff;
  border: 1.5px solid #c8d2dd;
  color: #1a2a3a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  line-height: 1.5;
  transition: border-color .15s, background .15s, color .15s;
  font-family: 'Noto Sans JP', sans-serif;
  width: 100%;
}
.cb-opt:hover:not(:disabled) {
  border-color: #25426B;
  background: #f0f5fc;
  color: #1c3254;
}
.cb-opt:disabled {
  opacity: .38;
  cursor: default;
}
.cb-opt--cta {
  border-color: #d4a800;
  background: #fffbe7;
  color: #6b4c00;
  font-weight: 600;
}
.cb-opt--cta:hover:not(:disabled) {
  background: #F3CB00;
  border-color: #F3CB00;
  color: #1c3254;
}

/* ── Input area ───────────────────────────────────────────── */
.cb-foot {
  border-top: 1.5px solid #e8ecf0;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  background: #fff;
}
.cb-inp {
  flex: 1;
  border: none;
  outline: none;
  padding: 0;
  font-size: 13px;
  font-family: 'Noto Sans JP', sans-serif;
  color: #1a1a1a;
  background: transparent;
  min-width: 0;
}
.cb-inp::placeholder { color: #aab3bc; }
.cb-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1c3254;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.cb-send:hover  { background: #25426B; transform: scale(1.06); }
.cb-send svg    { pointer-events: none; }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 767px) {
  .cb-fab  { bottom: 16px; right: 12px; }
  .cb-fab__char { width: 76px; }
  .cb-fab__pill { min-width: 112px; padding: 12px 16px 10px 26px; }
  .cb-fab__main { font-size: 15px; }

  .cb-panel {
    bottom: 0; right: 0; left: 0;
    width: 100%;
    max-height: 84dvh;
    border-radius: 20px 20px 0 0;
    transform-origin: bottom center;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.32, 1.22, .64, 1), opacity .2s;
  }
  .cb-panel.is-open { transform: translateY(0); opacity: 1; }
}
