/* ==========================================================================
   TSUNAGU 訪問看護 料金シミュレーター（/fee-simulator/ 専用）
   - 既存の assets/css/style.css の変数（--tsunagu-*）を使う。既存のクラスは上書きしない
   - クラス名は tsunagu-fee- で始める
   ========================================================================== */

.tsunagu-fee { margin-top: 8px; }
.tsunagu-fee__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 1100px) {
  .tsunagu-fee__layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .tsunagu-fee__summary { position: sticky; top: calc(var(--tsunagu-header-h) + 24px); }
}
.tsunagu-fee__main { min-width: 0; }

/* 手順 */
.tsunagu-fee__progress { display: flex; gap: 6px; margin: 0 0 24px; padding: 0; list-style: none; counter-reset: none; }
.tsunagu-fee__progress li { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--tsunagu-text-soft); text-align: center; line-height: 1.4; position: relative; }
.tsunagu-fee__progress li::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--tsunagu-border); z-index: 0; }
.tsunagu-fee__progress li:first-child::before { display: none; }
.tsunagu-fee__progress-num { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--tsunagu-white); border: 2px solid var(--tsunagu-border); font-weight: 700; font-size: 14px; }
.tsunagu-fee__progress li.is-done .tsunagu-fee__progress-num { border-color: var(--tsunagu-coral); color: var(--tsunagu-coral-deep); }
.tsunagu-fee__progress li.is-done::before, .tsunagu-fee__progress li.is-current::before { background: var(--tsunagu-coral); }
.tsunagu-fee__progress li.is-current .tsunagu-fee__progress-num { background: var(--tsunagu-coral-deep); border-color: var(--tsunagu-coral-deep); color: #fff; }
.tsunagu-fee__progress li.is-current { color: var(--tsunagu-text); font-weight: 700; }
@media (max-width: 640px) {
  .tsunagu-fee__progress-label { display: none; }
  .tsunagu-fee__progress li.is-current .tsunagu-fee__progress-label { display: none; }
}

/* ステップの本体 */
.tsunagu-fee__step { background: var(--tsunagu-white); border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius); box-shadow: var(--tsunagu-shadow); padding: 32px; }
@media (max-width: 768px) { .tsunagu-fee__step { padding: 22px 18px; } }
.tsunagu-fee__step-title { font-family: var(--tsunagu-font-serif); font-weight: 600; font-size: 22px; line-height: 1.5; margin: 0 0 20px; padding-left: 14px; border-left: 4px solid var(--tsunagu-coral); }
.tsunagu-fee__step-title:focus { outline: none; }
.tsunagu-fee__step-title:focus-visible { outline: 3px solid var(--tsunagu-teal-deep); outline-offset: 4px; }
.tsunagu-fee__h3 { font-size: 17px; font-weight: 700; margin: 0 0 10px; }

.tsunagu-fee__field { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
.tsunagu-fee__legend { display: block; font-weight: 700; font-size: 16px; line-height: 1.6; margin: 0 0 10px; padding: 0; }
.tsunagu-fee__help { font-size: 14px; color: var(--tsunagu-text-soft); line-height: 1.7; margin: -4px 0 12px; }
.tsunagu-fee__notice { background: var(--tsunagu-yellow-light); border-radius: var(--tsunagu-radius-sm); padding: 14px 16px; font-size: 15px; line-height: 1.7; }

/* 選択肢（カード型） */
.tsunagu-fee__options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tsunagu-fee__options--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tsunagu-fee__options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tsunagu-fee__options--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tsunagu-fee__options--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .tsunagu-fee__options--2, .tsunagu-fee__options--3 { grid-template-columns: minmax(0, 1fr); }
  .tsunagu-fee__options--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tsunagu-fee__options--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.tsunagu-fee__option { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 10px 14px 10px 42px; border: 1.5px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); background: var(--tsunagu-white); cursor: pointer; line-height: 1.45; transition: border-color .15s, background-color .15s; }
