/* CE Chatbot（2026-11: 色はコーポレートカラー #00376d と灰だけ） */
.cecb {
  --cecb-navy: #00376d;
  --cecb-navy-hover: #004a8f;
  --cecb-key: #00376d;
  --cecb-key-hover: #002a54;
  --cecb-line: #dcdcdc;
  --cecb-text: #1f1f1f;
  font-family: inherit;
  line-height: 1.6;
}
.cecb[hidden],
.cecb [hidden] { display: none !important; }
.cecb button { font-family: inherit; cursor: pointer; }

/* 呼び出しボタン: PC・スマホとも右下の丸ボタン（2026-11: 右端中央の縦タブは本文に重なるため廃止） */
.cecb-tab { display: none; }
.cecb-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border: 0; border-radius: 9999px;
  background: var(--cecb-navy); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 55, 109, .35); transition: background-color .2s, transform .3s, opacity .3s;
}
.cecb-fab:hover { background: var(--cecb-navy-hover); }
.cecb-fab img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
@media (min-width: 1024px) { .cecb-fab { right: 24px; bottom: 24px; } }
/* 記事ページは画面下に追従バーが出るため、その上に置く */
body.single .cecb-fab { bottom: 84px; }
@media (min-width: 1024px) { body.single .cecb-fab { bottom: 88px; } }
.cecb.is-open .cecb-tab, .cecb.is-open .cecb-fab { opacity: 0; pointer-events: none; }

/* チャット画面 */
.cecb-overlay { position: fixed; inset: 0; z-index: 9997; background: rgba(0, 0, 0, .3); }
@media (min-width: 1024px) { .cecb-overlay { display: none !important; } }
.cecb-panel {
  position: fixed; z-index: 9998; display: flex; flex-direction: column; overflow: hidden;
  left: 12px; right: 12px; top: 50%; transform: translateY(-50%); height: 72vh; max-height: 640px;
  background: #fff; border: 1px solid var(--cecb-line); border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
  color: var(--cecb-text); font-size: 14px;
}
@media (min-width: 1024px) {
  .cecb-panel { left: auto; right: 24px; top: auto; bottom: 24px; transform: none; width: 400px; height: 600px; max-height: calc(100vh - 120px); }
}
.cecb-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--cecb-navy); color: #fff; }
.cecb-head img { width: 32px; height: 32px; border-radius: 50%; background: #fff; object-fit: cover; }
.cecb-title { margin: 0; font-weight: 700; font-size: 14px; }
.cecb-subtitle { margin: 0; font-size: 11px; opacity: .8; }
.cecb-close { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 18px; line-height: 1; }
.cecb-close:hover { background: rgba(255, 255, 255, .3); }
.cecb-log { flex: 1; overflow-y: auto; padding: 16px 14px; background: #f4f4f4; display: flex; flex-direction: column; gap: 10px; }
.cecb-msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; animation: cecb-in .25s ease-out; }
.cecb-msg p { margin: 0; font-size: 14px; }
.cecb-bot { align-self: flex-start; background: #fff; border: 1px solid var(--cecb-line); border-top-left-radius: 4px; }
.cecb-user { align-self: flex-end; background: var(--cecb-navy); color: #fff; border-top-right-radius: 4px; }
.cecb-typing { align-self: flex-start; padding: 10px 14px; color: #666; font-size: 12px; }
.cecb-choices { display: flex; flex-direction: column; gap: 8px; animation: cecb-in .25s ease-out; }
.cecb-choice {
  text-align: left; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 12px; background: #fff;
  color: var(--cecb-navy); font-size: 14px; font-weight: 500; transition: border-color .2s, background-color .2s;
}
.cecb-choice:hover, .cecb-choice:focus-visible { border-color: var(--cecb-key); background: #f4f4f4; outline: none; }
.cecb-action {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 9999px;
  border: 1px solid #cbd5e1; background: #fff; color: #475569; font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background-color .2s, box-shadow .2s, transform .2s;
}
.cecb-action:hover { color: var(--cecb-navy); border-color: rgba(0, 55, 109, .3); }
.cecb-action-primary { background: var(--cecb-key); border-color: var(--cecb-key); color: #fff; }
.cecb-action-primary:hover { background: var(--cecb-key-hover); color: #fff; }
.cecb-foot { padding: 8px 14px; border-top: 1px solid var(--cecb-line); background: #fff; text-align: center; }
.cecb-reset { border: 0; background: none; color: #666; font-size: 12px; text-decoration: underline; }
@keyframes cecb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cecb-msg, .cecb-choices { animation: none; }
}
