/* 共通「概算見積書 → PDF保存」モーダル */
.ed-estimate-open { overflow: hidden; }
.ed-estimate-backdrop {
  position: fixed; inset: 0; z-index: 10000; overflow-y: auto;
  display: grid; place-items: start center; padding: 4vh 1rem;
  background: rgba(18, 24, 32, .64);
}
.ed-estimate-modal {
  width: min(760px, 100%); background: #fff; color: #1d2430;
  border-radius: 14px; box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
  padding: clamp(1.2rem, 3vw, 2rem); position: relative;
}
.ed-estimate-close {
  position: absolute; top: .7rem; right: .8rem; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: #f2f2f0; color: #333;
  font: 400 1.5rem/1 sans-serif; cursor: pointer;
}
.ed-estimate-modal h2 { margin: 0 3rem 1.2rem 0; font-size: 1.35rem; }
.ed-estimate-lead { margin: -.5rem 0 1.2rem; color: #666; font-size: .86rem; line-height: 1.7; }
.ed-estimate-form { display: grid; gap: .9rem; }
.ed-estimate-field label { display: block; margin-bottom: .3rem; font-size: .8rem; font-weight: 700; color: #555; }
.ed-estimate-field input {
  width: 100%; box-sizing: border-box; padding: .72rem .8rem;
  border: 1px solid #d9d9d5; border-radius: 8px; background: #fff;
  color: #222; font: inherit;
}
.ed-estimate-field input:focus { outline: 2px solid #2d3a4a; outline-offset: 1px; }
.ed-estimate-error { min-height: 1.2em; margin: 0; color: #b42318; font-size: .8rem; }
.ed-estimate-actions { display: flex; justify-content: flex-end; gap: .7rem; flex-wrap: wrap; margin-top: 1rem; }
.ed-estimate-btn {
  border: 1px solid #d7d9dd; border-radius: 8px; padding: .72rem 1.25rem;
  background: #fff; color: #202936; font-family: inherit; font-size: .88rem; font-weight: 700; line-height: 1.2; cursor: pointer;
}
.ed-estimate-btn-primary { background: #2d3a4a; border-color: #2d3a4a; color: #fff; }
.ed-estimate-btn:hover { filter: brightness(.96); }

.ed-estimate-doc { font-size: 13px; line-height: 1.6; }
.ed-estimate-doc-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #2d3a4a; padding-bottom: 1rem; }
.ed-estimate-doc h1 { margin: 0; font-size: 1.65rem; letter-spacing: .12em; }
.ed-estimate-meta { text-align: right; font-size: .78rem; color: #555; }
.ed-estimate-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 1.5rem 0; }
.ed-estimate-party-label { margin: 0 0 .4rem; color: #666; font-size: .75rem; font-weight: 700; }
.ed-estimate-party-name { margin: 0; font-size: 1rem; font-weight: 700; }
.ed-estimate-party-sub { margin: .18rem 0 0; }
.ed-estimate-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.ed-estimate-table th, .ed-estimate-table td { padding: .62rem .7rem; border-bottom: 1px solid #ddd; text-align: left; vertical-align: top; }
.ed-estimate-table th { width: 32%; background: #f5f5f3; font-weight: 700; }
.ed-estimate-total { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0; padding: .9rem 1rem; background: #2d3a4a; color: #fff; font-weight: 700; }
.ed-estimate-total strong { font-size: 1.2rem; }
.ed-estimate-notes { margin: 1.2rem 0 0; padding: 1rem 1rem 1rem 2rem; background: #f7f7f5; color: #555; font-size: .76rem; }
.ed-estimate-print-hint { margin: .8rem 0 0; text-align: right; color: #666; font-size: .75rem; }

@media (max-width: 560px) {
  .ed-estimate-backdrop { padding: 0; place-items: stretch; }
  .ed-estimate-modal { min-height: 100vh; border-radius: 0; }
  .ed-estimate-parties { grid-template-columns: 1fr; gap: 1rem; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body * { visibility: hidden !important; }
  #ed-estimate-wrap, #ed-estimate-wrap * { visibility: visible !important; }
  #ed-estimate-wrap { position: absolute !important; inset: 0 !important; }
  .ed-estimate-backdrop { position: static; display: block; padding: 0; background: #fff; overflow: visible; }
  .ed-estimate-modal { width: 100%; max-width: none; min-height: 0; padding: 0; border-radius: 0; box-shadow: none; }
  .ed-estimate-close, .ed-estimate-actions, .ed-estimate-print-hint { display: none !important; }
  .ed-estimate-doc { font-size: 11pt; }
  .ed-estimate-total { background: #eee !important; color: #111 !important; border: 1px solid #777; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
