/* LP 常駐の質問ランチャー。支援ツールの読み上げ順を変えないよう、DOM は末尾に置く。 */
.qa-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* 常駐ボタンは文言でなく記号にする。読み上げ用の名前は aria-label で持つ。 */
.qa-launcher-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--brand-primary, #2f6df6);
  background: var(--brand-primary, #2f6df6);
  color: #fff;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
}

.qa-launcher-button svg {
  width: 26px;
  height: 26px;
}

.qa-launcher-hint {
  /* 閉じるボタンを本文の右に並べる。重ねて逃げる余白を取ると、
     本文の折り返しが早まったうえ 1 行目の末尾に空きが残る。 */
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  max-width: 220px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.14);
}

.qa-launcher-hint-close,
.qa-launcher-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: inherit;
}

.qa-launcher-hint-text {
  flex: 1;
}

.qa-launcher-hint-close {
  flex: none;
  padding: 0;
  line-height: 1.6;
}

.qa-launcher-panel {
  width: min(380px, calc(100vw - 40px));
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.qa-launcher-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  /* 下だけ 1px 多いのは、上側にだけパネルの枠線 1px が入るため。見出しの上下の余白を揃える */
  padding: 12px 12px 13px 16px;
}

/* support.css の上マージンは /support ページで見出しと離すためのもの。パネル内では見出しの余白で足りる */
.qa-launcher-panel .support-chat-panel {
  margin-top: 0;
}

.qa-launcher-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.qa-launcher-close {
  padding: 6px 10px;
}

.qa-launcher-button:focus-visible,
.qa-launcher-close:focus-visible,
.qa-launcher-hint-close:focus-visible {
  outline: 2px solid var(--brand-primary, #2f6df6);
  outline-offset: 2px;
}

/* 狭い画面ではミニウィンドウが成立しないので、全画面シートにする。 */
@media (max-width: 767px) {
  .qa-launcher {
    right: 12px;
    bottom: 12px;
    left: 12px;
    align-items: flex-end;
  }

  /* 全画面シートの display 指定が hidden を上書きしないようにする。 */
  .qa-launcher-panel[hidden] {
    display: none;
  }

  .qa-launcher-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .qa-launcher-button {
    align-self: flex-end;
  }
}
