.kenpo-calc-box {
  max-width: 600px;
}

.kenpo-calc-box h2 {
  text-align: center;
  margin-bottom: 25px;
}

.kenpo-calc-box .field {
  display: block;
  margin-bottom: 15px;
  text-align: left;
}

.kenpo-calc-box .field label {
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
	font-size:.9rem;
}

.kenpo-calc-box input[type="number"],
.kenpo-calc-box input[type="text"],
.kenpo-calc-box select {
  width: 80% !important;
  padding: 10px !important;
  box-sizing: border-box !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
}

.radio-group {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-top: 8px;
}

.buttons {
  text-align: center;
  margin-top: 20px;
}

.buttons button {
  padding: 10px 20px;
  margin: 5px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: #007bff;
  color: white;
}

.buttons button:hover {
  background-color: #0056b3;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
}

.result-table th,
.result-table td {
  border: 1px solid #ccc;
  text-align: center;
}

.result-table th {
  background-color: #f5f5f5;
}

/* 通常時のスタイル */
.result-table th,
.result-table td {
  font-size: 1rem !important;
	font-weight: 500 !important;
  padding: 8px !important;
  border: 1px solid #ccc !important;
  text-align: center !important;
}

/* スマホサイズ用の文字サイズ縮小（450px以下） */
@media screen and (max-width: 450px) {
  .result-table th,
  .result-table td {
    font-size: 0.75rem !important;
	  font-weight: 500 !important;
    padding: 4px !important;
  }
}

@media (max-width: 600px) {
  .kenpo-calc-box {
    padding: 15px;
  }
}
/* 保険料率など数値が少ない入力欄を狭くする */
#kenpoDisplay,
#kaigoDisplay,
#kosodateDisplay {
  width: 100px; /* 幅を狭く指定 */
  display: inline-block;
  text-align: right;
}

/* パーセント表示を右側に並べる */
.percent-sign {
  display: inline-block;
  width: auto;
  margin-left: 5px;
}

.rate-fields {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
}

.rate-field {
  flex: 1 !important;
  margin-right: 15px !important;
  display: inline-block !important;
  vertical-align: top !important;
}

.rate-field:last-child {
  margin-right: 0 !important;
}

.rate-field label {
  display: block !important;
  font-weight: bold !important;
  margin-bottom: 6px !important;
}

.rate-field input[type="text"] {
  width: 100px !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.percent-sign {
  display: inline-block !important;
  vertical-align: middle !important;
}
.rate-field label {
  font-size: 0.6em !important; /* 文字を小さくする */
  line-height: 1.2 !important;  /* 行間を調整 */
  white-space: nowrap !important; /* ラベルの折り返し防止 */
}

@media print {
  body * {
    visibility: hidden;
  }

  .kenpo-calc-box, .kenpo-calc-box * {
    visibility: visible;
  }

  .kenpo-calc-box {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  /* 不要なボタンを非表示にする場合（任意） */
  .buttons {
    display: none;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body, html {
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  .kenpo-calc-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 210mm; /* A4幅に明示指定 */
    height: 297mm; /* A4高さに明示指定 */
    transform-origin: top left;
    overflow: hidden;
  }

  .buttons {
    display: none !important; /* 印刷に不要な要素を非表示 */
  }

  /* 用紙内に必ず収めるために、全体のスケールを明示的に縮小調整 */
  .kenpo-calc-box {
    transform: scale(0.95); /* 50％の縮小からスタートし、調整する */
  }

  /* 絶対に1ページに収める（必要に応じてスケールを微調整） */
}
