/* GROW工程管理ページの適合診断（Web接客員・施策A） */
.fit-check {
  --fit-check-main: #10BDC1;
  --fit-check-main-dark: #0b7f82;
  --fit-check-text: #556272;
  --fit-check-ink: #2f3a46;
  --fit-check-cta: #EB6464;
  --fit-check-cta-dark: #c94b4b;
  --fit-check-soft: #e9f0f3;
  --fit-check-line: #d5dde3;
  --fit-check-offset: 0px;

  position: fixed;
  right: 20px;
  bottom: calc(var(--fit-check-offset) + 16px);
  /* #fixed_bar（z-index最大値）より手前に出す。DOM順で後ろに置いているので同値でよい */
  z-index: 2147483647;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: calc(100vw - 32px);
  font-size: 15px;
  line-height: 1.7;
  color: var(--fit-check-ink);
  /* 外枠の透明部分でページのクリックを塞がない */
  pointer-events: none;
}

.fit-check > * {
  pointer-events: auto;
}

.fit-check [hidden] {
  display: none !important;
}

.fit-check button,
.fit-check a {
  font-family: inherit;
}

.fit-check button:focus-visible,
.fit-check a:focus-visible {
  outline: 3px solid var(--fit-check-main-dark);
  outline-offset: 2px;
}

/* ---- 起動ボタン（ジムリン） ---- */
.fit-check__jimrin {
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  transition-property: transform;
  transition-timing-function: linear;
}

/* 登場前は画面の右外にいる */
.fit-check__jimrin.is-offstage {
  transform: translateX(calc(100% + 40px));
}

