/* =========================================================
   Paletta チャットボット風・選択式コンテンツ
========================================================= */
.pcb-root{
  --pcb-accent: #535472;
  --pcb-accent-dark: #2F2A3C;
  --pcb-line: #DCDDE3;
  font-family: "Noto Sans JP", sans-serif;
}

/* ---------- 追従タブ ---------- */
.pcb-tab{
  position: fixed;
  right: 0;
  top: 58%;
  transform: translate(110%, -50%);
  z-index: 99990;
  transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .3s ease;
  opacity: 0;
  pointer-events: none;
}
.pcb-tab.is-visible{
  transform: translate(0, -50%);
  opacity: 1;
  pointer-events: auto;
}
.pcb-tab__open{
  appearance: none;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 16px;
  background: linear-gradient(160deg, #63648A 0%, var(--pcb-accent-dark) 100%);
  color: #fff;
  border-radius: 14px 0 0 14px;
  box-shadow: 0 10px 30px rgba(47,42,60,.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pcb-tab__open:hover{
  transform: translateX(-4px);
  box-shadow: 0 14px 34px rgba(47,42,60,.42);
}
.pcb-tab__avatar{
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
.pcb-tab__avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pcb-tab__text{
  display: flex;
  gap: 6px;
  writing-mode: vertical-rl;
  font-feature-settings: "vpal";
  letter-spacing: .14em;
  line-height: 1.25;
}
.pcb-tab__line1{ font-size: 13px; font-weight: 700; }
.pcb-tab__line2{ font-size: 11px; opacity: .85; }
.pcb-tab__text--sp{ display: none; }

.pcb-tab__close{
  position: absolute;
  top: -10px;
  left: -10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--pcb-line);
  background: #fff;
  color: #666;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.18);
  z-index: 1;
}
.pcb-tab__close:hover{ color: #000; }

/* 50%スクロール時の演出 */
@keyframes pcbWiggle{
  0%,100%{ transform: translate(0,-50%); }
  20%{ transform: translate(-6px,-50%); }
  40%{ transform: translate(0,-50%); }
  60%{ transform: translate(-4px,-50%); }
  80%{ transform: translate(0,-50%); }
}
.pcb-tab.is-visible.is-wiggle{ animation: pcbWiggle 1.1s ease; }

/* ---------- チャットウィンドウ ---------- */
.pcb-win{
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 372px;
  max-width: calc(100vw - 24px);
  height: 580px;
  max-height: min(80vh, 640px);
  background: #F6F6F9;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(31,28,44,.30);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 99991;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.22,1,.36,1);
}
.pcb-win.is-open{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.pcb-win__head{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #63648A 0%, var(--pcb-accent-dark) 100%);
  color: #fff;
  flex: 0 0 auto;
}
.pcb-win__avatar{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.8);
  flex: 0 0 auto;
}
.pcb-win__avatar img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.pcb-win__title{
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  flex: 1 1 auto;
}
.pcb-win__close{
  appearance: none;
  border: 0;
  background: rgba(255,255,255,.14);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.pcb-win__close:hover{ background: rgba(255,255,255,.26); }

.pcb-win__body{
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 16px 22px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- メッセージ ---------- */
.pcb-msg{
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.pcb-msg__avatar{
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  margin-top: 2px;
}
.pcb-msg__avatar img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.pcb-msg__bubble{
  background: #fff;
  border-radius: 4px 14px 14px 14px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #333;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.pcb-msg__bubble p{ margin: 0 0 .6em; }
.pcb-msg__bubble p:last-child{ margin-bottom: 0; }
.pcb-msg__lead{ font-weight: 700; }
.pcb-result__heading{
  font-weight: 700;
  font-size: 15px;
  color: var(--pcb-accent-dark);
}

.pcb-note{
  font-size: 11.5px;
  color: #888;
}
.pcb-note--center{ text-align: center; margin: 14px 0 0; }

/* ---------- 進捗 ---------- */
.pcb-progress{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.pcb-progress__num{
  font-size: 12px;
  font-weight: 700;
  color: var(--pcb-accent);
  flex: 0 0 auto;
}
.pcb-progress__bar{
  flex: 1 1 auto;
  height: 5px;
  background: #E4E5EC;
  border-radius: 99px;
  overflow: hidden;
}
.pcb-progress__bar span{
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7F82A3, var(--pcb-accent));
  border-radius: 99px;
  transition: width .3s ease;
}

/* ---------- 選択肢 ---------- */
.pcb-options{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px 42px;
}
.pcb-opt{
  appearance: none;
  border: 1.5px solid var(--pcb-line);
  background: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  color: #333;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .1s ease;
}
.pcb-opt:hover{
  border-color: var(--pcb-accent);
  background: #F4F4F9;
}
.pcb-opt:active{ transform: scale(.985); }
.pcb-opt.is-selected{
  border-color: var(--pcb-accent);
  background: var(--pcb-accent);
  color: #fff;
  font-weight: 600;
}

/* ---------- ボタン・リンク ---------- */
.pcb-actions{
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 4px;
}
.pcb-actions--between{ justify-content: space-between; align-items: center; }
.pcb-actions--col{ flex-direction: column; align-items: stretch; margin-left: 42px; }
.pcb-btn{
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: transform .12s ease, opacity .2s ease, background .2s ease;
}
.pcb-btn--primary{
  background: var(--pcb-accent-dark);
  color: #fff;
  box-shadow: 0 8px 20px rgba(47,42,60,.28);
}
.pcb-btn--primary:hover{ opacity: .9; }
.pcb-btn--primary:disabled{ opacity: .4; cursor: default; }
.pcb-btn--outline{
  background: #fff;
  color: var(--pcb-accent);
  border: 1.5px solid var(--pcb-accent);
}
.pcb-btn--outline:hover{ background: #F4F4F9; }
.pcb-btn:active{ transform: translateY(1px); }

.pcb-link{
  appearance: none;
  border: 0;
  background: none;
  color: #777;
  font-size: 12.5px;
  cursor: pointer;
  padding: 6px 4px;
}
.pcb-link:hover{ color: var(--pcb-accent); text-decoration: underline; }
.pcb-link--center{ display: block; margin: 10px auto 0; }

/* ---------- 問い合わせフォーム上のサマリー ---------- */
.pcb-summary{
  margin: 0 0 20px;
  padding: 16px 18px;
  background: #F4F4F9;
  border: 1px solid var(--pcb-line);
  border-left: 4px solid #535472;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.9;
  color: #333;
}
.pcb-summary__ttl{
  margin: 0 0 6px;
  font-weight: 700;
  color: #2F2A3C;
}
.pcb-summary p{ margin: 0; }

/* ---------- SP ---------- */
@media (max-width: 767px){
  .pcb-tab{
    top: auto;
    bottom: 96px; /* フッター追従CTAと重ならない位置 */
    transform: translate(110%, 0);
  }
  .pcb-tab.is-visible{ transform: translate(0, 0); }
  @keyframes pcbWiggle{
    0%,100%{ transform: translate(0,0); }
    20%{ transform: translate(-6px,0); }
    40%{ transform: translate(0,0); }
    60%{ transform: translate(-4px,0); }
    80%{ transform: translate(0,0); }
  }
  .pcb-tab__open{
    flex-direction: row;
    padding: 8px 12px 8px 8px;
    gap: 8px;
    border-radius: 999px 0 0 999px;
  }
  .pcb-tab__avatar{ width: 44px; height: 44px; }
  .pcb-tab__text{ display: none; }
  .pcb-tab__text--sp{
    display: flex;
    flex-direction: column;
    gap: 0;
    writing-mode: horizontal-tb;
    letter-spacing: .06em;
    text-align: left;
  }
  .pcb-tab__text--sp .pcb-tab__line1{ font-size: 12px; }
  .pcb-tab__text--sp .pcb-tab__line2{ font-size: 10.5px; }

  .pcb-win{
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: 86vh;
    max-height: 86vh;
    border-radius: 18px 18px 0 0;
  }
  .pcb-options{ margin-left: 0; }
  .pcb-actions--col{ margin-left: 0; }
}

/* 縦書きタブ内の数字を横並びにする（縦中横） */
.pcb-tcy{
  text-combine-upright: all;
  -webkit-text-combine: horizontal; /* 旧Safari向け */
}
