/* 料金シミュレーター（estimate.html・js/estimate.js） */
.est-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.est-main { min-width: 0; }
.est-step { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 18px; font-weight: 700; color: var(--brown); }
.est-step:not(:first-child) { margin-top: 32px; }
.est-step-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sky-deep); color: var(--white); font-family: var(--f-en); font-size: 15px; }
.est-step-s { font-size: 13px; font-weight: 500; color: var(--ink-soft); }

/* メニューのタイル */
.est-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.est-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px 14px; border-radius: 18px; background: var(--white); border: 1.5px solid var(--line-soft); box-shadow: var(--sh-card); text-align: center; font: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s, transform .2s var(--ease-pop); }
.est-tile:hover:not(:disabled) { transform: translateY(-2px); }
.est-tile.is-on { border-color: var(--sky-deep); box-shadow: 0 0 0 3px var(--sky-pale), var(--sh-card); background: var(--sky-mist); }
.est-tile:disabled { opacity: .5; }
.est-tile-pic .est-pic { width: 38px; height: 38px; color: var(--sky-deep); }
.est-tile-t { font-size: 13.5px; font-weight: 700; line-height: 1.45; word-break: auto-phrase; }
.est-tile-p { font-size: 13px; font-weight: 700; color: var(--sky-deep); }
.est-tile-chk { position: absolute; right: 10px; top: 10px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--sky-soft); background: var(--white); }
.est-tile.is-on .est-tile-chk { border-color: var(--sky-deep); background: var(--sky-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }

/* 選んだメニューごとの欄 */
.est-opts { display: flex; flex-direction: column; gap: 14px; }
.est-opt { padding: 16px 18px; border-radius: 18px; background: var(--white); border: 1.5px solid var(--line-soft); box-shadow: var(--sh-card); }
.est-opt-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 2px dotted var(--sky-soft); }
.est-opt-pic .est-pic { width: 28px; height: 28px; color: var(--sky-deep); display: block; }
.est-opt-t { font-weight: 700; color: var(--brown); }
.est-rm { margin-left: auto; padding: 2px 12px; border-radius: 999px; border: 1.5px solid var(--line-soft); background: var(--white); font: inherit; font-size: 12px; color: var(--ink-soft); }
.est-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dotted var(--line-soft); font-size: 14px; }
.est-row:last-child { border-bottom: 0; }
.est-row-l { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.est-row > .est-stepper, .est-row > em { margin-left: auto; }
.est-row em, .est-choice em { font-style: normal; font-weight: 700; color: var(--sky-deep); white-space: nowrap; }
.est-row.is-minus em { color: #d0832a; }
.est-check { cursor: inherit; }
.est-check input, .est-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--sky-deep); flex: none; }
.est-mini-pic .est-pic { width: 20px; height: 20px; color: var(--sky-deep); display: block; }
.est-row-sw { align-items: flex-start; }
.est-row-sw > .est-row-l { padding-top: 6px; flex: none; }
.est-choices { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.est-choice { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; border: 1.5px solid var(--line-soft); }
.est-choice em { margin-left: auto; }
.est-choice:has(input:checked) { border-color: var(--sky-deep); background: var(--sky-mist); }
.est-stepper { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.est-step-btn { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--sky-deep); background: var(--white); color: var(--sky-deep); font: inherit; font-size: 17px; font-weight: 700; line-height: 1; }
.est-step-btn:disabled { opacity: .35; }
.est-n { min-width: 1.6em; text-align: center; font-size: 16px; }

/* 用途 */
.est-use { display: flex; flex-direction: column; gap: 8px; }
.est-radio { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--white); border: 1.5px solid var(--line-soft); font-size: 14px; }
.est-radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--sky-deep); }
.est-radio:has(input:checked) { border-color: var(--sky-deep); background: var(--sky-mist); }
.est-warn { margin: 4px 0 0; padding: 12px 14px 12px 40px; position: relative; border-radius: 14px; background: var(--egg-soft); color: #8a6a10; font-size: 13.5px; line-height: 1.8; }
.est-warn::before { content: '!'; position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #f0c44c; color: var(--white); font-weight: 700; font-size: 13px; }

/* 内訳と合計（パソコンは右についてくる） */
.est-sum { position: sticky; top: calc(var(--hd-h, 64px) + 16px); padding: 20px; border-radius: 22px; background: var(--white); border: 1.5px solid var(--line-soft); box-shadow: var(--sh-card); scroll-margin-top: calc(var(--hd-h, 64px) + 16px); }
.est-sum-h { margin: 0 0 10px; font-family: var(--f-en); font-size: 15px; font-weight: 600; letter-spacing: .14em; color: var(--sky-deep); }
.est-lines { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.est-empty { margin: 0; padding: 12px 0; color: var(--ink-soft); font-size: 13px; }
.est-line { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.est-line span { min-width: 0; color: var(--ink-soft); }
.est-line.is-main span { color: var(--ink); font-weight: 700; }
.est-line b { white-space: nowrap; font-weight: 500; }
.est-line.is-minus b { color: #d0832a; }
.est-deal { display: flex; justify-content: space-between; gap: 10px; margin: 6px 0; padding: 8px 10px; border-radius: 12px; background: var(--egg-soft); color: #9a7a12; font-size: 12.5px; font-weight: 700; }
.est-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 2px dotted var(--sky-soft); font-weight: 700; }
.est-total b { font-size: 24px; color: var(--brown); white-space: nowrap; }
.est-small { margin: 8px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--ink-soft); }
.est-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.est-btns .btn { width: 100%; justify-content: center; }
.est-btns .btn:disabled, .est-btns .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.est-bar { display: none; }
.est-toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translateX(-50%); padding: 10px 20px; border-radius: 999px; background: var(--brown); color: var(--white); font-size: 14px; font-weight: 700; box-shadow: 0 10px 24px -12px rgba(74, 68, 61, .6); transition: opacity .4s; }
.est-toast.is-out { opacity: 0; }

@media (max-width: 1023px) {
  .est-wrap { grid-template-columns: minmax(0, 1fr); }
  .est-sum { position: static; }
  .est-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .est-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .est-opt { padding: 14px; }
  .est-row { flex-wrap: wrap; }
  /* 画面の下に合計の帯（内訳が見えている間は隠す） */
  .est-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px; background: var(--brown); color: var(--white); text-decoration: none; font-size: 13px; box-shadow: 0 12px 28px -12px rgba(74, 68, 61, .6); }
  .est-bar[hidden], .est-sum-in .est-bar { display: none; }
  .est-bar b { font-size: 18px; }
  .est-bar-go { margin-left: auto; padding: 4px 12px; border-radius: 999px; background: var(--white); color: var(--brown); font-weight: 700; font-size: 12px; }
  #est-on { padding-bottom: 96px; }
}

/* 見積書（印刷・PDF 保存のときだけ） */
.est-sheet { display: none; }
@media print {
  @page { size: A4; margin: 16mm; }
  body > *:not(main), main > *:not(.est-sheet), .skip-link { display: none !important; }
  html, body { background: #fff !important; }
  .est-sheet { display: block; color: #4a443d; font-size: 11pt; }
  .es-head { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 2px solid #a2d8f2; }
  .es-logo { width: 48px; height: 48px; }
  .es-title { margin: 0; font-size: 20pt; font-weight: 700; letter-spacing: .3em; }
  .es-meta { margin: 2px 0 0; font-size: 9.5pt; color: #7a7268; }
  .es-table { width: 100%; margin-top: 18px; border-collapse: collapse; }
  .es-table td { padding: 7px 4px; border-bottom: 1px solid #d9eef8; }
  .es-table td:last-child { text-align: right; white-space: nowrap; }
  .es-table .is-deal td { color: #9a7a12; }
  .es-table .is-sub td { color: #7a7268; }
  .es-table .is-total td { font-weight: 700; font-size: 13pt; background: #f5fbfe; border-bottom: 2px solid #a2d8f2; }
  .es-notes { margin: 16px 0 0; padding-left: 1.2em; font-size: 9pt; color: #7a7268; line-height: 1.7; }
  .es-foot { margin: 18px 0 0; font-size: 9pt; color: #7a7268; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
