@charset "UTF-8";
/* ============================================================
   電話の移動屋さん お見積りチャット widget
   ------------------------------------------------------------
   - 既存サイトの CSS と競合しないよう、すべてのクラス名は
     `.mi-` プレフィックスを付けている
   - 位置は fixed（右下固定）、既存レイアウトに影響を与えない
   ============================================================ */

.mi-toggle {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  top: auto;
  right: auto;
  width: calc(100vw - 40px);
  max-width: 460px;                    /* 二つ前の状態に戻す */
  height: auto;
  border-radius: 12px;
  background: #1bd3cb;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(27, 211, 203, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: bold;
  padding: 16px 12px;
  z-index: 9999;
  transition: opacity .2s ease, box-shadow .2s ease;
  font-family: -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  line-height: 1.3;
}
.mi-toggle:hover { opacity: 0.92; }
.mi-toggle.is-hidden { display: none; }
/* 未読バッジ（赤丸の1） */
.mi-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #dc2626;
  color: #fff;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: bold;
  border: 2px solid #fff;
  line-height: 1;
}
/* アイコン＋テキスト */
.mi-toggle-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 22px; }
.mi-toggle-text { display: inline; font-weight: bold; letter-spacing: 0.05em; }
/* 両端にビジネスフォン画像を配置 */
.mi-toggle::before,
.mi-toggle::after {
  content: '';
  display: block;
  width: 60px;
  height: 50px;
  flex-shrink: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.mi-toggle::before {
  background-image: url('bar_dk1.png');
  margin-right: auto;
}
.mi-toggle::after {
  background-image: url('bar_dk2.png');
  margin-left: auto;
}

.mi-chat {
  position: fixed;
  top: 20px;
  bottom: 20px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 774px;                        /* コンテンツと同じ幅 */
  max-width: calc(100vw - 40px);
  height: auto;
  max-height: none;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgb(1 1 1 / 15%);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  font-family: -apple-system, "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  color: #1f2937;
  box-sizing: border-box;
}
.mi-chat *, .mi-chat *::before, .mi-chat *::after { box-sizing: border-box; }
.mi-chat.is-hidden { display: none; }

.mi-head {
  background: linear-gradient(135deg, #0f3a8a, #1e40af);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mi-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: #fffc50; }
.mi-head .sub { font-size: 11px; opacity: .82; margin-top: 2px; }
.mi-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  font-family: inherit;
}
.mi-close:hover { opacity: .75; }

.mi-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f9fafb;
}
.mi-msg { display: flex; margin-bottom: 10px; animation: fadeUp .25s ease; }
.mi-msg.bot { justify-content: flex-start; }
.mi-msg.user { justify-content: flex-end; }
.mi-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.mi-msg.bot .mi-bubble {
  background: #fff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
}
.mi-msg.user .mi-bubble {
  background: #1e40af;
  color: #fff;
  border-bottom-right-radius: 4px;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mi-typing { display: flex; gap: 4px; padding: 8px 0; }
.mi-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: blink 1.2s infinite;
}
.mi-typing span:nth-child(2) { animation-delay: .2s; }
.mi-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40%           { opacity: 1;  transform: translateY(-3px); }
}

.mi-foot {
  border-top: 1px solid #e5e7eb;
  padding: 12px;
  background: #fff;
  max-height: 50%;
  overflow-y: auto;
}
.mi-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.mi-opt {
  background: #fff;
  border: 1.5px solid #1e40af;
  color: #1e40af;
  padding: 8px 12px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
  font-family: inherit;
  line-height: 1.3;
}
.mi-opt:hover { background: #1e40af; color: #fff; }
.mi-opt.primary { background: #1e40af; color: #fff; }
.mi-opt.primary:hover { background: #0f3a8a; }

.mi-checks { display: flex; flex-direction: column; gap: 6px; }
.mi-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
  background: #fff;
  color: #1f2937;
}
.mi-check:hover { border-color: #1e40af; background: #eff6ff; }
.mi-check input {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: #1e40af;
}
.mi-check.checked {
  border-color: #1e40af;
  background: #eff6ff;
  color: #1e40af;
  font-weight: 600;
}

.mi-row { margin-bottom: 8px; }
.mi-row label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: normal;
}
.mi-row .req { color: #dc2626; }
.mi-input, .mi-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #1f2937;
  background: #fff;
}
.mi-input:focus, .mi-textarea:focus {
  outline: none;
  border-color: #1e40af;
}
.mi-textarea { resize: vertical; min-height: 56px; }
.mi-submit {
  background: #1e40af;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  width: 100%;
  margin-top: 6px;
  font-family: inherit;
  line-height: 1.3;
}
.mi-submit:hover { background: #0f3a8a; }
.mi-submit:disabled { background: #9ca3af; cursor: not-allowed; }

.mi-summary {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  margin: 4px 0 0;
}
.mi-summary dt {
  font-weight: bold;
  color: #374151;
  margin-top: 6px;
  font-size: 11px;
}
.mi-summary dt:first-child { margin-top: 0; }
.mi-summary dd {
  margin: 1px 0 0;
  color: #1f2937;
  font-size: 13px;
}

/* ==== 結果パネル ==== */
.mi-result {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 4px 0;
}
.mi-result-label {
  font-size: 11px;
  color: #1e40af;
  font-weight: bold;
  letter-spacing: .1em;
  margin-bottom: 6px;
}
.mi-result-title {
  font-size: 14px;
  font-weight: bold;
  color: #0f3a8a;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #93c5fd;
}
.mi-result-price {
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #0f3a8a;
  text-align: center;
  padding: 8px 0;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: .02em;
}
.mi-result-price small { font-size: 12px; opacity: .8; margin-left: 4px; }
.mi-result-price.text-only {
  font-size: 15px;
  line-height: 1.5;
  font-family: inherit;
}
.mi-result-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: #4b5563;
  line-height: 1.6;
}

/* ==== 取扱商品クロスセル ==== */
.mi-crosssell {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 11px;
  color: #9a3412;
  line-height: 1.6;
}
.mi-crosssell strong {
  display: block;
  color: #c2410c;
  margin-bottom: 2px;
  font-size: 11px;
}
.mi-crosssell-items {
  color: #7c2d12;
  font-weight: 600;
  margin-top: 2px;
}

@media (max-width: 480px) {
  .mi-chat {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: none;                     /* PC の translate(-50%,-50%) 打ち消し */
    border-radius: 0;
    max-height: 100vh;
    max-width: none;
  }
  /* SPは全幅に戻して少し小さめに調整 */
  .mi-toggle {
    left: 10px;
    right: 10px;
    transform: none;
    width: auto;
    max-width: none;
    bottom: 10px;
    padding: 12px 10px;
    font-size: 15px;
    gap: 8px;
  }
  .mi-toggle::before,
  .mi-toggle::after {
    width: 52px;
    height: 44px;
  }
  .mi-toggle-icon { font-size: 20px; }

  /* SP専用: タイトルの親サイト h3 スタイル（黄色背景等）を打ち消し */
  .mi-head h3 {
    background: none;
    color: #fffc50;
    padding: 0;
    white-space: normal;
    text-align: left;
    border: none;
    line-height: 1.4;
  }

  /* SP専用: 閉じるボタンを大きく太く */
  .mi-close {
    font-size: 32px;
    font-weight: bold;
    padding: 0 10px;
  }
}