.tsunagu-fee__option:hover { border-color: var(--tsunagu-coral); }
.tsunagu-fee__option input { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin: -9px 0 0; accent-color: var(--tsunagu-coral-deep); }
.tsunagu-fee__option.is-checked { border-color: var(--tsunagu-coral-deep); background: var(--tsunagu-coral-light); }
.tsunagu-fee__option-label { font-weight: 700; font-size: 16px; }
.tsunagu-fee__option-note { font-size: 13px; color: var(--tsunagu-text-soft); }
.tsunagu-fee__option:focus-within { outline: 3px solid var(--tsunagu-teal-deep); outline-offset: 2px; }

.tsunagu-fee__select { width: 100%; max-width: 420px; min-height: 48px; padding: 10px 40px 10px 14px; font: inherit; font-size: 16px; color: var(--tsunagu-text); background: var(--tsunagu-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235e5753' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; border: 1.5px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); appearance: none; -webkit-appearance: none; }
.tsunagu-fee__select:focus-visible { outline: 3px solid var(--tsunagu-teal-deep); outline-offset: 2px; }

/* 毎週の予定 */
.tsunagu-fee__row { border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius); padding: 20px; margin: 0 0 18px; background: var(--tsunagu-bg); }
@media (max-width: 768px) { .tsunagu-fee__row { padding: 16px 14px; } }
.tsunagu-fee__row .tsunagu-fee__field:last-child { margin-bottom: 0; }
.tsunagu-fee__row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.tsunagu-fee__row-title { font-size: 17px; font-weight: 700; margin: 0; color: var(--tsunagu-coral-deep); }
.tsunagu-fee__days { display: flex; flex-wrap: wrap; gap: 8px; }
.tsunagu-fee__day { position: relative; cursor: pointer; }
.tsunagu-fee__day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tsunagu-fee__day span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--tsunagu-border); background: var(--tsunagu-white); font-weight: 700; }
.tsunagu-fee__day.is-sun span { color: var(--tsunagu-coral-deep); }
.tsunagu-fee__day.is-sat span { color: var(--tsunagu-teal-deep); }
.tsunagu-fee__day.is-checked span { background: var(--tsunagu-coral-deep); border-color: var(--tsunagu-coral-deep); color: #fff; }
.tsunagu-fee__day input:focus-visible + span { outline: 3px solid var(--tsunagu-teal-deep); outline-offset: 2px; }
@media (max-width: 380px) { .tsunagu-fee__day span { width: 40px; height: 40px; } }
.tsunagu-fee__add-btn { display: block; width: 100%; min-height: 52px; border: 1.5px dashed var(--tsunagu-coral); border-radius: var(--tsunagu-radius-sm); background: transparent; color: var(--tsunagu-coral-deep); font: inherit; font-weight: 700; cursor: pointer; }
.tsunagu-fee__add-btn:hover { background: var(--tsunagu-coral-light); }
.tsunagu-fee__link-btn { background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 14px; color: var(--tsunagu-teal-deep); text-decoration: underline; cursor: pointer; }

/* カレンダー */
.tsunagu-fee__toggles { display: grid; gap: 8px; margin: 0 0 18px; }
.tsunagu-fee__toggle { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.6; cursor: pointer; }
.tsunagu-fee__toggle input { width: 20px; height: 20px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--tsunagu-coral-deep); }
.tsunagu-fee__count { font-weight: 700; margin: 0 0 10px; }
.tsunagu-fee__cal { border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); overflow: hidden; }
.tsunagu-fee__cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tsunagu-fee__cal-head { background: var(--tsunagu-bg); }
.tsunagu-fee__cal-wd { text-align: center; font-size: 13px; font-weight: 700; padding: 6px 0; }
.tsunagu-fee__cal-wd.is-sun, .tsunagu-fee__cal-cell.is-sun .tsunagu-fee__cal-num { color: var(--tsunagu-coral-deep); }
.tsunagu-fee__cal-wd.is-sat, .tsunagu-fee__cal-cell.is-sat .tsunagu-fee__cal-num { color: var(--tsunagu-teal-deep); }
.tsunagu-fee__cal-cell { min-height: 76px; border-top: 1px solid var(--tsunagu-border); border-left: 1px solid var(--tsunagu-border); background: var(--tsunagu-white); }
.tsunagu-fee__cal-cell:nth-child(7n+1) { border-left: 0; }
.tsunagu-fee__cal-cell.is-out { background: repeating-linear-gradient(45deg, #faf7f3, #faf7f3 6px, #f5f1ec 6px, #f5f1ec 12px); padding: 4px; opacity: .8; }
.tsunagu-fee__cal-cell.is-selected { box-shadow: inset 0 0 0 2px var(--tsunagu-coral-deep); }
.tsunagu-fee__cal-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; height: 100%; min-height: 76px; padding: 4px; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.tsunagu-fee__cal-btn:hover { background: var(--tsunagu-coral-light); }
.tsunagu-fee__cal-btn:focus-visible { outline: 3px solid var(--tsunagu-teal-deep); outline-offset: -3px; }
.tsunagu-fee__cal-num { font-size: 14px; font-weight: 700; line-height: 1.2; }
.tsunagu-fee__cal-badges, .tsunagu-fee__cal-chips { display: flex; flex-wrap: wrap; gap: 2px; }
.tsunagu-fee__chip, .tsunagu-fee__badge { display: inline-block; font-size: 11px; line-height: 1; padding: 3px 4px; border-radius: 4px; font-weight: 700; }
.tsunagu-fee__chip.is-nurse { background: var(--tsunagu-coral-light); color: var(--tsunagu-coral-deep); }
.tsunagu-fee__chip.is-rehab { background: var(--tsunagu-teal-light); color: var(--tsunagu-teal-deep); }
.tsunagu-fee__badge.is-holiday { background: var(--tsunagu-coral-deep); color: #fff; }
.tsunagu-fee__badge.is-closure { background: var(--tsunagu-yellow-light); color: #7a5a10; }
.tsunagu-fee__cal-sample { display: inline-block; width: 18px; height: 14px; vertical-align: middle; border: 1px solid var(--tsunagu-border); background: repeating-linear-gradient(45deg, #faf7f3, #faf7f3 3px, #ece6df 3px, #ece6df 6px); }
.tsunagu-fee__legend-list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--tsunagu-text-soft); }
@media (max-width: 480px) { .tsunagu-fee__cal-cell, .tsunagu-fee__cal-btn { min-height: 58px; } .tsunagu-fee__chip { font-size: 10px; padding: 2px 3px; } }

.tsunagu-fee__panel { margin-top: 18px; border: 1.5px solid var(--tsunagu-coral); border-radius: var(--tsunagu-radius-sm); padding: 18px; background: var(--tsunagu-white); }
.tsunagu-fee__panel-title { font-size: 17px; font-weight: 700; margin: 0 0 10px; }
.tsunagu-fee__panel-list { margin: 0 0 14px; padding: 0; list-style: none; }
.tsunagu-fee__panel-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--tsunagu-border); font-size: 15px; }
.tsunagu-fee__panel-item.is-removed { color: var(--tsunagu-text-soft); }
.tsunagu-fee__panel-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: center; }
.tsunagu-fee__panel-controls .tsunagu-fee__select { max-width: none; }
.tsunagu-fee__small-btn { min-height: 48px; }

/* 移動ボタン */
.tsunagu-fee__nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; }
.tsunagu-fee__nav .tsunagu-btn { min-width: 140px; }
@media (max-width: 480px) { .tsunagu-fee__nav .tsunagu-btn { min-width: 0; flex: 1 1 0; padding-left: 12px; padding-right: 12px; } }

