/* 既存のCSS */
.step-nav {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

::placeholder {
  opacity: 1;
  color: #888;
}

/* 新規追加CSS */
.contact-form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  padding: 0 20px;
}

.progress-step {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  background: #f5f5f5;
  color: #999;
  position: relative;
}

.progress-step.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.progress-step.completed {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
  color: white;
}

.form-content {
  padding: 20px;
}

.form-section {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.select-wrapper {
  position: relative;
}

.wpcf7-form-control.custom-select,
.wpcf7-form-control.form-input {
  width: 100%;
  padding: 15px 18px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.wpcf7-form-control.custom-select:focus,
.wpcf7-form-control.form-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wpcf7-form-control.request-details {
  width: 100%;
  padding: 15px 18px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  background: white;
  transition: all 0.3s ease;
  box-sizing: border-box;
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.wpcf7-form-control.request-details:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.step-nav {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  justify-content: space-between;
}

.btn-prev, .btn-next, .btn-submit {
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
}

.btn-prev {
  background: #f8f9fa;
  color: #6c757d;
  border: 2px solid #e9ecef;
}

.btn-prev:hover {
  background: #e9ecef;
  color: #495057;
}

.btn-next {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-left: auto;
}

.btn-next:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-submit {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
  color: white;
  width: 100%;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #4a9929 0%, #96d9b8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(86, 171, 47, 0.3);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .contact-form-container {
    margin: 10px;
    padding: 15px;
  }
  
  .form-progress {
    padding: 0 10px;
  }
  
  .progress-step {
    font-size: 12px;
    padding: 8px 4px;
  }
  
  .step-nav {
    flex-direction: column;
  }
  
  .btn-prev, .btn-next, .btn-submit {
    width: 100%;
    margin: 0;
  }
  
  .step-nav .btn-next {
    order: 2;
    margin-left: 0;
  }
  
  .step-nav .btn-prev {
    order: 1;
  }
}

/* エラーメッセージのスタイル */
.wpcf7-not-valid-tip {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 5px;
}

.wpcf7-validation-errors {
  background: #ffeaea;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.wpcf7-mail-sent-ok {
  background: #d4edda;
  border: 1px solid #27ae60;
  color: #27ae60;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}
/* 既存のCSS */
.step-nav {
display: flex;
gap: 15px;
margin-top: 30px;
justify-content: space-between;
align-items: center;
}

::placeholder {
opacity: 1;
color: #888;
}

/* 登録フォーム用CSS */
.contact-form-container {
max-width: 800px;
margin: 40px auto;
padding: 30px;
background: #ffffff;
border-radius: 16px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-progress {
display: flex;
justify-content: space-between;
margin-bottom: 40px;
padding: 0 20px;
position: relative;
}

.form-progress::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%);
width: 60%;
height: 2px;
background: linear-gradient(90deg, #e1e5e9 0%, #e1e5e9 100%);
z-index: 1;
}

.progress-step {
flex: 1;
text-align: center;
padding: 16px 12px;
border-radius: 12px;
font-weight: 600;
font-size: 15px;
background: #f8f9fa;
color: #6c757d;
position: relative;
z-index: 2;
transition: all 0.3s ease;
min-width: 160px;
border: 2px solid transparent;
}

.progress-step.active {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-color: #667eea;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.progress-step.completed {
background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
color: white;
border-color: #56ab2f;
box-shadow: 0 4px 15px rgba(86, 171, 47, 0.4);
}

.form-content {
padding: 20px;
}

.form-section {
margin-bottom: 28px;
}

.form-label {
display: block;
margin-bottom: 10px;
font-weight: 700;
color: #2d3748;
font-size: 16px;
letter-spacing: 0.3px;
}

.form-note {
font-size: 13px;
color: #718096;
margin-bottom: 10px;
line-height: 1.5;
padding: 8px 12px;
background: #f7fafc;
border-radius: 6px;
border-left: 3px solid #667eea;
}

.form-note a {
color: #667eea;
text-decoration: none;
font-weight: 500;
}

.form-note a:hover {
text-decoration: underline;
}

.select-wrapper {
position: relative;
}

.wpcf7-form-control.custom-select,
.wpcf7-form-control.form-input {
width: 100%;
padding: 16px 20px;
border: 2px solid #e2e8f0;
border-radius: 10px;
font-size: 16px;
background: white;
transition: all 0.3s ease;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wpcf7-form-control.custom-select:focus,
.wpcf7-form-control.form-input:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
background: #f8faff;
}

.wpcf7-form-control.custom-select:hover,
.wpcf7-form-control.form-input:hover {
border-color: #cbd5e0;
}

/* 電話番号・FAX入力用 */
.tel-input-group {
display: flex;
align-items: center;
gap: 12px;
}

.tel-input-group .tel-input {
flex: 1;
padding: 16px 18px;
border: 2px solid #e2e8f0;
border-radius: 10px;
font-size: 16px;
text-align: center;
transition: all 0.3s ease;
}

.tel-input-group .tel-input:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
background: #f8faff;
}

/* 日付入力用 */
.date-input-group {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}

.date-input-group .date-select {
flex: 1;
min-width: 100px;
padding: 14px 16px;
border: 2px solid #e2e8f0;
border-radius: 8px;
font-size: 15px;
background: white;
transition: all 0.3s ease;
}

.date-input-group .date-select:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ラジオボタンとチェックボックスのスタイル */
.radio-group, .checkbox-group {
display: flex;
flex-direction: column;
gap: 12px;
}

.radio-group {
flex-direction: row;
gap: 24px;
flex-wrap: wrap;
}

.radio-label, .checkbox-label {
display: flex;
align-items: flex-start;
gap: 10px;
font-size: 15px;
line-height: 1.6;
color: #4a5568;
cursor: pointer;
padding: 12px 16px;
border-radius: 8px;
transition: all 0.3s ease;
background: #f8f9fa;
border: 2px solid transparent;
position: relative;
}

.radio-label:hover, .checkbox-label:hover {
background: #e8f2ff;
border-color: #667eea;
}

.wpcf7-form-control-wrap input[type="radio"],
.wpcf7-form-control-wrap input[type="checkbox"] {
appearance: none;
width: 20px;
height: 20px;
border: 2px solid #cbd5e0;
border-radius: 50%;
background: white;
position: relative;
cursor: pointer;
margin: 0;
flex-shrink: 0;
transition: all 0.3s ease;
}

.wpcf7-form-control-wrap input[type="checkbox"] {
border-radius: 4px;
}

.wpcf7-form-control-wrap input[type="radio"]:checked,
.wpcf7-form-control-wrap input[type="checkbox"]:checked {
border-color: #667eea;
background: #667eea;
}

.wpcf7-form-control-wrap input[type="radio"]:checked::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 8px;
height: 8px;
border-radius: 50%;
background: white;
}

.wpcf7-form-control-wrap input[type="checkbox"]:checked::after {
content: '✓';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 12px;
font-weight: bold;
}

/* 利用規約同意セクション */
.terms-section {
background: #f7fafc;
border-radius: 12px;
padding: 30px;
border: 2px solid #e2e8f0;
}

.terms-content {
max-height: 500px;
overflow-y: auto;
padding-right: 10px;
}

.terms-item {
margin-bottom: 24px;
padding: 20px;
background: white;
border-radius: 10px;
border: 1px solid #e2e8f0;
}

.terms-item.final-agreement {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-color: #667eea;
}

.terms-item.final-agreement .checkbox-label {
color: white;
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.3);
}

