body {
  font-family: 'Montserrat', sans-serif, 'Noto Sans JP'; /* Montserratを優先、次点で一般的なサンセリフ、日本語フォント */
  padding: 20px;
  background-color: #f2e3e1;
  color: #333;
  margin: 0;
}

h1, h2 {
  font-family: 'Montserrat', sans-serif, 'Noto Sans JP'; /* タイトルも同様のフォント */
}

h1 {
  background-color: #ebc5c0;
  padding: 10px;
  border-radius: 8px;
  color: #0a0a0a;
  text-align: left;
  margin: 0;
}

h2 {
  background-color: transparent;
  color: #0a0a0a;
}

.section {
  margin-bottom: 20px;
}

.instruction-text {
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #ebc5c0;
  margin: 20px 0;
  line-height: 1.6;
  font-size: 14px;
}

.disclaimer {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  margin: 20px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #666;
}

.disclaimer p {
  margin: 5px 0;
  text-indent:-1em;
  padding-left: 1em;
}

.note-text {
  font-size: 11px;
  color: #666;
  margin: 8px 0;
  text-indent: -1em;
  padding-left: 1em;
  line-height: 1.4;
}


.column-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.column {
  flex: 1 1 calc(50% - 5px);
  padding: 10px;
  border-radius: 5px;
  box-sizing: border-box;
}

.male-column {
  background-color: transparent;
}

.female-column {
  background-color: transparent;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 20px; /* エラーメッセージ表示のために下マージンを増やす */
  flex-wrap: nowrap;
  position: relative;
}

.input-row label {
  min-width: 80px;
  flex-shrink: 0;
}

.input-row input[type="text"],
.input-row input[type="number"] {
  width: 60px;
  padding: 4px 2px;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #333;
  background: transparent;
  outline: none;
}

/* エラー表示用のスタイル */
.error-message {
    color: #f52e14; /* 指定された色 */
    font-size: 0.8em;
    position: absolute;
    /* PC表示時の位置調整 */
    left: 80px; /* labelのmin-width + gap */
    top: calc(100% + 2px); /* inputの下線から少し離す */
    width: calc(100% - 85px); /* 右側にはみ出さないように幅を調整 */
    white-space: normal; /* 折り返しを許可 */
    text-align: left;
    z-index: 1; /* 他の要素より手前に表示 */
}

.error-input {
    border-bottom: 2px solid #f52e14 !important; /* エラーのある入力欄のスタイル */
}

.total-error-message {
    color: #f52e14; /* 指定された色 */
    font-weight: bold;
    text-align: center;
    padding: 10px;
    border: 1px solid #f52e14;
    background-color: #ffeaea;
    border-radius: 5px;
}


.result {
  font-weight: bold;
  background-color: #ebc5c0;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.button-08 button, .button-reset button { /* 両方のボタンに共通のスタイルを設定 */
  font-family: 'Montserrat', sans-serif, 'Noto Sans JP'; /* 共通フォント */
  font-size: 14px; /* フォントサイズを統一 */
  letter-spacing: 0.1em;
  font-weight: 700;
  border-radius: 999px;
  display: flex; /* flexbox を使用して中央揃え */
  align-items: center; /* 垂直方向の中央揃え */
  justify-content: center; /* 水平方向の中央揃え */
  box-sizing: border-box;
  width: 150px; /* 幅を統一 */
  height: 40px; /* 高さを統一 */
  /* padding は flexbox で中央揃えするため不要になりますが、念のため残しておきます。*/
  /* padding: 10px 20px; */
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  border: none; /* buttonのデフォルトボーダーを削除 */
}

.button-08 button {
  color: #fff;
  background: #333;
  border: solid 3px #333;
}

.button-08 button:hover {
  color: #333;
  background: initial;
}

.button-reset button {
  color: #666;
  background: #eee;
  font-weight: 500; /* calculateより目立たないように少し軽め */
  border: solid 1px #ccc;
}

.button-reset button:hover {
  color: #333;
  background: #ddd;
  border-color: #aaa;
}

.dli-home::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.1em;
  width: 45%;
  height: 75%;
  background: transparent;
  border: 0.1em solid currentColor;
  border-bottom: 0;
  box-sizing: border-box;
  transform: translateX(-50%);
}

/* お問い合わせボタンのスタイル */
.contact-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: #333;
  color: white;
  border: none;
  border-radius: 25px; /* より小さな角丸 */
  padding: 8px 16px; /* パディングを小さく */
  font-family: 'Montserrat', sans-serif, 'Noto Sans JP';
  font-size: 12px; /* フォントサイズを小さく */
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px; /* アイコンとテキストの間隔を小さく */
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 100px; /* 幅を小さく */
  height: 36px; /* 高さを小さく */
}

.contact-button:hover {
  background: #555;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.contact-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* フッターが見える時のボタン位置調整 */
.contact-button.footer-visible {
  bottom: 70px;
}


/* メールアイコン */
.mail-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
}

.mail-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-sizing: border-box;
}

.mail-icon::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 5px solid currentColor;
}

/* SP対応 */
@media screen and (max-width: 768px) {
  .contact-button {
    bottom: 15px;
    right: 15px;
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
  }

  .contact-button .contact-text {
    display: none; /* SP時はテキストを非表示 */
  }

  .contact-button .mail-icon {
    width: 16px;
    height: 16px;
  }

  .contact-button .mail-icon::before {
    width: 16px;
    height: 12px;
    border-width: 1.5px;
  }

  .contact-button .mail-icon::after {
    left: 2px;
    top: 2px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 4px solid currentColor;
  }
}

footer {
  background-color: #333;
  color: white;
  padding: 10px;
  text-align: right;
  font-size: 14px;
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
}

table {
  border-collapse: collapse;
  margin-bottom: 20px;
  width: 100%;
}

th, td {
  border: none !important;
  padding: 8px;
  text-align: center;
}

@media screen and (max-width: 768px) {
  .column-container {
    flex-direction: column;
  }
  .button-container {
    flex-direction: column;
    align-items: center;
  }
  .button-08 button,
  .button-reset button {
    width: 200px;
    margin: 5px auto;
  }
  .input-row {
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 25px; /* モバイルでのエラーメッセージ表示のために少し下げる */
  }
  .input-row label {
    flex-basis: 100%;
    margin-bottom: 2px;
  }
  .input-row input {
    flex-grow: 1;
  }
  .input-row .error-message {
    position: static; /* モバイルではstaticにして通常フローに */
    margin-left: 0;
    width: 100%;
    text-align: left;
    transform: none;
  }
}

/* 以下のCSSは insurance_simulator_updated.html から移動済み */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ebc5c0;
  padding: 10px;
  border-radius: 8px;
}

.header-container h1 {
  margin: 0;
  font-size: 20px;
}

.home-link {
  text-decoration: none;
  margin-left: auto;
  padding-left: 10px;
}

.dli-home {
  display: inline-block;
  vertical-align: middle;
  color: #333;
  line-height: 1;
  position: relative;
  width: 1em;
  height: 0.75em;
  border: 0.1em solid currentColor;
  border-top: 0;
  box-sizing: border-box;
}

.dli-home::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.70711em;
  height: 0.70711em;
  border: 0.1em solid currentColor;
  border-right: 0;
  border-bottom: 0;
  box-sizing: border-box;
  transform: translate(-50%, -46%) rotate(45deg) skew(-10deg, -10deg);
}

.dli-home::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -0.1em;
  width: 45%;
  height: 75%;
  background: transparent;
  border: 0.1em solid currentColor;
  border-bottom: 0;
  box-sizing: border-box;
  transform: translateX(-50%);
}