.extMdlFormGnrtrTable,
.extMdlFormGnrtrTable * {
  box-sizing: border-box;
}
/* ===== フォーム共通デザイン刷新 (contact / trial / ebook 共通) ===== */
.extMdlFormGnrtrTable {
  width: 100%;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(20,22,24,.08);
  display: block;
  font-family: -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
.extMdlFormGnrtrTable tbody,
.extMdlFormGnrtrTable tr,
.extMdlFormGnrtrTable td {
  display: block;
  width: 100% !important;
}
.extMdlFormGnrtrTable tr {
  padding: 18px 28px;
  border-bottom: 1px dashed #eaeaea;
}
.extMdlFormGnrtrTable tr:last-child { border-bottom: none; }
.extMdlFormGnrtrTable td:first-child {
  font-size: 13.5px;
  font-weight: 700;
  color: #303133;
  padding-bottom: 8px !important;
}

/* 必須バッジ: 「必須入力にする」を付けたフィールドに自動表示(bingo標準のthImpクラス) */
.extMdlFormGnrtrTable .thImp::after {
  content: "必須";
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #ff5500;
  border-radius: 4px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

.extMdlFormGnrtrTable input[type="text"],
.extMdlFormGnrtrTable input[type="email"],
.extMdlFormGnrtrTable input[type="tel"],
.extMdlFormGnrtrTable textarea,
.extMdlFormGnrtrTable select {
  width: 100%;
  height: 44px;
  border: 1.5px solid #dfe2e6;
  border-radius: 10px;
  padding: 0 13px;
  font-size: 14px;
  font-family: inherit;
  color: #303133;
  background: #fff;
  box-sizing: border-box;
}
.extMdlFormGnrtrTable textarea { height: auto; padding: 10px 13px; min-height: 110px; }
.extMdlFormGnrtrTable input:focus,
.extMdlFormGnrtrTable textarea:focus,
.extMdlFormGnrtrTable select:focus {
  outline: none;
  border-color: #ff5500;
  box-shadow: 0 0 0 3px rgba(255,85,0,.12);
}

/* 送信ボタン(確認画面へ / 送信 など) */
.extMdlFormGnrtrTable input[type="submit"] {
  display: block;
  width: 100%;
  height: 52px;
  background: #ff5500;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255,85,0,.28);
  transition: .2s;
}
.extMdlFormGnrtrTable input[type="submit"]:hover {
  background: #e64d00;
  transform: translateY(-2px);
}

/* ステップインジケーター(各ページのフリーHTMLユニットに設置するHTMLに対応) */
.gw-steps {
  display: flex; justify-content: center; gap: 8px; align-items: center;
  margin: 26px 0 30px; flex-wrap: wrap;
  font-family: -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
.gw-steps .s {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid #eaeaea; border-radius: 999px;
  padding: 8px 18px; font-size: 13px; font-weight: 700; color: #b3b8bf;
}
.gw-steps .s .n {
  width: 22px; height: 22px; border-radius: 50%; background: #e3e5e8; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.gw-steps .s.on { color: #ff5500; border-color: #ff5500; }
.gw-steps .s.on .n { background: #ff5500; }
.gw-steps .s.done { color: #1f8a53; border-color: #bfe4cd; }
.gw-steps .s.done .n { background: #1f8a53; }
.gw-steps .arw { color: #cbd0d6; font-weight: 800; }

/* 電話番号など、1つの欄に入力ボックスが複数並ぶ項目の横並び補正 */
.extMdlFormGnrtrTable td:has(input[type="text"] ~ input[type="text"]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.extMdlFormGnrtrTable td:has(input[type="text"] ~ input[type="text"]) input[type="text"] {
  width: auto;
  flex: 1 1 90px;
  min-width: 70px;
}
.extMdlFormGnrtrTable td:has(input[type="text"] ~ input[type="text"]) .subCommentSide {
  flex-basis: 100%;
  font-size: 12px;
  color: #777;
  margin-top: 4px;
}

/* お問い合わせ: 安心材料パネル(横型、フォームの上に設置) */
.gw-trust {
  background: #fff; border: 1px solid #eaeaea; border-radius: 18px;
  box-shadow: 0 4px 14px rgba(20,22,24,.06);
  padding: 20px 24px; margin: 0 0 24px;
  display: flex; gap: 24px; flex-wrap: wrap; align-items: center;
  font-family: -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
.gw-trust .item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #303133; }
.gw-trust .speed {
  background: #fdf2ea; border-radius: 12px; padding: 10px 16px; font-size: 12.5px; color: #303133; flex: 1 1 260px;
}
.gw-trust .speed b { color: #e64d00; font-size: 15px; }

/* 送信ボタンがテーブルの外にある場合にも対応 */
.extMdlFormGnrtr input[type="submit"] {
  display: block;
  width: 100%;
  height: 52px;
  background: #ff5500;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255,85,0,.28);
  transition: .2s;
}
.extMdlFormGnrtr input[type="submit"]:hover {
  background: #e64d00;
  transform: translateY(-2px);
}

/* お問い合わせ: 相談カード(カンプの左サイドカード相当) */
.gw-cv {
  background: #fff; border: 1px solid #eaeaea; border-radius: 18px;
  box-shadow: 0 4px 14px rgba(20,22,24,.06); overflow: hidden; margin: 0 0 24px;
  font-family: -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
.gw-cv .head { background: #ff5500; color: #fff; padding: 16px 22px; }
.gw-cv .head .k { font-size: 11px; font-weight: 800; letter-spacing: 1px; opacity: .9; }
.gw-cv .head h3 { font-size: 18px; margin: 3px 0 0; }
.gw-cv .body { padding: 20px 22px; }
.gw-cv .chk { list-style: none; margin: 0; padding: 0; }
.gw-cv .chk li {
  position: relative; padding: 9px 0 9px 30px; font-size: 13.5px;
  border-bottom: 1px dashed #eaeaea;
}
.gw-cv .chk li:last-child { border-bottom: none; }
.gw-cv .chk li:before {
  content: ""; position: absolute; left: 2px; top: 12px; width: 17px; height: 17px;
  border-radius: 5px; background: #fcece2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5500' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}
.gw-cv .speed {
  background: #fdf2ea; border-radius: 12px; padding: 14px 16px; margin: 16px 0;
  font-size: 12.5px; color: #303133;
}
.gw-cv .speed b { color: #e64d00; font-size: 15px; }
.gw-cv .safe {
  font-size: 12px; color: #1f8a53; font-weight: 700; background: #eef8f1;
  border-radius: 8px; padding: 10px 12px; line-height: 1.7;
}

/* お問い合わせ: 2カラムの幅調整+左カードを追従表示 */
#user-area:has(.gw-cv) {
  overflow: visible !important;
}
.coln2:has(.extMdlFormGnrtrTable) > .box2 {
  width: 50% !important;
  flex: none !important;
  box-sizing: border-box !important;
}
.coln2:has(.extMdlFormGnrtrTable) > .box1 {
  width: 50% !important;
  flex: none !important;
  box-sizing: border-box !important;
  align-self: stretch !important;
  align-items: stretch !important;
  position: static !important;
}
.coln2:has(.extMdlFormGnrtrTable) > .box1 .containerInner,
.coln2:has(.extMdlFormGnrtrTable) > .box1 .attach_anim {
  height: 100% !important;
}
.coln2:has(.extMdlFormGnrtrTable) > .box1 .gw-cv {
  position: sticky !important;
  top: 180px !important;
}

/* お問い合わせ: メールアドレス確認欄を非表示 */
.extMdlFormGnrtrTable tr:has(input[name="allmail_conf3"]) {
  display: none !important;
}

/* 元々あった実線の区切りを消し、点線の区切りだけ残す */
.extMdlFormGnrtrTable td {
  border-bottom: none !important;
}

/* 右カラム: 各項目の余白を最大限詰める */
.extMdlFormGnrtrTable tr {
  padding: 6px 20px !important;
}
.extMdlFormGnrtrTable td:first-child {
  padding-bottom: 4px !important;
}
.extMdlFormGnrtrTable input[type="text"],
.extMdlFormGnrtrTable input[type="email"],
.extMdlFormGnrtrTable input[type="tel"],
.extMdlFormGnrtrTable select {
  height: 38px !important;
}
.extMdlFormGnrtrTable textarea {
  height: 70px !important;
  min-height: 60px !important;
}

/* 右カラム: 各項目の余白を最大限詰める */
.extMdlFormGnrtrTable tr {
  padding: 4px 20px !important;
}
.extMdlFormGnrtrTable td:first-child {
  padding-bottom: 2px !important;
}
.extMdlFormGnrtrTable input[type="text"],
.extMdlFormGnrtrTable input[type="email"],
.extMdlFormGnrtrTable input[type="tel"],
.extMdlFormGnrtrTable select {
  height: 38px !important;
}
.extMdlFormGnrtrTable textarea {
  height: 70px !important;
  min-height: 60px !important;
}

/* 電話番号欄の幅をメールアドレスと揃える(旧size属性を上書き) */
.extMdlFormGnrtrTable input[name="onepart5"] {
  width: 80% !important;
}

/* プライバシーポリシーのラベル文言を削除し、同意文のみ残す */
.extMdlFormGnrtrTable tr:has(input[name="radio41"]) > :first-child {
  display: none !important;
}

/* メールアドレス欄の幅を他の項目と揃える(旧size属性を上書き) */
.extMdlFormGnrtrTable input[name="allmail3"] {
  width: 80% !important;
}

/* 「お客様情報をご入力ください」の見出し行を余白ごと削除 */
.extMdlFormGnrtrTable tr:has(.extMdlFormGnrtrGuide) {
  display: none !important;
}

/* スマホ: 2カラムを上下に積む(左カード→フォームの順) */
@media (max-width: 768px) {
  .coln2:has(.extMdlFormGnrtrSP) {
    display: block !important;
  }
  .coln2:has(.extMdlFormGnrtrSP) > .box1,
  .coln2:has(.extMdlFormGnrtrSP) > .box2 {
    width: 100% !important;
  }
  .coln2:has(.extMdlFormGnrtrSP) > .box1 .gw-cv {
    position: static !important;
    margin-bottom: 20px;
  }
}

/* スマホ: ガイド文言・メール確認欄・プライバシーポリシー文言を削除(PCと同様) */
.extMdlFormGnrtrSP .ddGuidetext { display: none !important; }
.extMdlFormGnrtrSP dt:has(+ dd input[name="allmail_conf3"]) { display: none !important; }
.extMdlFormGnrtrSP dd:has(input[name="allmail_conf3"]) { display: none !important; }
.extMdlFormGnrtrSP dt:has(+ dd input[name="radio41"]) { display: none !important; }

function hideAndSyncEmailConfirm(mainName, confName) {
  var main = document.querySelector('[name="' + mainName + '"]');
  var conf = document.querySelector('[name="' + confName + '"]');
  if (!main || !conf) return;
  function sync() { conf.value = main.value; }
  main.addEventListener('input', sync);
  var form = main.closest('form');
  if (form) form.addEventListener('submit', sync);
  sync();
}
hideAndSyncEmailConfirm('allmail3', 'allmail_conf3');

/* 確認画面: 同意済みの(x)表記を非表示 */
.extMdlFormGnrtrTable tt { display: none !important; }

/* 確認画面: 「入力画面へ戻る」を控えめなボタンに(主役は「送信する」) */
.extMdlFormGnrtr input.extBtnBack {
  background: #fff !important;
  color: #303133 !important;
  border: 1.5px solid #dfe2e6 !important;
  box-shadow: none !important;
}
.extMdlFormGnrtr input.extBtnBack:hover {
  border-color: #ff5500 !important;
  color: #ff5500 !important;
}