.terms-item.final-agreement .checkbox-label:hover {
background: rgba(255, 255, 255, 0.2);
}

.terms-item.final-agreement .checkbox-label a {
color: #a8e6cf;
text-decoration: underline;
}

/* ボタンのスタイル */
.btn-next, .btn-prev, .btn-submit {
padding: 16px 32px;
border: none;
border-radius: 10px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
display: inline-block;
text-align: center;
min-width: 140px;
position: relative;
overflow: hidden;
}

.btn-next {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-next:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-prev {
background: #f8f9fa;
color: #6c757d;
border: 2px solid #e2e8f0;
}

.btn-prev:hover {
background: #e9ecef;
border-color: #ced4da;
transform: translateY(-2px);
}

.btn-submit {
background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
color: white;
box-shadow: 0 4px 15px rgba(86, 171, 47, 0.4);
font-size: 18px;
padding: 18px 36px;
width: 100%;
min-width: 280px;
}

.btn-submit:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(86, 171, 47, 0.6);
}

/* エラーメッセージのスタイル */
.wpcf7-not-valid-tip {
color: #e53e3e;
font-size: 13px;
margin-top: 8px;
display: block;
background: #fed7d7;
padding: 8px 12px;
border-radius: 6px;
border-left: 3px solid #e53e3e;
}

