/* R27 見積ページの印刷用CSS（media="print" で読み込む）。
 * デザイン側の document-flow.css の印刷規則は body>main>#document-workspace という並びが前提だったが、SWELL では
 * #body_wrap > .l-content > main > article > .post_content > .led-estimate-r27 > #document-workspace と深い。
 * そこで、帳票（#document-workspace）とその祖先だけを残し、それ以外を display:none にする。祖先の余白・幅も 0 に戻す。
 * R29（2026-09-28）: 「印刷・PDF保存」は新しいタブ（document-flow.js printDocument）で開く。そのタブもこのCSSで印刷する。 */
/* 紙の余白は0にして、余白は紙面（.dw-paper の padding）で持つ。ブラウザがヘッダー・フッター（日付・URL・ページ番号）を付ける設定でも
 * 紙の大きさは変わらず、各紙が297mm未満なのでページは送られない（page.pdf で確認。その文字は紙の上端5mm・下端289mm付近に重なって出る）。 */
@page{size:A4;margin:0}
body *:not(:has(#document-workspace)):not(#document-workspace):not(#document-workspace *){display:none!important}
:has(> #document-workspace),body :has(#document-workspace){display:block!important;margin:0!important;padding:0!important;max-width:none!important;width:auto!important;min-height:0!important;position:static!important;overflow:visible!important;background:#fff!important;box-shadow:none!important;border:0!important}
html,body{margin:0!important;padding:0!important;background:#fff!important;overflow:visible!important;height:auto!important;scrollbar-gutter:auto!important}
#document-workspace[hidden]{display:none!important}
#document-workspace{display:block!important;width:210mm!important;max-width:none!important;box-sizing:border-box!important;padding:0!important;margin:0!important}
.led-estimate-r27 .dw-info,.led-estimate-r27 .dw-top,.led-estimate-r27 .dw-progress,.led-estimate-r27 .dw-side,.led-estimate-r27 .dw-next,.led-estimate-r27 .dw-receipt,.led-estimate-r27 .dw-status,.led-estimate-r27 .dw-print-bar{display:none!important}
.led-estimate-r27 .dw-reading{display:block!important}
/* 紙1枚＝A4 1ページ。高さは中身なり（はみ出しても中身を切らない）。 */
.led-estimate-r27 .dw-paper,.led-estimate-r27 .dw-paper:not(.dw-active){display:flex!important;box-shadow:none!important;border:0!important;width:210mm!important;max-width:210mm!important;box-sizing:border-box!important;height:auto!important;min-height:0!important;margin:0!important;padding:12mm 14mm 8mm!important;break-inside:auto;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.led-estimate-r27 .dw-paper,.led-estimate-r27 .dw-paper *{box-sizing:border-box}
/* 条件の各項目が break-before:page を持っていて1項目1ページに割れていた（10ページ）。紙の中では改ページしない */
.led-estimate-r27 .dw-term,.led-estimate-r27 .dw-paper *{break-before:auto!important;page-break-before:auto!important;break-after:auto!important;page-break-after:auto!important}
.led-estimate-r27 .dw-paper{break-after:page!important;page-break-after:always!important}
.led-estimate-r27 .dw-paper:last-child{break-after:auto!important;page-break-after:auto!important}
/* 1枚の中で条件・表・段落を割らない（4枚→9ページに割れていた） */
.led-estimate-r27 .dw-term,.led-estimate-r27 .dw-facts>div,.led-estimate-r27 .dw-table tr,.led-estimate-r27 .dw-total,.led-estimate-r27 .dw-doc-note{break-inside:avoid;page-break-inside:avoid}
.led-estimate-r27 .dw-paper *{box-shadow:none!important}

/* R29: 上の色の帯。背景の塗り（グラフィック）は「背景のグラフィック」を切ると消えるので、印刷では罫線（border）で描く。
 * 紙の端ぎりぎりはプリンターが刷れないことが多いので、紙面の余白の内側（上から6mm）に置く。水色75%・紺25%はデザインの帯と同じ。 */
.led-estimate-r27 .dw-paper::before{top:6mm!important;left:14mm!important;right:14mm!important;bottom:auto!important;height:0!important;background:none!important;border-top:1.2mm solid #00a0b6!important}
.led-estimate-r27 .dw-paper::after{content:'';position:absolute;top:6mm;right:14mm;width:45.5mm;height:0;border-top:1.2mm solid #0b2b45}

/* R29: 文字の3段階（大20pt・中11pt・小9pt）。以前の 6〜7.5pt の注記・条件は小（9pt）にした。 */
#led-estimate-r27 .dw-paper{--dw-l:20pt;--dw-m:11pt;--dw-s:9pt;line-height:1.6}

/* 見出し（左＝題と番号・日付、右＝発行者／ロゴ） */
#led-estimate-r27 .dw-doc-head{padding-bottom:3mm!important;margin-bottom:3.5mm!important;gap:3mm 9mm!important}
#led-estimate-r27 .dw-doc-kind h2{line-height:1.25!important;letter-spacing:.06em}
#led-estimate-r27 .dw-ref-list{margin-top:2mm!important}
#led-estimate-r27 .dw-ref-note{margin-top:1.5mm!important;line-height:1.55!important}
#led-estimate-r27 .dw-issuer{width:80mm!important}
#led-estimate-r27 .dw-issuer>p{line-height:1.5!important}
#led-estimate-r27 .dw-issuer-logo{width:40mm!important;margin-bottom:1.5mm!important}
#led-estimate-r27 .dw-doc-brand img{width:34mm!important}
/* 1枚目 */
#led-estimate-r27 .dw-parties{gap:9mm!important;line-height:1.5;margin-bottom:3.5mm!important}
#led-estimate-r27 .dw-customer-name{padding-bottom:3px!important;margin-bottom:4px!important}
#led-estimate-r27 .dw-project{padding-bottom:6px!important}
#led-estimate-r27 .dw-project>strong{line-height:1.45}
#led-estimate-r27 .dw-total{padding:2.5mm 4mm!important;margin-bottom:2.5mm!important}
#led-estimate-r27 .dw-total-amount{line-height:1.35}
#led-estimate-r27 .dw-price-path{padding-top:4px!important}
#led-estimate-r27 .dw-pay-note{margin-top:4px!important;line-height:1.55!important}
#led-estimate-r27 .dw-flag{margin-bottom:2mm!important;padding:1px 6px!important}
#led-estimate-r27 .dw-facts>div{padding:3px 0!important}
#led-estimate-r27 .dw-section-title{margin:3mm 0 1.5mm!important;padding-bottom:4px!important;line-height:1.45}
#led-estimate-r27 .dw-config svg{max-height:30mm}
#led-estimate-r27 .dw-config p{line-height:1.5!important}
#led-estimate-r27 .dw-doc-note{padding:7px 11px!important;line-height:1.6!important;margin-top:3mm!important}
#led-estimate-r27 .dw-doc-foot{padding-top:3mm!important}
/* 2枚目（詳細内訳） */
#led-estimate-r27 .dw-table{margin:2.5mm 0!important}
#led-estimate-r27 .dw-table th,#led-estimate-r27 .dw-table td{padding:5px 6px!important;line-height:1.5}
#led-estimate-r27 .dw-table td span{margin-top:1px!important}
#led-estimate-r27 .dw-totals{margin-top:3mm!important}
#led-estimate-r27 .dw-totals>div{padding:3px 0!important}
#led-estimate-r27 .dw-totals .dw-final{padding:6px 0!important}
#led-estimate-r27 .dw-item-note{margin-top:2mm!important;line-height:1.55!important}
#led-estimate-r27 .dw-bank{padding:10px 12px!important;margin-top:12px!important}
/* 3枚目（ご利用条件）：幅いっぱいに組む（右側の空きは段落の最大幅が原因＝estimate-base.css） */
#led-estimate-r27 .dw-terms{display:block!important;margin-top:3mm!important}
#led-estimate-r27 .dw-term{margin-bottom:3mm!important;gap:8px!important}
#led-estimate-r27 .dw-term h3{margin-bottom:1mm!important;line-height:1.45}
#led-estimate-r27 .dw-term p{line-height:1.65!important}
#led-estimate-r27 .dw-doc-caption{margin-top:3mm!important;line-height:1.55!important}
