/* Fee Simulation Page Specific Styles */

.simulation-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 30px;
}

.simulation-form-area,
.simulation-result-area {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.simulation-subtitle {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    color: var(--accent-red);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-secondary);
}

.simulation-section-subtitle {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid var(--accent-orange);
}

/* Overriding general form control for simulation page if needed */
.simulation-form-area .form-control {
    /* components.cssで定義されたスタイルを基本とする */
    /* 必要であればここで上書き */
}

.simulation-form-area .form-group label {
    /* components.cssで定義されたスタイルを基本とする */
}

.form-control-inline {
    padding: 8px 12px;
    border: 1px solid var(--bg-secondary);
    border-radius: 6px;
    background-color: #fff;
    color: var(--text-primary);
    font-size: 0.95rem;
    width: auto; /* インラインなので幅自動 */
    min-width: 60px; /* 最低幅 */
    text-align: right;
}
.form-control-inline:focus {
    border-color: var(--accent-red);
    outline: none;
    box-shadow: 0 0 0 2px rgba(200, 45, 58, 0.1);
}

.time-slot-group div {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-slot-group .time-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    min-width: 150px; /* ラベル幅を揃える */
}

.time-slot-group .unit-price {
    font-size: 0.85rem;
    color: var(--accent-olive);
}

/* Checkbox group with columns */
.checkbox-group-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Default to 2 columns */
    gap: 10px 20px; /* row-gap column-gap */
}

.checkbox-group-columns label {
    /* components.cssのcheckbox labelスタイルを継承 */
    /* 必要なら調整 */
}

.info-text {
    font-size: 0.9rem;
    color: var(--accent-red);
    background-color: var(--bg-primary);
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 15px;
    line-height: 1.6;
}

.info-text-small {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.5;
}

/* Calculation Result Area */
.calculation-result-content {
    padding-top: 10px;
}

.calculation-result-content .result-items-container {
    margin-bottom: 20px;
}

.calculation-result-content .result-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dotted var(--bg-secondary);
    font-size: 1rem;
}
.calculation-result-content .result-item:first-child {
    padding-top: 0;
}
.calculation-result-content .result-item:last-child {
    border-bottom: none;
}

.calculation-result-content .result-label {
    color: var(--text-secondary);
}

.calculation-result-content .result-value {
    font-weight: 600;
    color: var(--text-primary);
}

.calculation-result-content .result-item.total {
    border-top: 2px solid var(--accent-red);
    margin-top: 15px;
    padding-top: 15px;
    font-size: 1.2rem;
}
.calculation-result-content .result-item.total .result-label {
    color: var(--accent-red);
    font-weight: bold;
}
.calculation-result-content .result-item.total .result-value {
    color: var(--accent-red);
    font-weight: bold;
}

.calculation-result-content .result-item.self-pay {
    background-color: var(--bg-primary);
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 1.1rem;
    border-bottom: none; /* 通常のdotted borderを解除 */
}
.calculation-result-content .result-item.self-pay .result-label {
    font-weight: bold;
}

.calculation-result-content .result-value.strong {
    font-weight: bold;
}
.calculation-result-content .result-value.strong.emphasis {
    color: var(--accent-red);
    font-size: 1.2em; /* total内のフォントサイズをさらに強調 */
}

.calculation-result-content .result-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 25px;
    text-align: center;
    line-height: 1.6;
}

.error-message {
    color: var(--accent-red);
    font-weight: bold;
    margin-top: 10px;
    padding: 10px;
    background-color: rgba(200, 45, 58, 0.05);
    border: 1px solid rgba(200, 45, 58, 0.2);
    border-radius: 6px;
}

/* Responsive for Simulation Page */
@media (min-width: 769px) {
    .simulation-content {
        flex-direction: row;
        align-items: flex-start; /* 上揃え */
    }
    .simulation-form-area {
        flex: 2; /* フォームエリアを広めに */
    }
    .simulation-result-area {
        flex: 1;
        position: sticky; /* 結果エリアを追従させる */
        top: 110px; /* ヘッダー高 + 少しの余白 */
    }
}