.wpcf7-validation-errors {
background: #fed7d7;
border: 1px solid #e53e3e;
border-radius: 8px;
padding: 16px;
margin: 20px 0;
color: #742a2a;
}

.wpcf7-mail-sent-ok {
background: #c6f6d5;
border: 1px solid #48bb78;
border-radius: 8px;
padding: 16px;
margin: 20px 0;
color: #22543d;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
.contact-form-container {
margin: 20px;
padding: 20px;
}
  
.form-progress {
flex-direction: column;
gap: 12px;
}
  
.form-progress::before {
display: none;
}
  
.progress-step {
min-width: auto;
}
  
.tel-input-group {
flex-direction: column;
gap: 8px;
}
  
.date-input-group {
flex-direction: column;
align-items: stretch;
}
  
.date-input-group .date-select {
min-width: auto;
}
  
.radio-group {
flex-direction: column;
gap: 12px;
}
  
.step-nav {
flex-direction: column;
align-items: stretch;
}
  
.btn-next, .btn-prev, .btn-submit {
width: 100%;
margin-bottom: 8px;
}

.terms-content {
max-height: 400px;
}
}

/* スクロールバーのカスタマイズ */
.terms-content::-webkit-scrollbar {
width: 8px;
}

.terms-content::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4px;
}

.terms-content::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 4px;
}

.terms-content::-webkit-scrollbar-thumb:hover {
background: #a8a8a8;
}

/* アニメーション */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

.form-section {
animation: fadeIn 0.6s ease forwards;
}

.form-section:nth-child(even) {
animation-delay: 0.1s;
}

.form-section:nth-child(odd) {
animation-delay: 0.2s;
}

/* フォーカス時のアニメーション */
.form-input:focus, .custom-select:focus {
animation: focusPulse 0.3s ease;
}

@keyframes focusPulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.02);
}
100% {
transform: scale(1);
}
}

/* ボタンクリック時のエフェクト */
.btn-next:active, .btn-prev:active, .btn-submit:active {
transform: translateY(0);
}

/* Hidden fields - 非表示 */
.wpcf7-form-control-wrap input[type="hidden"] {
display: none;
}
/* 同意ボタン用のスタイル */
.agreement-group {
display: flex;
justify-content: flex-end;
margin-top: 16px;
}

.final-agreement-group {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
margin-top: 16px;
}

.agreement-label {
display: flex;
align-items: center;
gap: 8px;
font-size: 15px;
font-weight: 600;
color: #4a5568;
cursor: pointer;
padding: 10px 20px;
border-radius: 25px;
transition: all 0.3s ease;
background: #f8f9fa;
border: 2px solid #e2e8f0;
}

.agreement-label:hover {
background: #e8f2ff;
border-color: #667eea;
}

.agreement-label input[type="radio"] {
appearance: none;
width: 18px;
height: 18px;
border: 2px solid #cbd5e0;
border-radius: 50%;
background: white;
position: relative;
cursor: pointer;
margin: 0;
flex-shrink: 0;
}

.agreement-label input[type="radio"]:checked {
border-color: #667eea;
background: #667eea;
}

.agreement-label input[type="radio"]:checked::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 6px;
height: 6px;
border-radius: 50%;
background: white;
}

.terms-item h4 {
color: #2d3748;
font-size: 16px;
font-weight: 700;
margin-bottom: 12px;
border-bottom: 2px solid #e2e8f0;
padding-bottom: 8px;
}

.terms-item p {
color: #4a5568;
line-height: 1.6;
margin-bottom: 0;
}

.final-agreement-label {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white !important;
border-color: #667eea;
font-weight: 700;
}

