/* voice-chat.css — 「鹿児島を、語ろう。」声を届けるチャット
   テーマの style.css のデザイントークン（--red, --ink など）をそのまま使う */

.vc {
  --vc-red: var(--red);
  --vc-red-deep: var(--red-deep);
  --vc-red-pale: var(--red-pale);
  --vc-ink: var(--ink);
  --vc-ink-2: var(--ink-2);
  --vc-mute: var(--mute);
  --vc-line: var(--line);
  --vc-line-2: var(--line-2);
  --vc-paper: var(--paper);
  --vc-bg-2: var(--bg-2);

  background: var(--vc-paper);
  border: 1px solid var(--vc-line-2);
  border-top: 4px solid var(--vc-ink);
  display: flex;
  flex-direction: column;
  font-family: var(--gothic);
  color: var(--vc-ink);
  min-width: 0;
}

.vc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--vc-line);
}
.vc-head-l { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vc-stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 700;
  background: var(--vc-ink);
  color: #fff;
  padding: 3px 10px;
}
.vc-progress {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--vc-mute);
}
.vc-switch {
  background: none;
  border: none;
  padding: 4px 0;
  font: inherit;
  font-size: 13px;
  color: var(--vc-red);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

/* ---- log ---- */
.vc-log {
  height: min(520px, 62vh);
  overflow-y: auto;
  padding: 20px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  scroll-behavior: smooth;
}
.vc-msg {
  max-width: 82%;
  padding: 12px 16px;
  font-size: 15px;
  line-height: 1.8;
  word-break: break-word;
  animation: vc-in .22s ease-out;
}
.vc-bot {
  align-self: flex-start;
  background: var(--vc-paper);
  border: 1px solid var(--vc-line-2);
  border-left: 4px solid var(--vc-red);
  font-family: var(--mincho);
}
.vc-user {
  align-self: flex-end;
  background: var(--vc-ink);
  color: #fff;
  white-space: pre-wrap;
}

.vc-typing { display: inline-flex; gap: 5px; align-items: center; padding: 16px 18px; }
.vc-typing span {
  width: 6px; height: 6px; background: var(--vc-mute); border-radius: 50%;
  animation: vc-dot 1s infinite ease-in-out;
}
.vc-typing span:nth-child(2) { animation-delay: .15s; }
.vc-typing span:nth-child(3) { animation-delay: .3s; }

/* ---- summary ---- */
.vc-summary-lead { margin: 0 0 8px; font-weight: 700; }
.vc-summary { margin: 0; font-family: var(--gothic); font-size: 14px; }
.vc-summary dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--vc-mute);
  margin-top: 10px;
}
.vc-summary dd { margin: 2px 0 0; white-space: pre-wrap; }

/* ---- dock (choices + input) ---- */
.vc-dock {
  border-top: 1px solid var(--vc-line);
  padding: 12px 16px 14px;
  background: var(--vc-paper);
}
.vc-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.vc-choices:empty { display: none; }
.vc-choices + .vc-input:not([hidden]) { margin-top: 10px; }

.vc-chip {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--vc-red);
  background: var(--vc-paper);
  color: var(--vc-red);
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.vc-chip:hover { background: var(--vc-red-pale); transform: translateY(-1px); }
.vc-chip:focus-visible, .vc-send:focus-visible, .vc-switch:focus-visible {
  outline: 2px solid var(--vc-ink); outline-offset: 2px;
}
.vc-chip-primary { background: var(--vc-red); color: #fff; border-color: var(--vc-red); }
.vc-chip-primary:hover { background: var(--vc-red-deep); border-color: var(--vc-red-deep); }
.vc-chip-skip {
  border-color: var(--vc-line-2);
  color: var(--vc-ink-2);
  font-weight: 400;
}
.vc-chip-skip:hover { background: var(--vc-bg-2); }

.vc-input-row { display: flex; gap: 8px; align-items: flex-end; }
.vc-text {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--vc-line-2);
  font: inherit;
  font-size: 16px;               /* iOS でズームしないように 16px 以上 */
  line-height: 1.7;
  resize: none;
  background: var(--vc-paper);
  color: var(--vc-ink);
}
.vc-text:focus { outline: 2px solid var(--vc-red); outline-offset: -1px; }
.vc-send {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--vc-red);
  color: #fff;
  border: 2px solid var(--vc-red);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .15s;
}
.vc-send:hover { background: var(--vc-red-deep); border-color: var(--vc-red-deep); transform: translateY(-1px); }
.vc-hint { margin: 6px 0 0; font-size: 12px; color: var(--vc-mute); }

