/* ============================================================
   面談前ヒアリング チャットボット
   ============================================================ */
:root {
  --ucb-navy: #0A2540;
  --ucb-gold: #C9A961;
  --ucb-gold-d: #B89752;
  --ucb-line: #E3E6EB;
  --ucb-bg: #F7F8FA;
}

/* 起動ボタン */
.ucb-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 16px;
  background: linear-gradient(180deg, var(--ucb-gold), var(--ucb-gold-d));
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(10, 37, 64, 0.25);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ucb-launcher:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(10, 37, 64, 0.32); }
.ucb-launcher svg { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }
.ucb-launcher__pulse {
  position: absolute; top: -3px; right: -3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #e0533a; border: 2px solid #fff;
}
.ucb-launcher.is-hidden { display: none; }

/* パネル */
.ucb-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(10, 37, 64, 0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}
.ucb-panel.is-open { display: flex; }

.ucb-header {
  background: var(--ucb-navy);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ucb-header__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(180deg, var(--ucb-gold), var(--ucb-gold-d));
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff; flex-shrink: 0;
}
.ucb-header__title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.ucb-header__sub { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.ucb-header__close {
  margin-left: auto; background: none; border: none; color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer; opacity: 0.85; padding: 0 4px;
}
.ucb-header__close:hover { opacity: 1; }

.ucb-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background: var(--ucb-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* バブル */
.ucb-row { display: flex; }
.ucb-row--bot { justify-content: flex-start; }
.ucb-row--user { justify-content: flex-end; }
.ucb-bubble {
  max-width: 80%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.ucb-row--bot .ucb-bubble {
  background: #fff;
  color: var(--ucb-navy);
  border: 1px solid var(--ucb-line);
  border-bottom-left-radius: 4px;
}
.ucb-row--user .ucb-bubble {
  background: linear-gradient(180deg, var(--ucb-gold), var(--ucb-gold-d));
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* タイピング */
.ucb-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.ucb-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #b9bfc9;
  animation: ucb-blink 1.2s infinite both;
}
.ucb-typing span:nth-child(2) { animation-delay: 0.2s; }
.ucb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ucb-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* 選択肢・入力 */
.ucb-foot {
  border-top: 1px solid var(--ucb-line);
  background: #fff;
  padding: 12px;
}
.ucb-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ucb-choice {
  background: #fff;
  border: 1.5px solid var(--ucb-gold);
  color: var(--ucb-navy);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.ucb-choice:hover { background: var(--ucb-gold); color: #fff; }
.ucb-choice--primary { background: var(--ucb-navy); border-color: var(--ucb-navy); color: #fff; }
.ucb-choice--primary:hover { background: #143356; }

.ucb-inputrow { display: flex; gap: 8px; }
.ucb-input {
  flex: 1;
  border: 1px solid var(--ucb-line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.ucb-input:focus { border-color: var(--ucb-gold); }
.ucb-send {
  background: var(--ucb-navy);
  color: #fff; border: none; border-radius: 10px;
  padding: 0 16px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit;
}
.ucb-send:hover { background: #143356; }

.ucb-skip {
  display: inline-block; margin-top: 8px;
  background: none; border: none; color: var(--ucb-gold-d);
  font-size: 12px; cursor: pointer; text-decoration: underline; font-family: inherit;
}

/* 戻る */
.ucb-backrow { margin-bottom: 10px; }
.ucb-back {
  background: none; border: none; color: var(--ucb-gold-d);
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; padding: 2px 0;
}
.ucb-back:hover { text-decoration: underline; }

.ucb-note { font-size: 11px; color: #8a909b; text-align: center; padding: 6px 12px 0; }

@media (max-width: 480px) {
  .ucb-panel {
    right: 0; bottom: 0; width: 100vw; height: 100vh;
    max-width: 100vw; max-height: 100vh; border-radius: 0;
  }
  .ucb-launcher { right: 14px; bottom: 14px; padding: 11px 16px; font-size: 13px; }
}