/* 入力エラー */
.tsunagu-fee__errors { border: 1.5px solid var(--tsunagu-coral-deep); background: #fff6f5; border-radius: var(--tsunagu-radius-sm); padding: 14px 18px; margin: 0 0 20px; font-size: 15px; }
.tsunagu-fee__errors ul { margin: 6px 0 0; padding-left: 1.2em; list-style: disc; }
.tsunagu-fee__errors:focus { outline: none; }
.tsunagu-fee__error { color: var(--tsunagu-coral-deep); font-size: 14px; font-weight: 700; margin: 8px 0 0; }

/* 要約 */
.tsunagu-fee__summary { background: var(--tsunagu-white); border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius); padding: 20px; font-size: 14px; }
.tsunagu-fee__summary-title { font-weight: 700; margin: 0 0 10px; font-size: 15px; }
.tsunagu-fee__summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.tsunagu-fee__summary dt { color: var(--tsunagu-text-soft); }
.tsunagu-fee__summary dd { margin: 0; }
.tsunagu-fee__summary ul { margin: 0; padding: 0; list-style: none; }
@media (max-width: 1099px) { .tsunagu-fee__summary { order: 2; } }

/* 結果 */
.tsunagu-fee__result { background: var(--tsunagu-coral-light); border-radius: var(--tsunagu-radius); padding: 26px 24px; text-align: center; margin-bottom: 20px; }
.tsunagu-fee__result-label { font-weight: 700; margin: 0 0 4px; }
.tsunagu-fee__result-amount { margin: 0 0 12px; color: var(--tsunagu-coral-deep); line-height: 1.2; }
.tsunagu-fee__num { font-family: var(--tsunagu-font-serif); font-size: clamp(40px, 8vw, 56px); font-weight: 600; letter-spacing: .02em; }
.tsunagu-fee__unit { font-size: 20px; font-weight: 700; margin-left: 4px; }
.tsunagu-fee__result-sub { display: inline-grid; grid-template-columns: auto auto; gap: 4px 16px; margin: 0; font-size: 15px; text-align: left; }
.tsunagu-fee__result-sub dd { margin: 0; font-weight: 700; text-align: right; }
.tsunagu-fee__details { border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); padding: 0 18px; margin-bottom: 20px; }
.tsunagu-fee__details summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.tsunagu-fee__table-wrap { overflow-x: auto; padding-bottom: 14px; }
.tsunagu-fee__table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
.tsunagu-fee__table th, .tsunagu-fee__table td { border-bottom: 1px solid var(--tsunagu-border); padding: 8px 6px; text-align: right; vertical-align: top; }
.tsunagu-fee__table th[scope="row"], .tsunagu-fee__table thead th:first-child { text-align: left; font-weight: 500; }
.tsunagu-fee__table thead th { font-weight: 700; background: var(--tsunagu-bg); }
.tsunagu-fee__table tfoot th, .tsunagu-fee__table tfoot td { font-weight: 700; }
.tsunagu-fee__visits { margin-bottom: 20px; }
.tsunagu-fee__visit-list { margin: 0; padding-left: 1.2em; list-style: disc; font-size: 14px; columns: 2 280px; }
.tsunagu-fee__notes { margin: 0 0 20px; padding: 14px 16px 14px 2em; list-style: "※ "; background: var(--tsunagu-bg); border-radius: var(--tsunagu-radius-sm); font-size: 14px; color: var(--tsunagu-text-soft); }
.tsunagu-fee__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* 計算できない場合 */
.tsunagu-fee__stop { border-left: 4px solid var(--tsunagu-yellow); background: var(--tsunagu-yellow-light); border-radius: var(--tsunagu-radius-sm); padding: 20px 22px; margin-bottom: 20px; }
.tsunagu-fee__stop-title { font-family: var(--tsunagu-font-serif); font-weight: 600; font-size: 20px; margin: 0 0 8px; }
.tsunagu-fee__reasons { margin: 0; padding-left: 1.2em; list-style: disc; }
.tsunagu-fee__contact { border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); padding: 20px 22px; margin-bottom: 20px; background: var(--tsunagu-white); }
.tsunagu-fee__tel { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; }
.tsunagu-fee__tel-label { font-size: 14px; color: var(--tsunagu-text-soft); }
.tsunagu-fee__tel-num { font-family: var(--tsunagu-font-serif); font-size: 28px; font-weight: 600; color: var(--tsunagu-coral-deep); text-decoration: none; }