@media (max-width: 768px) {
    .simulation-form-area,
    .simulation-result-area {
        padding: 20px;
    }
    .simulation-subtitle {
        font-size: 1.5rem;
    }
    .simulation-section-subtitle {
        font-size: 1.15rem;
    }
    .checkbox-group-columns {
        grid-template-columns: 1fr; /* 1列表示に */
    }
    .time-slot-group div {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .time-slot-group .time-label {
        min-width: auto;
        margin-bottom: 3px;
    }
    .form-control-inline {
        width: 100px; /* SPでは少し幅を持たせる */
    }
}

/* スムーズスクロール */
html {
  scroll-behavior: smooth;
}

/* 目次のスタイル調整 */
.explanation-toc {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
    border-left: 4px solid var(--accent-olive);
}

.toc-title {
  margin-top: 0;
  margin-bottom: 0.8em; /* タイトルとリストの間隔を調整 */
  font-size: 1.3em; /* 少し大きく */
  color: var(--text-primary);
}

.explanation-toc ul {
  list-style: none;
  padding-left: 10px; /* 少しインデント */
  margin-bottom: 0;
}

.explanation-toc ul li {
  margin-bottom: 0.7em; /* 各項目の間隔を調整 */
}

.explanation-toc ul li a {
  text-decoration: none;
  color: var(--text-secondary); /* 通常時の文字色を少し濃く */
  font-weight: 500; /* 少し太字に */
  transition: color 0.2s ease-in-out, padding-left 0.2s ease-in-out; /* スムーズな変化 */
}

.explanation-toc ul li a:hover {
  color: var(--accent-red); /* ホバー時の色をアクセントカラーに */
  padding-left: 5px; /* ホバー時に少し左にずらすなど、動きをつける */
  text-decoration: none; /* 下線はなしに */
}

.explanation-toc ul li a::before {
    content: "▶ "; /* アイコンを追加 */
    color: var(--accent-orange); /* アイコンの色 */
    margin-right: 5px;
    font-size: 0.8em;
}

.explanation-toc ul li a:hover::before {
    color: var(--accent-orange);
}

/* Submenu styles for table of contents */
.explanation-toc ul ul {
    margin-left: 20px;
    margin-top: 8px;
    border-left: 2px solid var(--bg-secondary);
    padding-left: 15px;
}

.explanation-toc ul ul li {
    margin-bottom: 6px;
}

.explanation-toc ul ul li a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 6px 0;
}

.explanation-toc ul ul li a:hover {
    color: var(--accent-orange);
    padding-left: 8px;
}

.explanation-toc ul ul li a::before {
    content: "└ ";
    color: var(--accent-olive);
    font-size: 0.9rem;
    margin-right: 5px;
}

/* 説明セクションの視認性向上 */
.explanation-item {
    margin-bottom: 2.5em; /* 各説明項目の間隔を広げる */
}

.explanation-item h3.explanation-item-title {
    font-size: 1.5em; /* メインタイトルを少し大きく */
    color: var(--accent-red);
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--accent-red);
}

.explanation-item h4 {
    font-size: 1.2em; /* サブタイトルを明確に */
    color: var(--text-primary);
    margin-top: 2em; /* 上のブロックとの間隔を確保 */
    margin-bottom: 0.8em;
    padding-left: 10px;
    border-left: 4px solid var(--accent-orange);
}

.explanation-item p,
.explanation-item ul li,
.explanation-item ol li {
    line-height: 1.75; /* 行間を広げて読みやすく */
    margin-bottom: 0.7em; /* 段落やリストアイテム間のスペース */
}

/* === クレヨン風下線 強制適用テスト === */
.explanation-item strong {
  position: relative;
  isolation: isolate;
  color: inherit;
  padding-bottom: 3px;
  text-decoration: none;
}

.explanation-item strong::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -1px;
  height: 3.5px !important; /* 強制 */
  
  background-color: var(--accent-red) !important; /* 強制 */
  
  z-index: -1 !important; /* 強制 */
  
  opacity: 0.85 !important; /* 強制 */
  border-radius: 3px !important; /* 強制 */
  transform: rotate(-0.4deg) skewX(-4deg) !important; /* 強制 */
}

.explanation-item ul,
.explanation-item ol {
    padding-left: 25px; /* リストのインデントを標準より少し深めに */
    margin-bottom: 1em;
}

.explanation-item ul ul,
.explanation-item ul ol,
.explanation-item ol ul,
.explanation-item ol ol {
    padding-left: 30px; /* ネストされたリストはさらに深くインデント */
    margin-top: 0.5em;
}

.explanation-item ul li::marker,
.explanation-item ol li::marker {
    color: var(--accent-orange); /* リストマーカーの色を変更 */
}