.final-agreement-label:hover {
background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.final-agreement-label a {
color: #a8e6cf;
text-decoration: underline;
}
/* Contact Form 7 ラジオボタン・チェックボックスの修正 */
.wpcf7-form-control-wrap .wpcf7-radio,
.wpcf7-form-control-wrap .wpcf7-checkbox {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wpcf7-form-control-wrap .wpcf7-radio .wpcf7-list-item,
.wpcf7-form-control-wrap .wpcf7-checkbox .wpcf7-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
    line-height: 1.6;
    color: #4a5568;
    cursor: pointer;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 2px solid transparent;
    margin: 0 !important;
}

.wpcf7-form-control-wrap .wpcf7-radio .wpcf7-list-item:hover,
.wpcf7-form-control-wrap .wpcf7-checkbox .wpcf7-list-item:hover {
    background: #e8f2ff;
    border-color: #667eea;
}

.wpcf7-form-control-wrap .wpcf7-radio .wpcf7-list-item input,
.wpcf7-form-control-wrap .wpcf7-checkbox .wpcf7-list-item input {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    background: white;
    position: relative;
    cursor: pointer;
    margin: 0 !important;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.wpcf7-form-control-wrap .wpcf7-checkbox .wpcf7-list-item input {
    border-radius: 4px;
}

.wpcf7-form-control-wrap .wpcf7-radio .wpcf7-list-item input:checked,
.wpcf7-form-control-wrap .wpcf7-checkbox .wpcf7-list-item input:checked {
    border-color: #667eea;
    background: #667eea;
}

.wpcf7-form-control-wrap .wpcf7-radio .wpcf7-list-item input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.wpcf7-form-control-wrap .wpcf7-checkbox .wpcf7-list-item input:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 業種別ラジオボタンを横並びに */
.wpcf7-form-control-wrap .wpcf7-radio {
    flex-direction: row;
    gap: 24px;
    flex-wrap: wrap;
}
.terms-link {
color: #a8e6cf;
text-decoration: underline;
font-size: 14px;
margin-top: 8px;
display: block;
text-align: center;
}

.terms-link:hover {
color: #96d9b8;
}
/* 業務種別ラジオボタンの縦中央揃え */
.wpcf7-form-control-wrap .business-type-radio .wpcf7-list-item {
    align-items: center;
    min-height: 50px;
}

.wpcf7-form-control-wrap .business-type-radio .wpcf7-list-item input {
    margin-top: 0;
}
/* 業務種別チェックボックス用 */
.wpcf7-form-control-wrap .business-type-checkbox .wpcf7-list-item {
    align-items: center;
    min-height: 50px;
    display: flex;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px !important;
}

.wpcf7-form-control-wrap .business-type-checkbox .wpcf7-list-item:hover {
    background: #e8f2ff;
    border-color: #667eea;
}

.wpcf7-form-control-wrap .business-type-checkbox .wpcf7-list-item input {
    margin-right: 10px;

/* companyform2 の受け取り専用メール欄を完全に不可視にする */
.visually-hidden-company-email,
.visually-hidden-company-email .wpcf7-form-control-wrap,
.visually-hidden-company-email input[type="email"] {
  position: absolute !important;
  left: -9999px !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}
/* フォーム②での company-email 受け取り欄を完全不可視＆余白ゼロに */
.visually-hidden-company-email,
.visually-hidden-company-email .wpcf7-form-control-wrap,
.visually-hidden-company-email input[type="email"],
.visually-hidden-company-email .wpcf7-not-valid-tip {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* 念のため、タグ名・name属性にもピンポイント適用（フォーム②だけに仕込んだclass経由なので他フォームに影響しない） */
.wpcf7 form .visually-hidden-company-email input[name="company-email"] {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

	/* A. トップページのカードでカテゴリを全部表示させる */
#post_list .meta { 
  display:flex; 
  flex-wrap:wrap; 
  gap:.4em .6em; 
  max-height:none; 
  overflow:visible;
}
#post_list .meta .cat { 
  display:inline-block !important; 
}
#post_list .meta .cat a { 
  display:inline-block; 
  padding:.2em .6em; 
  border-radius:9999px;
}
/* ===== モバイルで狭い/はみ出す問題の一括修正（/step3/ & companyform2）===== */
@media (max-width: 767.98px) {

  /* フォーム全体を画面幅いっぱいに。余白は安全な内側パディングに統一（対象ページのみ） */
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .contact-form-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 16px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* 入力UIは100%幅 & iOSズーム防止（対象ページのみ） */
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .wpcf7-form-control.form-input,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .wpcf7-form-control.custom-select,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .wpcf7-form-control.request-details {
    width: 100% !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  /* ナビ/送信ボタンのはみ出し防止。縦積み＆100%幅（対象ページのみ） */
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .step-nav {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-top: 20px !important;
    padding: 0 !important;
    justify-content: stretch !important;
    align-items: stretch !important;
  }
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .btn-prev,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .btn-next,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .btn-submit {
    width: 100% !important;
    min-width: 0 !important;
    padding: 14px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .btn-next { 
    margin-left: 0 !important; 
  }

  /* hover拡大で親からはみ出すのを防止（対象ページのみ） */
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .btn-next:hover,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .btn-prev:hover,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .btn-submit:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* 規約ボックス：読みやすい行間・自動改行（対象ページのみ） */
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-section {
    padding: 16px !important;
    border-radius: 8px !important;
  }
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-content {
    max-height: 60vh !important;
    overflow-y: auto !important;
    padding-right: 8px !important;
  }
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-item p {
    line-height: 1.7 !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
  }

  /* ラジオ/チェックは縦積み（対象ページのみ） */
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .wpcf7-form-control-wrap .wpcf7-radio,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .wpcf7-form-control-wrap .wpcf7-checkbox,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .radio-group,
  :is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .checkbox-group {
    flex-direction: column !important;
    gap: 10px !important;
  }
}

/* ボタンや装飾が横スクロールを出さないように（対象ページのみ） */
:is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .wpcf7 {
  overflow-x: hidden !important;
}

/* 規約ボックスの極細化を強制解除（対象ページのみ） */
:is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-section,
:is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-content,
:is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-item {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}

/* 段落は自然改行（対象ページのみ） */
:is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-item,
:is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-item p,
:is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-content,
:is(body.page-id-408, .page-id-408, body.page-id-step3, .page-id-step3, body.page-id-companyform2, .page-id-companyform2) .terms-content p {
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.7;
}

/* （任意）固定幅レイアウトに捕まっていたら最大幅を緩める（元の指定を踏襲） */
.page-id-step3 .contact-form-container,
.page-id-companyform2 .contact-form-container {
  max-width: 720px;
}

/* ===== companyform2（page-id-408）専用 追加安定化 ===== */

/* 規約ゾーンを横書き・フル幅に固定（cookieやテーマ装飾の干渉を排除） */
@media (max-width: 1024px) {
  body.page-id-408 .terms-section,
  body.page-id-408 .terms-section * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
  }

  body.page-id-408 .terms-section,
  body.page-id-408 .terms-content,
  body.page-id-408 .terms-item,
  body.page-id-408 .terms-item * {
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    transform: none !important;
    display: block;
    box-sizing: border-box !important;
    position: static !important;
  }

  body.page-id-408 .terms-content {
    max-height: 70vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    padding-right: 10px !important;
  }

  /* チェック行の重なり・タップ不能を排除 */
  body.page-id-408 .agreement-group{ 
    display:flex !important; 
    align-items:center !important;
    gap:8px !important;
    position:relative !important;
  }
  body.page-id-408 .wpcf7-list-item{
    display:inline-flex !important;
    align-items:center !important;
    gap:8px !important;
    position:relative !important;
    z-index:2 !important;
  }
  body.page-id-408 .wpcf7-list-item input[type="checkbox"]{
    width:20px !important; height:20px !important;
    margin:0 !important;
    position:relative !important;
    z-index:3 !important;
  }
  body.page-id-408 .wpcf7-list-item-label{
    cursor:pointer !important;
    pointer-events:auto !important;
  }

  /* クリックを邪魔する装飾を無効化 */
  body.page-id-408 .terms-item::before,
  body.page-id-408 .agreement-group::before { content:none !important; }

  /* 送信ボタンは常に100%幅・はみ出し防止 */
  body.page-id-408 .step-nav{ display:block !important; }
  body.page-id-408 .btn-submit,
  body.page-id-408 input.wpcf7-submit{
    display:block !important; width:100% !important; max-width:100% !important; margin:16px 0 0 !important;
  }

  /* 横スクロールの元を殺す */
  body.page-id-408 .wpcf7{ overflow-x:hidden !important; }
}
/* === CF7 PATCH v5 (scoped) : end === */
/* ===== ブログ投稿の本文H2：中央寄せ＆目立つライン（強制上書き版） ===== */
body.single-post .entry-content h2 {
  position: relative;
  font-weight: 800 !important;
  font-size: clamp(22px, 3.2vw, 32px) !important;
  line-height: 1.35 !important;
  letter-spacing: .02em !important;
  text-align: center !important;       /* 中央寄せ */
  margin: 40px auto 24px !important;   /* 上下ゆったり */
  padding: 0 12px 14px !important;     /* 下にライン用の余白 */
  border: 0 !important;                /* 既存の下線等を無効化 */
}

/* 下にアクセントライン（グラデーション） */
body.single-post .entry-content h2::after {
  content: "";
  display: block;
  width: 140px;
  height: 4px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, currentColor, rgba(0,0,0,0));
  border-radius: 999px;
  opacity: .9;
}

/* スマホ微調整 */
@media (max-width: 767.98px) {
  body.single-post .entry-content h2 {
    font-size: 20px !important;
    margin: 28px auto 18px !important;
    padding-bottom: 10px !important;
  }
  body.single-post .entry-content h2::after {
    width: 100px;
    height: 3px;
  }
}

/* --- 別デザインに切り替えたい時（上の ::after を消して、下のどちらかを使う） --- */

/* A) 左アクセントバー版（中央寄せじゃなく左寄せにしたい時）
body.single-post .entry-content h2 {
  text-align: left !important;
  padding: 0 0 0 14px !important;
  border-left: 6px solid currentColor !important;
}
*/

/* B) 背景帯（リボン）版
body.single-post .entry-content h2 {
  text-align: center !important;
  display: inline-block !important;
  background: #f5f7fb !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.06) inset !important;
}
*/

/* 超広域テスト：ページ中の“見出し2相当”を赤にする */
:is(h2, .wp-block-heading, [role="heading"][aria-level="2"]) {
  color: #e60033 !important;
}

/* 記事ページのH1（GENSENのタイトル #post_title）と、本文内のh1 どちらにも適用 */
body.single-post #post_title,
body.single-post .entry-content h1 {
  font-weight: 800 !important;
  font-size: clamp(26px, 3.8vw, 40px) !important;
  line-height: 1.3 !important;
  letter-spacing: .02em !important;
  text-align: center !important;
  margin: 20px 0 30px !important;
  border: 0 !important;
}

/* スマホ微調整（任意） */
@media (max-width: 767.98px) {
  body.single-post #post_title,
  body.single-post .entry-content h1 {
    font-size: 24px !important;
    margin: 12px 0 20px !important;
  }
}
/* single投稿のH1（#post_title.rich_font）を強制上書き */
body.single-post #article_header > h1#post_title.rich_font,
body.single-post h1#post_title.rich_font {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  font-weight: 800 !important;
  font-size: clamp(26px, 3.8vw, 40px) !important;
  line-height: 1.3 !important;
  letter-spacing: .02em !important;
  margin: 18px 0 28px !important;
  border: 0 !important;
  color: #000 !important;
}
/* 投稿タイトルH1（GENSEN #post_title.rich_font用） */
body.single-post h1#post_title.rich_font {
  text-align: center !important;          /* 中央寄せ */
  font-weight: 800 !important;           /* 太字 */
  font-size: clamp(26px, 3.8vw, 40px) !important; /* レスポンシブ対応の大きさ */
  line-height: 1.3 !important;
  letter-spacing: 0.02em;
  color: #000 !important;                /* 本文色は黒 */
  margin: 40px auto 28px !important;
  padding-bottom: 16px;                  /* 下にライン分の余白 */
}

/* 下に装飾ライン（H2と似ているが「中央から両端にフェード」する） */
body.single-post h1#post_title.rich_font::after {
  content: "";
  display: block;
  width: 180px;                           /* H2より長め */
  height: 4px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent 0%, #e60033 20%, #e60033 80%, transparent 100%);
  border-radius: 999px;
  opacity: 0.9;
}