/* 読み込み前・JavaScript なし */
.tsunagu-fee__loading { color: var(--tsunagu-text-soft); }

@media print {
  .tsunagu-fee__nav, .tsunagu-fee__progress, .tsunagu-fee__actions, .tsunagu-fee__summary { display: none !important; }
  .tsunagu-fee__step { box-shadow: none; border: 0; padding: 0; }
  .tsunagu-fee__details { border: 0; }
  .tsunagu-fee__details:not([open]) > .tsunagu-fee__table-wrap { display: block; }
}

/* 戻るボタン：既存のボタンの右向き矢印（::after）を、このページでは表示しない */
.tsunagu-fee__prev::after { display: none; }
.tsunagu-fee__prev::before { content: "‹"; margin-right: 8px; font-weight: 700; }


/* ==========================================================================
   v3（3ステップ）2026-09-25
   ========================================================================== */
.tsunagu-fee__main { max-width: 860px; margin: 0 auto; }
.tsunagu-fee__progress { max-width: 520px; margin-left: auto; margin-right: auto; }
.tsunagu-fee__nav--end { justify-content: flex-end; }
.tsunagu-fee__nav .tsunagu-fee__next { min-width: 220px; }
@media (max-width: 480px) { .tsunagu-fee__nav--end .tsunagu-fee__next { flex: 1 1 auto; } }
.tsunagu-fee__back::after { display: none; }