/* 特定の長いリスト（疾病名など）のスタイル */
.explanation-item ul[class*="disease-list"], /* 将来的にクラスをつけることも考慮 */
.explanation-item p + ul, /* 段落の直後の最初のulなど、状況に応じて詳細指定 */
#medical-insurance-overview ul:not(:first-of-type) { /* ID指定でより具体的に */
    /* ここでは特定のスタイルは加えず、上記汎用スタイルを適用 */
    /* もしカラム分けなどが必要な場合は以下を検討 */
    /* column-count: 2; */
    /* column-gap: 30px; */
}

.explanation-item .info-text-small {
    margin-top: 1.5em;
    padding: 0.8em 1em;
    background-color: #f9f9f9;
    border-left: 3px solid var(--accent-blue); /* 注意書きのスタイル変更 */
    font-size: 0.9rem;
}

/* 注意喚起テキストのスタイル (詳細度を上げたセレクタ) */
#fee-simulation-form .form-group label.caution-text {
  display: block; /* ラベルをブロック要素にして、必要ならマージン調整しやすくする */
  color: #dc3545 !important; /* 直接赤色を指定（Bootstrap的な赤色） */
  font-size: 0.85rem;     /* 少し小さめのフォントサイズ */
  font-weight: normal;    /* 通常の太さ（必要に応じて調整） */
  margin-top: 8px;        /* 上の要素との間に少しマージン */
  line-height: 1.4;       /* 行間を少し調整 */
}

/* ツールチップスタイル */
.tooltip-trigger {
  display: inline-block;
  margin-left: 8px;
  width: 18px;
  height: 18px;
  background-color: var(--accent-orange);
  color: white;
  border-radius: 50%;
  text-align: center;
  font-size: 11px;
  line-height: 18px;
  cursor: pointer;
  position: relative;
  user-select: none;
  font-weight: bold;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
}

.tooltip-trigger:hover {
  background-color: var(--accent-red);
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ツールチップボックス */
.tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(51, 51, 51, 0.96);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: normal;
  line-height: 1.5;
  white-space: normal;
  width: 280px;
  text-align: left;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-family: 'Lora', serif;
}

