/* FAQ chat widget (scoped from vercel-faq-prototype public/styles.css) */
.faq-chat-root {
  --faq-ink: #2a2428;
  --faq-muted: #6a5f66;
  --faq-line: rgba(45, 30, 40, 0.12);
  --faq-pink: #ff5fa6;
  --faq-yellow: #ffe166;
  --faq-shadow: 0 14px 40px rgba(42, 36, 40, 0.14);
  --faq-radius: 18px;
  font-family: 'Noto Sans JP', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--faq-ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Prevent theme CSS from breaking sizing inside widget */
.faq-chat-root,
.faq-chat-root *,
.faq-chat-root *::before,
.faq-chat-root *::after {
  box-sizing: border-box;
}

.faq-chat-root .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.faq-chat-root .chat-launcher {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 70px;
  height: 70px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: transparent;
  z-index: 99998;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  isolation: isolate;
  overflow: hidden;
}

.faq-chat-root .chat-launcher__ring {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 45%, rgba(255, 225, 102, 0.95), rgba(255, 95, 166, 0.55));
  box-shadow: 0 14px 30px rgba(42, 36, 40, 0.24);
  transform: translateZ(0);
  z-index: 0;
  pointer-events: none;
}

.faq-chat-root .chat-launcher__img {
  position: relative;
  z-index: 1;
  display: block;
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.95);
  flex: 0 0 auto;
}

.faq-chat-root .chat-launcher__fallback {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.95);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  color: var(--faq-pink);
  flex: 0 0 auto;
}

.faq-chat-root .chat-launcher:active {
  transform: translateY(1px) scale(0.99);
}

.faq-chat-root .chat {
  position: fixed;
  right: 16px;
  bottom: 96px;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 140px));
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(42, 36, 40, 0.14);
  box-shadow: var(--faq-shadow);
  overflow: hidden;
  display: none;
  z-index: 99999;
  backdrop-filter: blur(8px);
}

.faq-chat-root .chat[data-open='true'] {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.faq-chat-root .chat__header {
  flex-shrink: 0;
  padding: 12px 12px;
  background: linear-gradient(90deg, rgba(255, 225, 102, 0.72), rgba(255, 95, 166, 0.26));
  border-bottom: 1px solid rgba(42, 36, 40, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.faq-chat-root .chat__header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.faq-chat-root .chat__avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.95);
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.faq-chat-root .chat__avatar-img,
.faq-chat-root .chat__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

.faq-chat-root .chat__avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 11px;
  font-weight: 900;
  color: rgba(42, 36, 40, 0.65);
}

.faq-chat-root .chat__meta {
  min-width: 0;
}

.faq-chat-root .chat__title {
  font-weight: 900;
  font-size: 14px;
  line-height: 1.1;
}

.faq-chat-root .chat__subtitle {
  font-size: 11px;
  color: rgba(42, 36, 40, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.faq-chat-root .chat__header-right {
  display: flex;
  gap: 6px;
}

.faq-chat-root .icon-btn {
  border: 1px solid rgba(42, 36, 40, 0.14);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  width: 36px;
  height: 32px;
  cursor: pointer;
  font-weight: 700;
}

.faq-chat-root .icon-btn:active {
  transform: translateY(1px);
}

.faq-chat-root .chat__messages {
  flex: 1 1 0;
  min-height: 0;
  padding: 12px 12px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(240px 200px at 80% 10%, rgba(255, 225, 102, 0.22), transparent 70%),
    radial-gradient(240px 200px at 10% 30%, rgba(255, 95, 166, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 246, 247, 0.74));
}

.faq-chat-root .msg {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.faq-chat-root .msg--user {
  justify-content: flex-end;
}

.faq-chat-root .bubble {
  max-width: 82%;
  border-radius: 16px;
  padding: 10px 12px;
  line-height: 1.6;
  font-size: 13px;
  border: 1px solid rgba(42, 36, 40, 0.12);
}

.faq-chat-root .bubble--bot {
  background: rgba(255, 255, 255, 0.92);
}

.faq-chat-root .bubble--user {
  background: linear-gradient(180deg, rgba(255, 95, 166, 0.25), rgba(255, 225, 102, 0.18));
}

.faq-chat-root .bubble--typing {
  padding: 10px 14px;
}

.faq-chat-root .dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
}

.faq-chat-root .dots > span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(42, 36, 40, 0.42);
  animation: wp-faq-chat-dot 1.05s infinite ease-in-out;
}

.faq-chat-root .dots > span:nth-child(2) {
  animation-delay: 0.15s;
}

.faq-chat-root .dots > span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes wp-faq-chat-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-4px);
    opacity: 0.95;
  }
}

.faq-chat-root .bubble__title {
  font-weight: 900;
  margin: 0 0 6px;
  font-size: 13px;
}

.faq-chat-root .bubble__text {
  margin: 0;
  color: rgba(42, 36, 40, 0.86);
  white-space: pre-wrap;
  word-break: break-word;
}

.faq-chat-root .bubble__inline-link {
  color: #1a6bb3;
  font-weight: 700;
  text-decoration: underline;
}

.faq-chat-root .bubble__hint {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(42, 36, 40, 0.62);
}

.faq-chat-root .bubble__actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-chat-root .bubble__link {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #1a6bb3;
  text-decoration: underline;
}

.faq-chat-root .chat__quick {
  flex-shrink: 0;
  padding: 10px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(42, 36, 40, 0.1);
  background: rgba(255, 255, 255, 0.86);
  max-height: 50%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.faq-chat-root .chat__quick::-webkit-scrollbar {
  width: 6px;
}

.faq-chat-root .chat__quick::-webkit-scrollbar-thumb {
  background: rgba(42, 36, 40, 0.22);
  border-radius: 999px;
}

.faq-chat-root .qr {
  border: 1px solid rgba(42, 36, 40, 0.14);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
}

.faq-chat-root .qr--primary {
  border-color: rgba(255, 95, 166, 0.55);
  background: linear-gradient(180deg, rgba(255, 95, 166, 0.22), rgba(255, 225, 102, 0.16));
  font-weight: 700;
}

.faq-chat-root .qr:active {
  transform: translateY(1px);
}

.faq-chat-root .chat__composer {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 10px;
  row-gap: 8px;
  align-items: center;
  padding: 10px 10px 12px;
  background: rgba(255, 255, 255, 0.92);
}

.faq-chat-root .chat__input-wrap {
  display: block;
  min-width: 0;
}

.faq-chat-root .chat__input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(42, 36, 40, 0.16);
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.92);
}

.faq-chat-root .chat__input:focus {
  border-color: rgba(255, 95, 166, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 95, 166, 0.12);
}

.faq-chat-root .chat__send {
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 900;
  color: rgba(42, 36, 40, 0.92);
  background: linear-gradient(180deg, rgba(255, 225, 102, 0.95), rgba(255, 95, 166, 0.25));
  border: 1px solid rgba(42, 36, 40, 0.12);
  min-width: 64px;
  white-space: nowrap;
}

.faq-chat-root .chat__send:active {
  transform: translateY(1px);
}