.fit-check__jimrin-img {
  display: block;
  width: auto;
  height: 110px;
  /* 濃いティールの背景でも埋もれないよう、白いフチをつける（シール風） */
  filter:
    drop-shadow(2px 0 0 #fff)
    drop-shadow(-2px 0 0 #fff)
    drop-shadow(0 2px 0 #fff)
    drop-shadow(0 -2px 0 #fff)
    drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.fit-check__jimrin:not(.is-walking):hover .fit-check__jimrin-img {
  transform: translateY(-4px);
  transition: transform 0.15s ease;
}

/* ---- メルマガの人向けの登場：煙といっしょにボワンと出る ---- */
.fit-check__jimrin {
  position: relative;
}

.fit-check__jimrin.is-popping .fit-check__jimrin-img {
  animation: fit-check-pop 0.45s 0.2s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.fit-check__smoke {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.fit-check__puff {
  position: absolute;
  top: -26px;
  left: -26px;
  width: 52px;
  height: 52px;
  border: 2px solid #a9d8d9;
  border-radius: 50%;
  background: #fff;
  animation: fit-check-puff 0.75s ease-out both;
}

@keyframes fit-check-puff {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.2);
  }
  35% {
    opacity: 1;
    transform: translate(var(--x), var(--y)) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.4);
  }
}

@keyframes fit-check-pop {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  60% {
    opacity: 1;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- 声をかけた瞬間：ぴょんぴょん跳ねて、吹き出しをポンと出す（気づいてもらうため） ---- */
.fit-check__jimrin.is-calling .fit-check__jimrin-img {
  animation: fit-check-hop 0.9s ease-out;
}

.fit-check__nudge.is-arriving {
  transform-origin: 80% 100%;
  animation: fit-check-pop 0.35s 0.1s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

@keyframes fit-check-hop {
  0%, 30%, 60%, 100% {
    transform: translateY(0);
  }
  15% {
    transform: translateY(-14px);
  }
  45% {
    transform: translateY(-8px);
  }
}

/* 動きを減らす設定の人にも、跳ねるのだけは出す（1秒以下の小さい動きで、声かけに気づいてもらうため）。
   吹き出しの飛び出しは止める */
@media (prefers-reduced-motion: reduce) {
  .fit-check__nudge.is-arriving {
    animation: none;
  }
}

/* ---- ジムリンの吹き出し ---- */
.fit-check__nudge {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: 280px;
  max-width: 100%;
  margin-bottom: 2px;
  padding: 4px 4px 4px 0;
  border: 1px solid var(--fit-check-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ジムリンのほうへ向くしっぽ */
.fit-check__nudge::after {
  content: "";
  position: absolute;
  right: 44px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 1px solid var(--fit-check-line);
  border-bottom: 1px solid var(--fit-check-line);
  background: #fff;
  transform: rotate(45deg);
}

.fit-check__nudge-text {
  flex: 1;
  padding: 10px 4px 10px 14px;
  border: none;
  font-size: 14px;
  line-height: 1.7;
  color: var(--fit-check-ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.fit-check__nudge-close,
.fit-check__close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.fit-check__nudge-close {
  color: var(--fit-check-text);
}

/* ---- パネル ---- */
.fit-check__panel {
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: 100%;
  max-height: calc(100vh - var(--fit-check-offset) - 40px);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.fit-check__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 18px;
  color: #fff;
  background: var(--fit-check-main-dark);
}

.fit-check__header-face {
  flex-shrink: 0;
  width: auto;
  height: 34px;
  margin: 2px 0;
}

.fit-check__title {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 15px;
  font-weight: bold;
  line-height: 1.5;
  color: #fff;
  background: none;
}

.fit-check__title::before,
.fit-check__title::after {
  content: none;
}

.fit-check__close {
  margin-left: auto;
  color: #fff;
}

.fit-check__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
}

.fit-check__body p,
.fit-check__body ul {
  margin: 0;
}

.fit-check__bubble {
  padding: 12px 14px;
  border-radius: 12px 12px 12px 3px;
  background: var(--fit-check-soft);
}

.fit-check__talk {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.fit-check__talk-face {
  flex-shrink: 0;
  width: auto;
  height: 72px;
}

.fit-check__talk .fit-check__bubble {
  flex: 1;
}

.fit-check__note {
  font-size: 13px;
  color: var(--fit-check-text);
}

/* ---- 質問 ---- */
.fit-check__progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fit-check__count {
  font-size: 12px;
  color: var(--fit-check-text);
  font-variant-numeric: tabular-nums;
}

.fit-check__bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e3e8ec;
  overflow: hidden;
}

.fit-check__bar-fill {
  height: 100%;
  background: var(--fit-check-main);
  transition: width 0.2s ease;
}

.fit-check__question {
  font-size: 16px;
  font-weight: bold;
  line-height: 1.6;
}

.fit-check__options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fit-check__option {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--fit-check-line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fit-check-ink);
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.fit-check__option:hover {
  border-color: var(--fit-check-main);
  background: #f2fbfb;
}

/* ---- 結果 ---- */
.fit-check__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  list-style: none;
}

.fit-check__chip {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--fit-check-text);
  background: #eef1f3;
}

.fit-check__result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 10px;
}

.fit-check__result--fit {
  border-color: #a9d8d9;
  background: #eef9f9;
}

.fit-check__result--consult {
  border-color: #e3c99a;
  background: #fbf4e8;
}

.fit-check__result-label {
  font-size: 12px;
  font-weight: bold;
  color: var(--fit-check-text);
}

.fit-check__result-verdict {
  font-size: 24px;
  font-weight: bold;
  line-height: 1.4;
}

.fit-check__result--fit .fit-check__result-verdict {
  color: var(--fit-check-main-dark);
}

.fit-check__result--consult .fit-check__result-verdict {
  color: #8a5a12;
}

.fit-check__reasons {
  padding-left: 1.2em;
  list-style: disc;
  font-size: 13px;
  line-height: 1.7;
}

/* ---- FAQ質問（施策B） ---- */
.fit-check__ask {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fit-check__ask-label {
  font-size: 13px;
  font-weight: bold;
  color: var(--fit-check-text);
}

.fit-check__ask-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--fit-check-line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px; /* iPhoneで入力時に拡大されないよう16px */
  line-height: 1.6;
  color: var(--fit-check-ink);
  background: #fff;
  resize: vertical;
}

.fit-check__ask-input:focus {
  outline: 3px solid var(--fit-check-main-dark);
  outline-offset: 1px;
}

.fit-check__answer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--fit-check-line);
  border-radius: 10px;
  background: #fff;
}

.fit-check__answer-q {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.6;
}

.fit-check__answer-a {
  font-size: 14px;
  line-height: 1.8;
}

.fit-check__answer-a p {
  margin: 0;
}

.fit-check__answer-a p + p,
.fit-check__answer-a p + .fit-check__doc-list,
.fit-check__answer-a p + .fit-check__doc-table,
.fit-check__doc-list + p,
.fit-check__doc-table + p {
  margin-top: 8px;
}

/* 製品紹介資料の答え（料金表など） */
.fit-check__doc-list {
  margin: 0;
  padding-left: 1.2em;
  list-style: disc;
}

.fit-check__doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.5;
}

.fit-check__doc-table th,
.fit-check__doc-table td {
  padding: 6px 6px;
  border: 1px solid var(--fit-check-line);
  text-align: left;
  vertical-align: top;
  /* 料金は「月額」と「年額」を2行に分けて書いている */
  white-space: pre-line;
}

.fit-check__doc-table thead th {
  background: var(--fit-check-soft);
  white-space: nowrap;
}

.fit-check__doc-table tbody th {
  font-weight: bold;
}

.fit-check__answer-src {
  font-size: 12px;
  color: var(--fit-check-text);
}

.fit-check__helpful {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fit-check__helpful-label {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--fit-check-text);
}

.fit-check__helpful .fit-check__secondary {
  flex: 1;
}

/* ---- ボタン類 ---- */
.fit-check__primary,
.fit-check__secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

.fit-check__primary {
  border: none;
  color: #fff;
  background: var(--fit-check-main-dark);
}

.fit-check__primary:hover {
  color: #fff;
  background: #096a6c;
}

.fit-check__primary--cta {
  background: var(--fit-check-cta-dark);
}

.fit-check__primary--cta:hover {
  background: #b03f3f;
}

.fit-check__secondary {
  border: 1px solid var(--fit-check-line);
  color: var(--fit-check-ink);
  background: #fff;
}

.fit-check__secondary:hover {
  color: var(--fit-check-ink);
  border-color: var(--fit-check-main);
}

.fit-check__link {
  align-self: center;
  min-height: 44px;
  padding: 0 12px;
  border: none;
  font-size: 13px;
  color: var(--fit-check-main-dark);
  text-decoration: underline;
  background: transparent;
  cursor: pointer;
}

@media screen and (max-width: 768px) {
  .fit-check {
    right: 12px;
    left: 12px;
    align-items: stretch;
    max-width: none;
  }

  .fit-check__jimrin {
    align-self: flex-end;
  }

  .fit-check__jimrin-img {
    height: 80px;
  }

  .fit-check__nudge,
  .fit-check__panel {
    width: auto;
  }
}

/* 利用上限のときに出す、質問の一覧 */
.fit-check__list-label {
  flex-shrink: 0;
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: bold;
  color: var(--fit-check-ink);
}

.fit-check__list {
  /* パネルの中で縮められて潰れないように */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--fit-check-line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.fit-check__list-item {
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--fit-check-line);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
  color: var(--fit-check-ink);
  background: #fff;
  cursor: pointer;
}

.fit-check__list-item:last-child {
  border-bottom: none;
}

.fit-check__list-item:hover {
  background: var(--fit-check-soft);
}