/* 折りたたみ（加算・詳細設定／訪問日の修正） */
.tsunagu-fee__edit { border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); background: var(--tsunagu-white); margin: 18px 0 0; }
.tsunagu-fee__edit > summary { cursor: pointer; list-style: none; padding: 16px 44px 16px 18px; font-weight: 700; position: relative; line-height: 1.5; }
.tsunagu-fee__edit > summary::-webkit-details-marker { display: none; }
.tsunagu-fee__edit > summary::after { content: "＋"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--tsunagu-coral-deep); font-weight: 700; }
.tsunagu-fee__edit[open] > summary::after { content: "－"; }
.tsunagu-fee__edit > summary:focus-visible { outline: 3px solid var(--tsunagu-teal-deep); outline-offset: 2px; border-radius: var(--tsunagu-radius-sm); }
.tsunagu-fee__summary-note { font-weight: 400; font-size: 14px; color: var(--tsunagu-text-soft); margin-left: 6px; }
.tsunagu-fee__edit-body { padding: 0 18px 18px; border-top: 1px dashed var(--tsunagu-border); padding-top: 14px; }
.tsunagu-fee__addbox { border-color: var(--tsunagu-coral); }

.tsunagu-fee__add-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.tsunagu-fee__add-item { border: 1.5px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); background: var(--tsunagu-white); }
.tsunagu-fee__add-item.is-checked { border-color: var(--tsunagu-coral-deep); background: var(--tsunagu-coral-light); }
.tsunagu-fee__add-item.is-na { background: #faf8f5; }
.tsunagu-fee__add-label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; cursor: pointer; }
.tsunagu-fee__add-label input { width: 20px; height: 20px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--tsunagu-coral-deep); }
.tsunagu-fee__add-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.55; }
.tsunagu-fee__add-name { font-weight: 700; font-size: 16px; }
.tsunagu-fee__add-official { font-size: 13px; color: var(--tsunagu-teal-deep); }
.tsunagu-fee__add-help { font-size: 13px; color: var(--tsunagu-text-soft); }
.tsunagu-fee__add-na { font-size: 13px; font-weight: 700; color: #7a5a10; }
.tsunagu-fee__add-rows { padding: 0 14px 12px 46px; display: grid; gap: 6px; }

/* カレンダー（表示のみ） */
.tsunagu-fee__calwrap { margin-top: 26px; }
.tsunagu-fee__cal-cell { padding: 4px; min-height: 64px; }
.tsunagu-fee__cal-cell.is-out { background: #faf7f3; }
.tsunagu-fee__cal-cell.has-visit { background: #fffaf8; }
@media (max-width: 480px) { .tsunagu-fee__cal-cell { min-height: 52px; } }

/* 結果 */
.tsunagu-fee__approx { font-size: 20px; font-weight: 700; margin-right: 4px; }
.tsunagu-fee__result-note { font-size: 14px; color: var(--tsunagu-text-soft); margin: 0 0 8px; }
.tsunagu-fee__result-adds { font-size: 14px; margin: 0; }
.tsunagu-fee__result-adds-label { font-weight: 700; }
.tsunagu-fee__result-adds-note { font-size: 12px; color: var(--tsunagu-text-soft); margin: 2px 0 0; }
.tsunagu-fee__details .tsunagu-fee__result-sub { display: grid; grid-template-columns: 1fr auto; margin: 0 0 14px; }
.tsunagu-fee__details .tsunagu-fee__h3 { margin-top: 14px; }
@media (max-width: 560px) {
  .tsunagu-fee__table { min-width: 0; }
  .tsunagu-fee__table th, .tsunagu-fee__table td { padding: 8px 4px; }
}
.tsunagu-fee__errors a { color: inherit; }
@media (max-width: 640px) {
  .tsunagu-fee__options--5 .tsunagu-fee__option { padding: 10px 8px 10px 34px; min-height: 48px; }
  .tsunagu-fee__options--5 .tsunagu-fee__option input { left: 10px; }
  .tsunagu-fee__options--5 .tsunagu-fee__option-label { font-size: 15px; white-space: nowrap; }
}

/* ==========================================================================
   加算・減算の分類（自動計算／選択できる加算／未対応）2026-09-26 A案
   ========================================================================== */
.tsunagu-fee__addsec { margin: 0 0 18px; }
.tsunagu-fee__h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 0 0 10px; line-height: 1.5; }
.tsunagu-fee__kind { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.4; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; }
.tsunagu-fee__kind.is-base { color: var(--tsunagu-text-soft); }
.tsunagu-fee__kind.is-auto { color: var(--tsunagu-teal-deep); }
.tsunagu-fee__kind.is-selected { color: var(--tsunagu-coral-deep); }
.tsunagu-fee__kind.is-reduction { color: #3d5a80; }
.tsunagu-fee__kind.is-na { color: #7a5a10; }
.tsunagu-fee__kind.is-info { color: var(--tsunagu-text-soft); }
.tsunagu-fee__auto-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tsunagu-fee__auto-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: flex-start; padding: 10px 12px; border: 1px dashed var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); background: #fbfaf8; }
.tsunagu-fee__auto-list .tsunagu-fee__kind { margin-top: 3px; flex: 0 0 auto; }
.tsunagu-fee__auto-list .tsunagu-fee__add-text { flex: 1 1 240px; min-width: 0; }
.tsunagu-fee__add-text, .tsunagu-fee__add-name { overflow-wrap: anywhere; }
.tsunagu-fee__sub { border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); background: #fbfaf8; margin: 10px 0 0; padding: 0 14px; }
.tsunagu-fee__sub > summary { cursor: pointer; list-style: none; padding: 12px 36px 12px 0; font-weight: 700; position: relative; line-height: 1.5; }
.tsunagu-fee__sub > summary::-webkit-details-marker { display: none; }
.tsunagu-fee__sub > summary::after { content: "＋"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--tsunagu-coral-deep); }
.tsunagu-fee__sub[open] > summary::after { content: "－"; }
.tsunagu-fee__sub > summary:focus-visible { outline: 3px solid var(--tsunagu-teal-deep); outline-offset: 2px; }
.tsunagu-fee__sub[open] { padding-bottom: 14px; }
.tsunagu-fee__sub .tsunagu-fee__h4 { margin-top: 16px; }
.tsunagu-fee__status { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; font-size: 14px; }
.tsunagu-fee__status dt { font-weight: 700; }
.tsunagu-fee__status dd { margin: 0 0 6px; }
.tsunagu-fee__status dd.is-unset, .tsunagu-fee__status dd.is-reduction { color: #7a5a10; }
.tsunagu-fee__auto-stop { margin: 0 0 4px; padding-left: 1.2em; font-size: 14px; line-height: 1.6; }
.tsunagu-fee__auto-stop li span + span { display: block; font-size: 12px; }
.tsunagu-fee__kind-legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--tsunagu-text-soft); }
.tsunagu-fee__kind-legend .tsunagu-fee__kind { margin-right: 4px; }
.tsunagu-fee__table tbody th .tsunagu-fee__kind { margin-right: 4px; }
.tsunagu-fee__table tbody tr.is-reduction td { color: #3d5a80; }
.tsunagu-fee__reasons li { margin-bottom: 6px; }
.tsunagu-fee__reason-items { display: block; font-size: 13px; font-weight: 700; margin-top: 2px; }
.tsunagu-fee__codes { font-family: monospace; font-size: 13px; margin: 0; word-break: break-all; }
@media (max-width: 560px) {
  .tsunagu-fee__table tbody th .tsunagu-fee__kind { display: table; margin: 0 0 2px; }
  .tsunagu-fee__addbox > .tsunagu-fee__edit-body { padding-left: 12px; padding-right: 12px; }
  .tsunagu-fee__sub { padding: 0 8px; }
  .tsunagu-fee__sub .tsunagu-fee__add-label { padding: 10px; gap: 10px; }
  .tsunagu-fee__sub .tsunagu-fee__add-rows { padding-left: 40px; }
}
@media print {
  .tsunagu-fee__kind { border-color: #000; color: #000 !important; }
}
.tsunagu-fee__official-name { display: block; font-size: 12px; font-weight: 400; color: var(--tsunagu-text-soft); margin-top: 2px; }

/* ==========================================================================
   料金内訳：スマートフォンはカード、PC・タブレットは表（2026-09-28）
   ========================================================================== */
.tsunagu-fee__bd-cards { display: none; list-style: none; margin: 0 0 14px; padding: 0; }
@media (max-width: 640px) {
  .tsunagu-fee__table-wrap { display: none; }
  .tsunagu-fee__bd-cards { display: grid; gap: 10px; }
}
.tsunagu-fee__bd-card { border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); background: var(--tsunagu-white); padding: 12px 14px; min-width: 0; }
.tsunagu-fee__bd-card.is-reduction { border-left: 4px solid #3d5a80; }
.tsunagu-fee__bd-card.is-selected { border-left: 4px solid var(--tsunagu-coral-deep); }
.tsunagu-fee__bd-card.is-auto { border-left: 4px solid var(--tsunagu-teal-deep); }
.tsunagu-fee__bd-card.is-total { background: var(--tsunagu-bg); }
.tsunagu-fee__bd-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 8px; font-size: 16px; font-weight: 700; line-height: 1.5; }
.tsunagu-fee__bd-label { min-width: 0; overflow-wrap: anywhere; }
.tsunagu-fee__bd-nums { margin: 0; display: grid; gap: 4px; font-size: 14px; }
.tsunagu-fee__bd-nums > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tsunagu-fee__bd-nums dt { color: var(--tsunagu-text-soft); font-weight: 400; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.tsunagu-fee__bd-nums dd { flex: 0 0 auto; margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tsunagu-fee__bd-nums .is-subtotal dd { font-weight: 700; font-size: 16px; }
.tsunagu-fee__bd-card.is-reduction .tsunagu-fee__bd-nums dd { color: #3d5a80; }
.tsunagu-fee__bd-official { margin-top: 8px; font-size: 12px; color: var(--tsunagu-text-soft); }
.tsunagu-fee__bd-official > summary { cursor: pointer; display: inline-block; list-style: none; padding: 4px 0; min-height: 24px; color: var(--tsunagu-teal-deep); }
.tsunagu-fee__bd-official > summary::-webkit-details-marker { display: none; }
.tsunagu-fee__bd-official > summary::before { content: "＋"; margin-right: 4px; }
.tsunagu-fee__bd-official[open] > summary::before { content: "－"; }
.tsunagu-fee__bd-official > summary:focus-visible { outline: 2px solid var(--tsunagu-teal-deep); outline-offset: 2px; }
.tsunagu-fee__bd-official p { margin: 4px 0 0; overflow-wrap: anywhere; line-height: 1.6; }
@media print {
  .tsunagu-fee__bd-cards { display: none !important; }
  .tsunagu-fee__table-wrap { display: block !important; }
}

/* ==========================================================================
   医療保険（確認用の表示）2026-09-29
   ========================================================================== */
.tsunagu-fee__preview { border-left: 4px solid var(--tsunagu-teal-deep); }
.tsunagu-fee__preview-title { font-weight: 700; margin: 0 0 4px; }
.tsunagu-fee__day-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tsunagu-fee__day-card { border: 1px solid var(--tsunagu-border); border-radius: var(--tsunagu-radius-sm); background: var(--tsunagu-white); padding: 10px 12px; min-width: 0; }
.tsunagu-fee__day-card.is-monthly { background: var(--tsunagu-bg); margin-bottom: 14px; }
.tsunagu-fee__day-head { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-weight: 700; font-size: 15px; }
.tsunagu-fee__day-total { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tsunagu-fee__day-items { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; gap: 2px; }
.tsunagu-fee__day-items li { display: flex; justify-content: space-between; gap: 12px; }
.tsunagu-fee__day-items li span:first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: var(--tsunagu-text-soft); }
.tsunagu-fee__day-items li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media print { .tsunagu-fee__day-list { grid-template-columns: repeat(2, 1fr); } }

/* ==========================================================================\n   Print isolation for the fee simulator (2026-10-06)\n   Keep the simulator/page heading printable, but exclude site-wide chrome,\n   contact CTA and footer that follow the simulator in the theme template.\n   ========================================================================== */
@media print {
  .tsunagu-header,
  .tsunagu-contact,
  .tsunagu-footer,
  .tsunagu-to-top,
  .tsunagu-menu-toggle,
  #wpadminbar {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
  }

  main {
    padding-top: 0 !important;
  }
}


/* ==========================================================================\n   Desktop Chrome print compaction (v1.0.2 / 2026-10-06)\n   Only enabled when page-fee-simulator.php marks a desktop browser before print.\n   Mobile print remains unchanged.\n   ========================================================================== */
@media print {
  html.tsunagu-fee-print-desktop .tsunagu-pagehead {
    padding: 5mm 0 3mm !important;
  }
  html.tsunagu-fee-print-desktop .tsunagu-pagehead__title {
    margin-top: 2mm !important;
    font-size: 20pt !important;
    line-height: 1.25 !important;
  }
  html.tsunagu-fee-print-desktop .tsunagu-pagehead__lead {
    margin-top: 2mm !important;
    font-size: 10pt !important;
    line-height: 1.4 !important;
  }
  html.tsunagu-fee-print-desktop .tsunagu-section--sub {
    padding-block: 5mm !important;
  }
  html.tsunagu-fee-print-desktop .tsunagu-sub-body {
    margin-top: 0 !important;
    margin-bottom: 4mm !important;
    padding: 4mm 5mm !important;
  }
  html.tsunagu-fee-print-desktop .tsunagu-sub-body .tsunagu-list {
    margin-block: 0 !important;
    font-size: 9pt !important;
    line-height: 1.45 !important;
  }
  html.tsunagu-fee-print-desktop .tsunagu-fee__notes {
    margin-bottom: 0 !important;
    padding-top: 2mm !important;
    padding-bottom: 2mm !important;
    font-size: 9pt !important;
    line-height: 1.4 !important;
  }
}