/* ツールチップの矢印 */
.tooltip-trigger::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(51, 51, 51, 0.96);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ホバー時の表示 */
.tooltip-trigger:hover::after,
.tooltip-trigger:hover::before {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tooltip-trigger:hover::after {
  transform: translateX(-50%) translateY(-2px);
}

/* スマホ対応 - タップで表示 */
.tooltip-trigger.active::after,
.tooltip-trigger.active::before {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.tooltip-trigger.active::after {
  transform: translateX(-50%) translateY(-2px);
}

/* 動的位置調整用クラス */
.tooltip-trigger.tooltip-left-align::after {
  left: auto !important;
  right: 0 !important;
  transform: translateY(-2px) !important;
}

.tooltip-trigger.tooltip-left-align::before {
  left: auto !important;
  right: 15px !important;
  transform: none !important;
}

.tooltip-trigger.tooltip-left-align.active::after {
  left: auto !important;
  right: 0 !important;
  transform: translateY(-2px) !important;
}

.tooltip-trigger.tooltip-left-align.active::before {
  left: auto !important;
  right: 15px !important;
  transform: none !important;
}

/* 左端配置用（右寄せ）クラス */
.tooltip-trigger.tooltip-right-align::after {
  left: 0 !important;
  right: auto !important;
  transform: translateY(-2px) !important;
}

.tooltip-trigger.tooltip-right-align::before {
  left: 15px !important;
  right: auto !important;
  transform: none !important;
}

.tooltip-trigger.tooltip-right-align.active::after {
  left: 0 !important;
  right: auto !important;
  transform: translateY(-2px) !important;
}

.tooltip-trigger.tooltip-right-align.active::before {
  left: 15px !important;
  right: auto !important;
  transform: none !important;
}

/* ホバー時の左寄せ対応 */
.tooltip-trigger.tooltip-left-align:hover::after {
  left: auto !important;
  right: 0 !important;
  transform: translateY(-2px) !important;
}

.tooltip-trigger.tooltip-left-align:hover::before {
  left: auto !important;
  right: 15px !important;
  transform: none !important;
}

/* ホバー時の右寄せ対応 */
.tooltip-trigger.tooltip-right-align:hover::after {
  left: 0 !important;
  right: auto !important;
  transform: translateY(-2px) !important;
}

.tooltip-trigger.tooltip-right-align:hover::before {
  left: 15px !important;
  right: auto !important;
  transform: none !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .tooltip-trigger {
    width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 10px;
  }
  
  /* スマホ画面では常に右寄せにして見切れを防ぐ */
  .tooltip-trigger::after {
    width: 200px;
    font-size: 12px;
    padding: 8px 12px;
    /* 常に右寄せにして見切れを防ぐ */
    left: auto !important;
    right: 0 !important;
    transform: translateY(-2px) !important;
    max-width: calc(100vw - 40px); /* 画面幅 - 左右マージン */
  }
  
  .tooltip-trigger::before {
    border-width: 5px;
    /* 矢印も右寄せに調整 */
    left: auto !important;
    right: 12px !important;
    transform: none !important;
  }
  
  /* アクティブ時も同様 */
  .tooltip-trigger.active::after {
    left: auto !important;
    right: 0 !important;
    transform: translateY(-2px) !important;
  }
  
  .tooltip-trigger.active::before {
    left: auto !important;
    right: 12px !important;
    transform: none !important;
  }
  
  /* ホバー時も同様（念のため） */
  .tooltip-trigger:hover::after {
    left: auto !important;
    right: 0 !important;
    transform: translateY(-2px) !important;
  }
  
  .tooltip-trigger:hover::before {
    left: auto !important;
    right: 12px !important;
    transform: none !important;
  }
}

@media (max-width: 480px) {
  .tooltip-trigger::after {
    width: 160px !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
    /* より小さい画面では更に幅を狭く */
    left: auto !important;
    right: 0 !important;
    transform: translateY(-2px) !important;
    max-width: calc(100vw - 30px) !important; /* 画面幅 - 左右マージン */
  }
  
  .tooltip-trigger::before {
    left: auto !important;
    right: 10px !important;
    transform: none !important;
  }
  
  .tooltip-trigger.active::after {
    width: 160px !important;
    left: auto !important;
    right: 0 !important;
    transform: translateY(-2px) !important;
  }
  
  .tooltip-trigger.active::before {
    left: auto !important;
    right: 10px !important;
    transform: none !important;
  }
}

@media (max-width: 320px) {
  .tooltip-trigger::after {
    width: 140px !important;
    font-size: 10px !important;
    padding: 5px 8px !important;
    max-width: calc(100vw - 25px) !important; /* さらに小さい画面用 */
    left: auto !important;
    right: 0 !important;
    transform: translateY(-2px) !important;
  }
  
  .tooltip-trigger::before {
    right: 8px !important;
    left: auto !important;
    transform: none !important;
  }
  
  .tooltip-trigger.active::after {
    width: 140px !important;
    left: auto !important;
    right: 0 !important;
    transform: translateY(-2px) !important;
  }
  
  .tooltip-trigger.active::before {
    left: auto !important;
    right: 8px !important;
    transform: none !important;
  }
}

/* iPhone XR、iPhone 12 Pro サイズ (376px-414px) */
@media (min-width: 376px) and (max-width: 414px) {
  .simulation-form-area,
  .simulation-result-area {
    padding: 25px; /* 適切なパディング */
  }

  .simulation-subtitle {
    font-size: 1.6rem; /* 適切なサイズ */
    margin-bottom: 20px;
  }

  .simulation-section-subtitle {
    font-size: 1.15rem; /* 適切なサイズ */
  }

  .form-group {
    margin-bottom: 18px; /* 適切なマージン */
  }

  .form-group label {
    font-size: 0.95rem; /* 適切なサイズ */
    margin-bottom: 8px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 11px 14px; /* 適切なパディング */
    font-size: 0.95rem;
  }

  .time-slot-group div {
    align-items: center;
    gap: 10px; /* 適切な間隔 */
    flex-wrap: wrap;
    padding: 6px 0;
  }

  .time-slot-group .time-label {
    min-width: 140px; /* 適切な幅 */
    font-size: 0.9rem;
  }

  .time-period-label {
    font-size: 1.05rem; /* 適切なサイズ */
    margin-bottom: 12px;
  }

  .form-control-inline {
    width: 60px; /* 適切な幅 */
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .unit-price {
    font-size: 0.85rem; /* 適切なサイズ */
  }

  .checkbox-group-columns {
    grid-template-columns: 1fr; /* 1列表示 */
    gap: 12px;
  }

  .checkbox-group label,
  .radio-group label {
    font-size: 0.9rem; /* 適切なサイズ */
  }

  .calculation-result-content .result-item {
    padding: 10px 15px; /* 適切なパディング */
  }

  .calculation-result-content .result-item.total {
    padding: 12px 15px; /* 適切なパディング */
    margin-top: 15px;
  }

  .calculation-result-content .result-item.self-pay {
    padding: 12px 15px; /* 適切なパディング */
    margin-top: 12px;
  }

  .info-text {
    font-size: 0.9rem; /* 適切なサイズ */
    padding: 12px 15px;
    margin: 15px 0;
  }

  .info-text-small {
    font-size: 0.85rem; /* 適切なサイズ */
    padding: 10px 12px;
    margin: 12px 0;
  }

  .explanation-toc {
    padding: 20px; /* 適切なパディング */
  }

  .toc-title {
    font-size: 1.3rem; /* 適切なサイズ */
    margin-bottom: 15px;
  }

  .explanation-item {
    margin-bottom: 2rem; /* 適切なマージン */
  }

  .explanation-item h3.explanation-item-title {
    font-size: 1.4rem; /* 適切なサイズ */
    margin-bottom: 0.8rem;
  }

  .explanation-item h4 {
    font-size: 1.15rem; /* 適切なサイズ */
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
  }

  .explanation-item p,
  .explanation-item ul li,
  .explanation-item ol li {
    font-size: 0.95rem; /* 適切なサイズ */
    line-height: 1.7;
  }

  .explanation-item ul,
  .explanation-item ol {
    padding-left: 20px; /* 適切なインデント */
  }

  .tooltip-trigger {
    width: 15px; /* 適切なサイズ */
    height: 15px;
    font-size: 11px;
    line-height: 15px;
  }

  .tooltip-trigger::after {
    width: 220px; /* 適切な幅 */
    font-size: 12px;
  }
}

/* iPhone 14 Pro Max など大画面 (415px以上) */
@media (min-width: 415px) and (max-width: 767px) {
  .simulation-form-area,
  .simulation-result-area {
    padding: 30px; /* 大画面用パディング */
  }

  .simulation-subtitle {
    font-size: 1.8rem; /* 大画面用サイズ */
    margin-bottom: 25px;
  }

  .simulation-section-subtitle {
    font-size: 1.25rem; /* 大画面用サイズ */
  }

  .form-group {
    margin-bottom: 22px; /* 大画面用マージン */
  }

  .form-group label {
    font-size: 1rem; /* 大画面用サイズ */
    margin-bottom: 10px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 12px 16px; /* 大画面用パディング */
    font-size: 1rem;
  }

  .time-slot-group div {
    gap: 12px; /* 大画面用間隔 */
    padding: 8px 0;
  }

  .time-slot-group .time-label {
    min-width: 160px; /* 大画面用幅 */
    font-size: 0.95rem;
  }

  .time-period-label {
    font-size: 1.1rem; /* 大画面用サイズ */
    margin-bottom: 15px;
  }

  .form-control-inline {
    width: 70px; /* 大画面用幅 */
    padding: 9px 12px;
    font-size: 0.95rem;
  }

  .unit-price {
    font-size: 0.9rem; /* 大画面用サイズ */
  }

  .checkbox-group-columns {
    grid-template-columns: 1fr; /* 1列表示 */
    gap: 15px;
  }

  .checkbox-group label,
  .radio-group label {
    font-size: 0.95rem; /* 大画面用サイズ */
  }

  .calculation-result-content .result-item {
    padding: 12px 18px; /* 大画面用パディング */
  }

  .calculation-result-content .result-item.total {
    padding: 15px 18px; /* 大画面用パディング */
    margin-top: 18px;
  }

  .calculation-result-content .result-item.self-pay {
    padding: 15px 18px; /* 大画面用パディング */
    margin-top: 15px;
  }

  .info-text {
    font-size: 0.95rem; /* 大画面用サイズ */
    padding: 15px 18px;
    margin: 18px 0;
  }

  .info-text-small {
    font-size: 0.9rem; /* 大画面用サイズ */
    padding: 12px 15px;
    margin: 15px 0;
  }

  .explanation-toc {
    padding: 25px; /* 大画面用パディング */
  }

  .toc-title {
    font-size: 1.4rem; /* 大画面用サイズ */
    margin-bottom: 18px;
  }

  .explanation-item {
    margin-bottom: 2.2rem; /* 大画面用マージン */
  }

  .explanation-item h3.explanation-item-title {
    font-size: 1.5rem; /* 大画面用サイズ */
    margin-bottom: 1rem;
  }

  .explanation-item h4 {
    font-size: 1.2rem; /* 大画面用サイズ */
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
  }

  .explanation-item p,
  .explanation-item ul li,
  .explanation-item ol li {
    font-size: 1rem; /* 大画面用サイズ */
    line-height: 1.75;
  }

  .explanation-item ul,
  .explanation-item ol {
    padding-left: 25px; /* 大画面用インデント */
  }

  .tooltip-trigger {
    width: 16px; /* 大画面用サイズ */
    height: 16px;
    font-size: 12px;
    line-height: 16px;
  }

  .tooltip-trigger::after {
    width: 250px; /* 大画面用幅 */
    font-size: 13px;
  }
}

@media (max-width: 375px) {
  .simulation-form-area,
  .simulation-result-area {
    padding: 18px; /* 小画面用パディング（少し大きく戻す） */
  }

  .simulation-subtitle {
    font-size: 1.4rem; /* 小画面用サイズ（少し大きく戻す） */
    margin-bottom: 18px;
  }

  .simulation-section-subtitle {
    font-size: 1.05rem; /* 小画面用サイズ（少し大きく戻す） */
  }

  .form-group {
    margin-bottom: 15px; /* 小画面用マージン */
  }

  .form-group label {
    font-size: 0.9rem; /* 小画面用サイズ（少し大きく戻す） */
    margin-bottom: 6px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px 12px; /* 小画面用パディング（少し大きく戻す） */
    font-size: 0.95rem;
  }

  .time-slot-group div {
    align-items: flex-start;
    gap: 8px; /* 小画面用間隔 */
    flex-direction: column;
    padding: 5px 0;
  }

  .time-slot-group .time-label {
    min-width: auto; /* 小画面では幅制限なし */
    font-size: 0.85rem;
  }

  .time-period-label {
    font-size: 1rem; /* 小画面用サイズ（少し大きく戻す） */
    margin-bottom: 10px;
  }

  .form-control-inline {
    width: 55px; /* 小画面用幅 */
    padding: 6px 8px;
    font-size: 0.85rem;
  }

  .unit-price {
    font-size: 0.8rem; /* 小画面用サイズ */
  }

  .checkbox-group-columns {
    grid-template-columns: 1fr; /* 1列表示 */
    gap: 10px;
  }

  .checkbox-group label,
  .radio-group label {
    font-size: 0.85rem; /* 小画面用サイズ（少し大きく戻す） */
  }

  .calculation-result-content .result-item {
    padding: 8px 12px; /* 小画面用パディング（少し大きく戻す） */
  }

  .calculation-result-content .result-item.total {
    padding: 10px 12px; /* 小画面用パディング（少し大きく戻す） */
    margin-top: 12px;
  }

  .calculation-result-content .result-item.self-pay {
    padding: 10px 12px; /* 小画面用パディング（少し大きく戻す） */
    margin-top: 10px;
  }

  .info-text {
    font-size: 0.85rem; /* 小画面用サイズ（少し大きく戻す） */
    padding: 10px 12px;
    margin: 12px 0;
  }

  .info-text-small {
    font-size: 0.8rem; /* 小画面用サイズ（少し大きく戻す） */
    padding: 8px 10px;
    margin: 10px 0;
  }

  .explanation-toc {
    padding: 15px; /* 小画面用パディング（少し大きく戻す） */
  }

  .toc-title {
    font-size: 1.2rem; /* 小画面用サイズ（少し大きく戻す） */
    margin-bottom: 12px;
  }

  .explanation-item {
    margin-bottom: 1.8rem; /* 小画面用マージン（少し大きく戻す） */
  }

  .explanation-item h3.explanation-item-title {
    font-size: 1.3rem; /* 小画面用サイズ（少し大きく戻す） */
    margin-bottom: 0.7rem;
  }

  .explanation-item h4 {
    font-size: 1.1rem; /* 小画面用サイズ（少し大きく戻す） */
    margin-top: 1.3rem;
    margin-bottom: 0.6rem;
  }

  .explanation-item p,
  .explanation-item ul li,
  .explanation-item ol li {
    font-size: 0.9rem; /* 小画面用サイズ（少し大きく戻す） */
    line-height: 1.6;
  }

  .explanation-item ul,
  .explanation-item ol {
    padding-left: 18px; /* 小画面用インデント（少し大きく戻す） */
  }

  .tooltip-trigger {
    width: 14px; /* 小画面用サイズ */
    height: 14px;
    font-size: 10px;
    line-height: 14px;
  }

  .tooltip-trigger::after {
    width: 180px; /* 小画面用幅 */
    font-size: 11px;
  }
}