.vc-shake { animation: vc-shake .35s; outline: 2px solid var(--vc-red); }

/* 元のフォームを隠す（テーマの display:flex より優先） */
.vc-hidden-form[hidden] { display: none !important; }

/* 「フォームで書く」に切り替えたとき */
.vc.vc-collapsed .vc-log,
.vc.vc-collapsed .vc-dock { display: none; }
.vc.vc-collapsed + .vc-hidden-form { margin-top: 20px; }

@keyframes vc-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes vc-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes vc-shake { 0%,100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  .vc-msg, .vc-typing span, .vc-shake { animation: none; }
  .vc-log { scroll-behavior: auto; }
}

@media (max-width: 600px) {
  .vc-log { height: 64vh; padding: 16px 12px 8px; }
  .vc-msg { max-width: 90%; font-size: 14px; }
  .vc-head, .vc-dock { padding-left: 12px; padding-right: 12px; }
  .vc-chip { font-size: 13px; padding: 8px 12px; }
}

/* ============================================================
   右下パネル（footer.php の .vc-float）— モバイルファースト
   ============================================================ */
.vc-float__launcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 110;                  /* 固定ヘッダー(100)・スマホ追従CTA(99)より前に出す */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  font-family: var(--gothic);
  font-size: 14px;
  font-weight: 700;
  color: var(--paper);
  background: var(--red);
  border: 2px solid var(--red);
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(20, 17, 13, .25);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.vc-float__launcher:hover { background: var(--red-deep); border-color: var(--red-deep); transform: translateY(-2px); }
.vc-float__launcher:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.vc-float__icon { flex-shrink: 0; }

/* トップページのスマホ追従CTAと重ならないよう、その上に逃がす */
body:has(.mobile-float-cta) .vc-float__launcher { bottom: 84px; }

/* スマホでは入力しやすいよう全画面で開く */
.vc-float__panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.vc-float__panel[hidden] { display: none; }
.vc-float--open .vc-float__launcher { display: none; }

.vc-float__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  background: var(--ink);
  color: var(--paper);
}
.vc-float__title { font-size: 14px; font-weight: 700; }
.vc-float__close {
  width: 44px;
  height: 44px;
  font-size: 24px;
  line-height: 1;
  color: var(--paper);
  background: none;
  border: none;
  cursor: pointer;
}
.vc-float__close:focus-visible { outline: 2px solid var(--paper); outline-offset: -4px; }

.vc-float__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;              /* 「フォームで書く」に切り替えたときにスクロールできるように */
}
.vc-float__body .vc { flex: 1; min-height: 0; padding: 0; border-left: 0; border-right: 0; border-bottom: 0; }  /* style.css の section の上下余白を打ち消す */
.vc-float__body .vc-log { flex: 1; height: auto; min-height: 200px; }
.vc-float__body .vc.vc-collapsed { flex: 0 0 auto; }
.vc-float__body .submit-form { padding: 0 16px 16px; }
.vc-float__body .form-msg { margin: 12px 16px; }

@media (min-width: 601px) {
  .vc-float__launcher,
  body:has(.mobile-float-cta) .vc-float__launcher { right: 24px; bottom: 24px; }

  .vc-float__panel {
    inset: auto 24px 24px auto;
    width: 400px;
    height: min(640px, calc(100vh - 48px));
    border: 1px solid var(--line-2);
    box-shadow: 0 12px 40px rgba(20, 17, 13, .25);
  }
  .vc-float__body .submit-form .row { grid-template-columns: 1fr; }  /* 幅400pxでは3列が窮屈 */
}

@media (prefers-reduced-motion: reduce) {
  .vc-float__launcher { transition: none; }
  .vc-float__launcher:hover { transform: none; }
}
