:root{--ink:#1e3c49;--deep:#304854;--yellow:#ffbe19;--line:#d5dee3;--muted:#667984;--bg:#f4f7f8;--white:#fff;--danger:#a32929;--shadow:0 8px 30px rgba(27,59,70,.07)}
*{box-sizing:border-box}html{font-family:Arial,"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;color:var(--ink);background:var(--bg)}body{margin:0;font-size:15px;line-height:1.5}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.48}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #92c5d4;outline-offset:2px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.app-header{background:#fff;border-bottom:4px solid var(--deep);box-shadow:0 2px 12px #203b4a12}.header-inner{max-width:1320px;margin:auto;padding:12px 24px;display:flex;align-items:center;justify-content:space-between;gap:24px}.brand{display:flex;align-items:center;gap:16px}.brand img{width:144px;height:78px;object-fit:contain}.brand div{display:grid;gap:2px}.brand strong{font-size:23px;letter-spacing:.06em}.brand span{font-size:12px;color:var(--muted)}.header-right{display:flex;align-items:center;gap:24px}.people{display:flex;gap:14px}.person{display:grid;justify-items:center;gap:2px;font-size:11px;color:var(--muted)}.person b{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#edf1f3;color:var(--ink);font-size:20px}.person.active b{border:3px solid var(--yellow);background:#fff}.person.disabled{opacity:.6}.icon-button,.secondary,.quiet,.primary{border-radius:8px;padding:9px 15px;font-weight:700;white-space:nowrap}.icon-button,.secondary{background:#fff;border:1px solid #456575;color:var(--ink)}.icon-button:hover,.secondary:hover{background:#edf5f7}.quiet{border:1px solid transparent;background:transparent;color:var(--ink)}.quiet:hover{background:#f0f4f6}.primary{background:var(--deep);color:#fff;border:1px solid var(--deep);box-shadow:inset 0 -2px #1d333d}.primary:hover{background:#1f3c49}
.workspace{max-width:1150px;margin:24px auto 64px;padding:0 20px;display:grid;gap:14px}.notice{background:#fff9e7;border:1px solid #f3d873;border-left:5px solid var(--yellow);padding:10px 16px;border-radius:8px;display:flex;gap:12px;align-items:center;font-size:13px}.notice strong{white-space:nowrap}.message{border-radius:8px;padding:11px 15px;font-weight:700;background:#e9f4ee;color:#205039}.message.error{background:#fff0ef;color:var(--danger)}.panel{background:#fff;border:1px solid #e1e8eb;border-radius:12px;padding:20px;box-shadow:var(--shadow)}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.section-head>div:first-child{display:flex;align-items:center;gap:12px}.section-no{display:grid;place-items:center;min-width:42px;height:42px;border:1px solid #ccd7dd;border-radius:8px;color:var(--deep);font-size:17px}h2{font-size:24px;line-height:1.25;margin:0;letter-spacing:.03em}.section-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}label{display:grid;gap:6px;font-weight:700}label em{font-size:12px;color:var(--danger);font-style:normal}input:not([type=file]):not([type=checkbox]),textarea,select{width:100%;border:1px solid #bfcdd4;border-radius:7px;background:#fff;color:var(--ink);padding:10px 12px;min-height:43px}textarea{resize:vertical;min-height:105px}.hint{margin-top:11px;color:var(--muted);font-size:13px}.owner-pill{display:flex;align-items:center;gap:8px;margin-top:14px;padding:10px 14px;border-radius:8px;background:#fff8e2;font-size:14px}.owner-pill span{margin-left:auto;color:var(--muted);font-size:12px}.subtle,.fineprint{margin:0 0 13px;color:var(--muted);font-size:13px}.fineprint{margin:10px 0 0}.segmented{display:flex;border:1px solid var(--deep);border-radius:8px;overflow:hidden}.segmented button{border:0;background:#fff;color:var(--ink);padding:9px 15px;font-weight:700}.segmented button+button{border-left:1px solid var(--deep)}.segmented button.selected{background:var(--deep);color:#fff}.table-scroll{overflow:auto}.editor-table,.records-table{width:100%;border-collapse:collapse;table-layout:fixed}.editor-table th,.records-table th{background:#e9eef1;color:var(--ink);font-size:13px;text-align:left;padding:10px;border:1px solid var(--line)}.editor-table td,.records-table td{padding:7px;border:1px solid var(--line);vertical-align:top}.editor-table th:first-child{width:46px}.editor-table th:nth-child(2){width:40%}.editor-table th:nth-child(3),.editor-table th:nth-child(4){width:16%}.editor-table th:nth-child(5){width:12%}.editor-table th:nth-child(6){width:17%}.editor-table th:last-child{width:43px}.editor-table input:not([type=checkbox]),.editor-table textarea{padding:7px 8px;min-height:36px;font-weight:400}.editor-table textarea{height:42px;min-height:42px}.editor-table .line-name{font-weight:700}.line-meta{display:flex;align-items:center;gap:8px;margin-top:5px;color:var(--muted);font-size:11px}.line-meta label{display:flex;align-items:center;gap:5px}.line-total{text-align:right;font-variant-numeric:tabular-nums;font-weight:700;white-space:nowrap;padding-top:14px!important}.delete-line{border:0;background:transparent;color:var(--danger);font-size:20px;padding:2px 7px}.negotiated-only{display:none}.negotiated-mode .negotiated-only{display:table-cell}.negotiated-mode .editor-table th:nth-child(2){width:31%}.calc-bar{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:13px 6px;border-bottom:1px solid var(--line);font-size:13px}.calc-bar>div{display:flex;gap:24px;flex-wrap:wrap}.calc-bar strong{font-size:17px;margin-left:8px}.calc-total strong{color:#143f50;font-size:23px}.invalid{color:var(--danger)}.block-label{display:grid}.status-badge{padding:5px 12px;border-radius:50px;background:#fff4ce;color:#665018;font-size:12px;font-weight:700}.paper-wrap{background:#e9eff2;padding:20px;overflow:auto;border-radius:9px}.paper{background:#fff;color:#182c37;width:210mm;min-height:297mm;margin:auto;box-shadow:0 4px 18px #12303c2b;padding:15mm 13mm 14mm;font-size:11pt;line-height:1.45}.paper-top-rule{height:4px;background:linear-gradient(to right,#1f4c5d 0 84%,var(--yellow) 84% 100%);margin-bottom:13px}.paper-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.paper-head img{width:165px;height:80px;object-fit:contain;object-position:left center}.company-details{text-align:right;font-size:9.5pt}.company-details strong{font-size:10.5pt}.paper-title{text-align:center;font-size:25pt;letter-spacing:.15em;color:#1b4b5c;margin:12px 0 19px;line-height:1.2}.paper-columns{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin-bottom:18px}.paper-info{border-left:1px solid var(--line);padding-left:16px;min-width:0}.paper-info:first-child{border-left:0;padding-left:0}.paper-info h3,.paper-notes h3,.signature-box h3{font-size:12pt;margin:0 0 7px;border-left:5px solid var(--yellow);padding-left:10px;color:#1c4555}.paper-info p{margin:2px 0;overflow-wrap:anywhere}.paper-info .head-value{font-weight:700}.paper-table{width:100%;border-collapse:collapse;table-layout:fixed}.paper-table th{background:#1d5263;color:#fff;font-size:9pt;text-align:center;padding:7px 5px;border:1px solid #73919e}.paper-table td{border:1px solid #aab9c1;padding:7px 7px;vertical-align:top;overflow-wrap:anywhere}.paper-table th:first-child{width:8%}.paper-table th:nth-child(2){width:39%}.paper-table th:last-child{width:17%}.paper-table .money{text-align:right;white-space:nowrap}.paper-table .num{text-align:center}.paper-table .deal-cell{background:#fff4bc}.paper-table .group-note{font-size:8pt;color:#456270;margin-top:3px}.paper-table .group-details{white-space:pre-wrap;font-size:8.5pt;margin-top:4px}.paper-table tfoot td{text-align:right}.paper-table tfoot .grand td{background:#fff0ae;font-weight:700;font-size:12pt;color:#183f4d}.paper-notes{border:1px solid #365f6e;margin-top:20px;min-height:108px;padding:12px 14px}.paper-notes p{white-space:pre-wrap;margin:0 0 3px;overflow-wrap:anywhere}.paper-signatures{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}.signature-box{border:1px solid #a9bdc6;min-height:88px;padding:10px}.paper-footer{display:flex;justify-content:space-between;margin-top:15px;border-top:3px solid #2b5967;padding-top:5px;font-size:8.5pt}.paper-footer .page-number::after{content:"第 " counter(page) " 頁"}.paper-draft{color:var(--danger);font-size:8pt;text-align:right;margin:0 0 5px}.save-panel{border-left:5px solid var(--yellow)}.save-status{color:var(--muted);font-size:13px;font-weight:700}.save-actions{display:flex;gap:10px;flex-wrap:wrap}.records-table th:nth-child(1){width:23%}.records-table th:nth-child(2){width:24%}.records-table th:last-child{width:18%}.records-table td{font-size:13px}.records-table .money{text-align:right}.record-actions{display:flex;gap:4px;white-space:nowrap}.record-actions button{border:0;background:none;color:#116084;text-decoration:underline;padding:1px 3px}.empty-row{text-align:center;color:var(--muted);padding:25px!important}
dialog{border:1px solid #a9bac2;border-radius:13px;box-shadow:0 15px 60px #142c3e50;max-width:min(92vw,600px);width:100%;max-height:90vh;overflow:auto;padding:0}dialog::backdrop{background:#102d3a94}.dialog-form{padding:25px;display:grid;gap:12px}.dialog-form h2{font-size:23px}.dialog-form p{margin:0;color:var(--muted);font-size:13px}.dialog-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.dialog-form hr{border:0;border-top:1px solid var(--line);width:100%;margin:3px 0}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:8px}.import-dialog{min-width:600px}.import-preview{max-height:330px;overflow:auto;border:1px solid var(--line);padding:10px;border-radius:6px}.import-preview table{border-collapse:collapse;width:100%;font-size:12px}.import-preview td,.import-preview th{border:1px solid var(--line);padding:5px}.warning{background:#fff3dc;border-left:4px solid var(--yellow);padding:9px 12px;font-size:12px}.import-options{display:grid;gap:12px}.import-options label{font-size:13px}
@media(max-width:850px){.header-inner{flex-wrap:wrap}.header-right{width:100%;justify-content:space-between}.workspace{padding:0 10px}.panel{padding:15px}.section-head{align-items:flex-start;flex-wrap:wrap}.field-grid{grid-template-columns:1fr}.editor-table{min-width:740px}.records-table{min-width:760px}.paper-wrap{padding:10px}.paper{transform-origin:top left;zoom:.75}.calc-bar{display:block}.calc-bar>div{margin-top:8px}.owner-pill{display:block}.owner-pill span{display:block;margin-left:0}}
@media(max-width:550px){.brand img{width:100px;height:54px}.brand strong{font-size:19px}.people{gap:8px}.person b{width:34px;height:34px;font-size:16px}.icon-button{font-size:12px}.section-head h2{font-size:21px}.section-actions{width:100%}.notice{align-items:flex-start;display:block}.notice span{display:block}.paper{zoom:.52}.dialog-grid{grid-template-columns:1fr}.import-dialog{min-width:0}}
@page{size:A4;margin:10mm 9mm 13mm;@bottom-right{content:"第 " counter(page) " 頁";font-size:9pt;color:#304854}}
@media print{html,body{background:#fff;margin:0;padding:0}.app-header,dialog,.workspace>:not(.preview-panel),.preview-panel>.section-head{display:none!important}.workspace{display:block!important;margin:0!important;padding:0!important;max-width:none!important}.preview-panel{display:block!important;padding:0!important;border:0!important;box-shadow:none!important}.paper-wrap{display:block!important;background:#fff!important;padding:0!important;overflow:visible!important}#quote-paper{display:block!important;box-shadow:none!important;width:auto!important;min-height:0!important;margin:0!important;padding:0!important;font-size:10pt;zoom:1!important}.paper-top-rule{margin-top:0}.paper-title{margin:8px 0 15px}.paper-table thead{display:table-header-group}.paper-table tfoot{display:table-row-group}.paper-table tr,.paper-info,.paper-signatures,.paper-notes{break-inside:avoid;page-break-inside:avoid}.paper-signatures{margin-top:12px}.paper-footer .page-number{display:none}}

input[type=checkbox]{width:16px;height:16px;min-height:0;accent-color:var(--deep)}

/* Keep the three business identities beside the brand at tablet widths. */
.header-inner{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px}
.workspace{grid-template-columns:minmax(0,1fr)}.panel{min-width:0}
.brand{min-width:0}.header-right{width:auto}.people{gap:10px}
.notes-list{display:grid;gap:8px}.note-row{display:grid;grid-template-columns:26px minmax(0,1fr) 32px;align-items:center;gap:8px}.note-number{text-align:center;color:var(--muted);font-weight:700}.note-row input{min-height:43px}.note-row button{border:0;background:transparent;color:var(--danger);font-size:22px;line-height:1}
.paper-meta{display:flex;justify-content:flex-end;gap:18px;font-size:8.5pt;font-weight:700;color:#234b5c;margin-bottom:4px}
.paper-top-rule{margin-bottom:8px}.paper-head{gap:12px}.paper-head img{width:120px;height:57px}.company-details{font-size:8.5pt;line-height:1.25}.company-details strong{font-size:9.5pt}.paper-title{font-size:23pt;margin:7px 0 10px}
.paper-client{margin-bottom:12px}.paper-client h3,.paper-notes h3,.paper-confirm h3{font-size:11pt;margin:0 0 5px;border-left:5px solid var(--yellow);padding-left:9px;color:#1c4555}.paper-client-grid{display:grid;grid-template-columns:1fr 1fr;column-gap:16px;row-gap:2px}.paper-client-grid p{margin:0;font-size:9.5pt;overflow-wrap:anywhere}.paper-client-grid strong{font-weight:700}
.paper-bottom-row{display:grid;grid-template-columns:1.1fr .9fr;gap:10px;margin-top:15px}.paper-notes{margin:0;min-height:95px;padding:9px 10px}.paper-notes p{font-size:9.5pt;margin:2px 0}.paper-stamp{border:1px solid #a9bdc6;min-height:95px}.paper-confirm{border:1px solid #a9bdc6;width:44%;min-height:62px;margin:10px 0 0 auto;padding:9px}.paper-footer{margin-top:10px}
@media(max-width:850px){.header-inner{display:grid;grid-template-columns:minmax(0,1fr) auto;flex-wrap:nowrap}.header-right{width:auto}.brand img{width:110px;height:62px}}
@media(max-width:550px){.header-inner{padding:10px 12px;gap:6px}.brand{gap:6px}.brand img{width:70px;height:48px}.brand strong{font-size:16px}.brand span,.person small{display:none}.people{gap:5px}.person b{width:30px;height:30px;font-size:15px}}
.customer-head{flex-wrap:nowrap}.customer-head .section-actions{width:auto;margin-left:auto;flex-wrap:nowrap}.customer-head #new-customer{white-space:nowrap}
.legacy-import{margin-top:12px;color:var(--muted);font-size:12px}.legacy-import summary{cursor:pointer}.legacy-import button{margin-top:9px}
.line-group-toggle{display:flex;align-items:center;gap:5px;margin-top:5px;color:var(--muted);font-size:11px;font-weight:400}.line-group-toggle input{flex:none}
.company-details{font-size:7.7pt;line-height:1.18}.company-details strong{font-size:10pt;line-height:1.3}
.paper-contact-columns{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:13px}.paper-contact-col{min-width:0}.paper-contact-col+.paper-contact-col{border-left:1px solid var(--line);padding-left:16px}.paper-contact-col h3{font-size:11pt;margin:0 0 5px;border-left:5px solid var(--yellow);padding-left:9px;color:#1c4555}.paper-contact-col p{margin:2px 0;font-size:9.5pt;overflow-wrap:anywhere}
.paper-bottom-row{align-items:stretch}.paper-right{display:grid;grid-template-rows:95px 62px;gap:10px}.paper-notes{min-height:0;height:100%}.paper-stamp{min-height:0}.paper-confirm{width:auto;min-height:0;margin:0}
@media(max-width:550px){.customer-head{align-items:center}.customer-head .section-actions{width:auto}.customer-head #new-customer{font-size:13px;padding:8px 10px}.paper{zoom:.4}}
@media(max-width:380px){.paper{zoom:.34}}
@media print{.paper-bottom-row,.paper-right,.paper-contact-columns{break-inside:avoid;page-break-inside:avoid}}

/* Keep the confirmation area at the foot of a short A4 quote. */
.paper{display:flex;flex-direction:column}
.paper-bottom-row{margin-top:auto;padding-top:15px}
.save-status.unsaved{color:#b42318}
@media print{#quote-paper{display:flex!important;flex-direction:column!important;min-height:274mm!important}}

/* Review fixes: privacy notice, long values, and safe native printing. */
#print-warning{display:none}.paper-meta{flex-wrap:wrap;overflow-wrap:anywhere}.paper-table .money{white-space:normal;overflow-wrap:anywhere}.records-table td{overflow-wrap:anywhere}.import-dialog{min-width:0;width:100%}.dialog-form label{min-width:0}
@media print{body.print-blocked .workspace{display:none!important}body.print-blocked #print-warning{display:block!important;color:#a32929;font-size:14pt}.paper-contact-columns,.paper-bottom-row,.paper-right{break-inside:auto;page-break-inside:auto}.paper-notes{height:auto;break-inside:auto;page-break-inside:auto}.paper-notes p{break-inside:avoid}#quote-paper{display:block!important;min-height:0!important}.paper-bottom-row{margin-top:15px;display:block}.paper-right{margin-top:10px;grid-template-columns:1fr 1fr;grid-template-rows:72px}.paper-meta{font-size:8pt}}

/* Quotation layout v2: restrained brand color, clear hierarchy, real flowing A4. */
.service-editor{margin-top:9px;font-size:12px}.service-editor summary{cursor:pointer;color:#365967;font-weight:700}.service-editor>p{font-size:11px;color:var(--muted);margin:8px 0}.service-editor label{font-weight:600;margin-top:9px}.editor-table .service-editor textarea{min-height:76px;height:76px;font-size:12px;line-height:1.5}
#quote-paper{display:block;padding:15mm 14mm 13mm;font-family:Arial,"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;font-size:10pt;line-height:1.55;color:#223944;font-variant-numeric:tabular-nums}
.quote-masthead{display:flex;justify-content:space-between;gap:9mm;padding-bottom:7mm;border-bottom:3px solid #294b59}.quote-brand{max-width:117mm}.quote-brand img{width:35mm;height:17mm;object-fit:contain;object-position:left center;display:block;margin-bottom:4mm}.quote-brand>strong{font-size:11pt;letter-spacing:.03em}.quote-brand p{margin:2mm 0 0;font-size:8.5pt;color:#51626b;line-height:1.65}.quote-heading{text-align:right;flex:none;padding-top:1mm}.quote-eyebrow{font-size:8pt;font-weight:700;letter-spacing:.21em;color:#657a83;margin:0 0 3mm}.quote-heading h1{font-size:24pt;line-height:1.25;letter-spacing:.04em;margin:0 0 3mm;color:#294b59}.quote-heading>span{font-size:8pt;color:#657a83}
.quote-reference{display:flex;justify-content:space-between;gap:5mm;margin:5mm 0 7mm;padding-bottom:4mm;border-bottom:1px solid #d1dade;font-size:9pt}.quote-reference>div{display:flex;flex-wrap:wrap;gap:1mm 3mm;align-items:baseline}.quote-reference span{color:#657a83;font-size:8pt}.quote-reference strong{font-size:9pt;overflow-wrap:anywhere}.quote-reference small{font-size:8pt;color:#657a83}
.quote-parties{display:grid;grid-template-columns:1.2fr 1fr;gap:9mm;margin-bottom:9mm}.quote-parties>div{min-width:0}.quote-parties h2,.quote-notes h2,.quote-signoff h2{font-size:8.5pt;letter-spacing:.08em;color:#657a83;font-weight:700;margin:0 0 2.5mm}.client-name{font-size:12pt;line-height:1.4;display:block;overflow-wrap:anywhere}.quote-parties dl{margin:2.5mm 0 0;font-size:9pt}.quote-field{display:grid;grid-template-columns:15mm minmax(0,1fr);gap:2mm;margin:1mm 0}.quote-field dt{color:#657a83}.quote-field dd{margin:0;overflow-wrap:anywhere}
.quote-section-title{display:flex;align-items:baseline;justify-content:space-between;gap:5mm;margin-bottom:3mm;break-after:avoid}.quote-section-title h2{font-size:13pt;margin:0;color:#294b59}.quote-section-title>span{font-size:8pt;color:#657a83}.quote-items{width:100%;border-collapse:collapse;table-layout:fixed;border-bottom:1.5px solid #294b59}.quote-items .col-index{width:7%}.quote-items .col-description{width:45%}.quote-items .col-price{width:17%}.quote-items .col-quantity{width:10%}.quote-items .col-amount{width:21%}.quote-items.is-negotiated .col-description{width:33%}.quote-items.is-negotiated .col-price{width:15%}.quote-items.is-negotiated .col-quantity{width:9%}.quote-items.is-negotiated .col-amount{width:21%}.quote-items th{background:#e9eff2;color:#294b59;padding:3.1mm 2mm;border-top:1.5px solid #294b59;border-bottom:1px solid #b9c8cf;font-size:9pt;text-align:right;font-weight:700}.quote-items th:first-child,.quote-items .item-index,.quote-items .quantity{text-align:center}.quote-items th:nth-child(2){text-align:left}.quote-items td{padding:4mm 2mm;border-bottom:1px solid #dce3e6;vertical-align:top;font-size:9.5pt;overflow-wrap:anywhere}.quote-items tbody tr:nth-child(even){background:#f7f9fa}.quote-items .money{text-align:right}.quote-items .item-index{font-size:8.5pt;color:#657a83}.item-name{display:block;font-size:10pt;font-weight:700;line-height:1.5}.item-locations{font-size:8.5pt;line-height:1.5;color:#526875;margin-top:2mm}.item-locations>span{font-size:8pt;display:block;font-weight:700;margin-bottom:1mm}.item-locations p{margin:0 0 1mm}.item-amount{font-weight:700}.original-price{color:#657a83}.quote-items .deal-cell{font-weight:600}.empty-items{text-align:center;color:#657a83}
.quote-summary{display:flex;justify-content:flex-end;margin:4mm 0 7mm;break-inside:avoid}.quote-summary dl{width:85mm;max-width:100%;margin:0}.quote-summary dl>div{display:flex;justify-content:space-between;align-items:baseline;gap:4mm;padding:1.5mm 3mm;font-size:9.5pt}.quote-summary dt{color:#657a83}.quote-summary dd{margin:0;text-align:right;overflow-wrap:anywhere}.quote-summary .quote-grand{border-top:2px solid #294b59;border-bottom:1px solid #b7c5cb;background:#f0f4f5;margin-top:2.5mm;padding:3mm}.quote-grand dt{color:#294b59;font-size:12pt;font-weight:700;flex:none}.quote-grand dt span{font-size:8pt;font-weight:400;display:block}.quote-grand dd{font-weight:700;font-size:22pt;letter-spacing:-.04em;line-height:1.3;color:#294b59}.quote-grand dd small{font-size:10pt;letter-spacing:0}
.quote-notes{border-top:1px solid #c5d1d7;padding-top:4mm;margin-top:5mm;display:block}.quote-notes p{font-size:9pt;line-height:1.65;margin:0 0 1.5mm;overflow-wrap:anywhere;white-space:pre-wrap}.quote-signoff{display:grid;grid-template-columns:1fr 1fr;gap:11mm;margin-top:7mm;break-inside:avoid}.quote-signoff>div{min-width:0}.seal-space{height:18mm;border:1px solid #d1dade}.signature-line{height:12mm;border-bottom:1px solid #718a96}.quote-signoff p{font-size:8pt;color:#657a83;margin:2mm 0 0;display:flex;justify-content:space-between}.quote-signoff p span{padding-right:12mm}.quote-footer{display:flex;justify-content:space-between;gap:4mm;font-size:7.5pt;color:#657a83;border-top:1px solid #c5d1d7;margin-top:7mm;padding-top:3mm}
.service-appendix{margin-top:12mm;padding-top:9mm;border-top:3px solid #294b59;break-before:page}.appendix-head{display:flex;align-items:flex-start;justify-content:space-between;gap:6mm;margin-bottom:3mm}.appendix-head h2{font-size:22pt;line-height:1.3;margin:0;color:#294b59}.appendix-meta{text-align:right;font-size:8pt;color:#657a83;max-width:75mm;overflow-wrap:anywhere}.appendix-intro{font-size:9pt;color:#657a83;margin:4mm 0 7mm}.service-card{margin:0 0 8mm}.service-card h3{display:flex;gap:3mm;align-items:baseline;border-bottom:1.5px solid #294b59;padding-bottom:3mm;font-size:14pt;margin:0 0 4mm;break-after:avoid;overflow-wrap:anywhere}.service-card h3 span{font-size:10pt;color:#8a6922;flex:none}.service-block{display:block;margin:0 0 5mm}.service-block h4{font-size:10pt;color:#294b59;margin:0 0 2mm;padding-left:3mm;border-left:3px solid #e4b53f;break-after:avoid}.service-block p{font-size:10pt;line-height:1.7;margin:0 0 2mm;white-space:pre-wrap;overflow-wrap:anywhere}
@page{size:A4;margin:13mm 14mm 14mm;@bottom-right{content:"第 " counter(page) " 頁";font-family:Arial,sans-serif;font-size:8pt;color:#657a83}}
@media print{.preview-panel>.subtle{display:none!important}#quote-paper{display:block!important;width:auto!important;min-height:0!important;padding:0!important;zoom:1!important}.quote-masthead,.quote-reference,.quote-parties,.quote-summary,.quote-signoff{break-inside:avoid;page-break-inside:avoid}.quote-items thead{display:table-header-group}.quote-items tr{break-inside:avoid;page-break-inside:avoid}.quote-items th,.quote-grand,.quote-items tbody tr{-webkit-print-color-adjust:exact;print-color-adjust:exact}.quote-notes p,.service-block p{orphans:3;widows:3}.service-appendix{margin-top:0;padding-top:5mm;break-before:page;page-break-before:always}.service-card h3,.service-block h4{break-after:avoid;page-break-after:avoid}.quote-footer{break-inside:avoid}}
/* Keep ordinary three-line quotes comfortably inside the A4 content area. */
.quote-brand img{height:14mm;margin-bottom:3mm}.quote-masthead{padding-bottom:5mm}.quote-reference{margin:4mm 0 5mm}.quote-parties{margin-bottom:6mm}.quote-items td{padding-top:3mm;padding-bottom:3mm}.quote-summary{margin:3mm 0 5mm}.quote-signoff{margin-top:5mm}.quote-footer{margin-top:5mm}

/* Approved PDF v8 layout integration. The page is still a synthetic local demonstration. */
.quote-meta-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.quote-meta-grid label,.sales-grid label{font-size:13px}.sales-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}.snapshot-details{margin-top:15px;font-size:13px}.snapshot-details summary{cursor:pointer;font-weight:700}.group-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0}.group-toolbar span{font-size:12px;color:var(--muted)}.group-card{border:1px solid #c4d4dc;border-left:4px solid #375a6b;border-radius:8px;padding:14px;margin:12px 0;background:#f6f9fa}.group-card h3{font-size:14px;margin:0 0 10px}.group-card .field-grid{grid-template-columns:1fr 1fr auto;align-items:end}.group-card label{font-size:12px}.grouped-price{font-size:12px;color:var(--muted)}.target-panel{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px;background:#f5f8fa;border-radius:8px;margin-top:16px}.target-panel label{font-size:13px}.target-result{grid-column:1/-1;font-size:14px;font-weight:700}.calculation-status{margin:12px 0 0;font-size:13px;color:#8a4a00}.editor-table .line-select{display:block;margin:6px auto}.field-grid input[readonly]{background:#f1f4f5;color:#617985}
#quote-paper{display:block;width:210mm;min-height:297mm;padding:11mm 14.5mm 13mm;font-family:Arial,"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;font-size:9pt;line-height:1.4;color:#233e4b}
.quote-main{display:flow-root}
.quote-masthead{display:grid;grid-template-columns:minmax(0,1.22fr) minmax(0,1fr);align-items:end;gap:3mm;padding:0 0 3.5mm;border-bottom:1px solid #263c47}
.quote-brand{display:flex;align-items:center;gap:2.5mm;max-width:none;min-width:0}
.quote-brand img{display:block;width:19mm;height:20mm;object-fit:contain;margin:0;flex:none}
.quote-company{min-width:0}.quote-company strong{display:block;font-size:10.4pt;font-weight:700;line-height:1.35;white-space:nowrap;letter-spacing:-.04em}
.quote-company p{margin:1.5mm 0 0;font-size:7.1pt;line-height:1.5;color:#607984;white-space:nowrap}
.quote-heading{padding:0;text-align:right;min-width:0}
.quote-heading h1{font-size:16.5pt;font-weight:700;line-height:1.1;margin:0 0 2.5mm;color:#222;letter-spacing:.02em}
.quote-heading>p{margin:0 0 1.1mm;font-size:7.4pt;color:#607984;overflow-wrap:anywhere}
.quote-dates{display:flex;justify-content:flex-end;gap:2.4mm;flex-wrap:wrap;font-size:7.1pt;color:#607984}
.quote-dates span{white-space:nowrap}
.quote-parties{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:12mm;margin:5mm 0}
.quote-parties h2,.quote-section-title h2,.quote-notes h2{font-size:11.8pt;font-weight:700;line-height:1.35;letter-spacing:0;margin:0 0 1.6mm;color:#233e4b}
.quote-client .client-name{font-size:11.8pt;margin:0 0 1.6mm;color:#222;overflow-wrap:anywhere}
.quote-parties p{font-size:8.1pt;margin:.8mm 0;line-height:1.5;overflow-wrap:anywhere}
.quote-inline-field b{font-weight:400}.quote-inline-field+.quote-inline-field:before{content:" | ";color:#718591}
.quote-sales-body{display:flex;align-items:flex-start;gap:4mm}.quote-sales-body>div:first-child{min-width:0;flex:1}.quote-sales-body p{white-space:normal}
.quote-qr-placeholder{position:relative;flex:none;width:14mm;height:14mm;border:1px solid #274956;margin-top:1mm;background:repeating-linear-gradient(90deg,transparent 0 2mm,#274956 2mm 2.8mm,transparent 2.8mm 4mm),repeating-linear-gradient(0deg,#fff 0 1mm,#274956 1mm 1.6mm,#fff 1.6mm 3mm)}
.quote-qr-placeholder i{position:absolute;width:4mm;height:4mm;border:1mm double #274956;background:white;top:0;left:0}.quote-qr-placeholder i:nth-child(2){left:auto;right:0}.quote-qr-placeholder i:nth-child(3){top:auto;bottom:0}.quote-qr-placeholder span{position:absolute;left:2mm;right:2mm;top:5mm;background:#fff;text-align:center;font-size:6.5pt}
.quote-section-title{margin:0 0 2mm;gap:4mm;align-items:baseline}.quote-section-title h2{margin:0}.quote-section-title>span{font-size:7pt;text-align:right;color:#718591}
.quote-items{border-bottom:1px solid #d1dce2}.quote-items .col-index{width:7%}.quote-items .col-description{width:45%}.quote-items .col-quantity{width:12%}.quote-items .col-price{width:16%}.quote-items .col-amount{width:20%}
.quote-items.is-negotiated .col-index{width:7%}.quote-items.is-negotiated .col-description{width:37%}.quote-items.is-negotiated .col-price{width:13%}.quote-items.is-negotiated .col-quantity{width:10%}.quote-items.is-negotiated .col-amount{width:20%}
.quote-items.is-bundled .col-index{width:7%}.quote-items.is-bundled .col-description{width:47%}.quote-items.is-bundled .col-quantity{width:12%}.quote-items.is-bundled .col-amount{width:34%}
.quote-items th{background:#243f4d;color:#fff;border:0;padding:2.1mm 2mm;font-size:8pt;line-height:1.25;text-align:right}
.quote-items th:first-child,.quote-items th:nth-child(2){text-align:left}.quote-items th:first-child{padding-left:3mm}
.quote-items td{padding:1.5mm 2mm;border-bottom:1px solid #d8e2e7;vertical-align:middle;font-size:8.8pt;line-height:1.35}
.quote-items tbody tr:nth-child(even){background:#f0f5f7}
.quote-items .item-index{font-size:8pt;font-weight:400;color:#6d8793}
.quote-items .item-name{font-size:9pt;line-height:1.35}.quote-items .item-locations{font-size:7.5pt;line-height:1.3;margin:0;color:#718591}.item-locations p{margin:0}.item-locations>span{display:none}
.quote-items .money{font-variant-numeric:tabular-nums;text-align:right;overflow-wrap:anywhere}
.quote-items .deal-cell,.quote-items .original-price{color:#233e4b;font-weight:400;background:transparent}
.quote-items .item-amount{font-weight:700}.quote-items .price-kind{display:block;font-size:6.8pt;color:#718591}
.quote-items .group-total-cell{border-left:1px solid #d8e2e7;background:#fff;vertical-align:middle;text-align:center}.group-total-cell small{display:block;font-size:8pt;color:#718591;margin-bottom:5mm}.group-total-cell strong{font-size:18pt}
.quote-summary{display:grid;grid-template-columns:1.1fr 1fr;gap:12mm;margin:5mm 0;break-inside:avoid}
.quote-summary-left>p{font-size:7.2pt;color:#718591;margin:0 0 1mm}.quote-summary-left dl{width:54mm;max-width:100%;margin:0}.quote-summary-left dl>div{padding:0;margin:1.1mm 0;display:flex;justify-content:space-between;font-size:8.5pt;gap:4mm}.quote-summary-left dt{color:#233e4b}.quote-summary-left dd{margin:0}
.quote-summary>.quote-grand{margin:0;padding:0 0 1mm;border:0;border-bottom:1px solid #b8cbd4;background:none;min-width:0}
.quote-grand>span{font-size:7.8pt;color:#718591;display:block}.quote-grand>strong{display:block;text-align:right;font-size:21pt;font-weight:700;letter-spacing:.02em;line-height:1.4;margin-top:3mm;white-space:nowrap}
.quote-notes{display:flow-root;margin:4mm 0 0;padding:0;border:0}
.quote-notes h2{margin-bottom:2mm}.quote-notes ol{margin:0;padding:0;list-style:none}.quote-notes li{display:grid;grid-template-columns:6mm minmax(0,1fr);gap:2mm;margin:0 0 .5mm;font-size:8pt;line-height:1.55}.quote-notes li>span{font-size:7.5pt;color:#718591}.quote-notes li>p{margin:0;font-size:8pt;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.quote-signoff{display:grid;grid-template-columns:1.1fr 1fr;align-items:end;gap:12mm;margin-top:8mm;break-inside:avoid}
.quote-demo-seal{width:46mm;height:32mm;border:3px double #246187;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.6mm;color:#246187;transform:rotate(-3deg)}
.quote-demo-seal>span{font-size:5.4pt;letter-spacing:.08em}.quote-demo-seal strong{font-size:18pt;line-height:1.1}.quote-demo-seal b{font-size:8pt;line-height:1.25}.quote-demo-seal small{font-size:7pt;letter-spacing:.4em;margin-top:1mm}
.quote-confirm{padding:0 0 1mm}.quote-confirm h2{font-size:7.8pt;color:#718591;margin:0;font-weight:700;letter-spacing:0}.quote-confirm .signature-line{height:12mm;border-bottom:1px solid #8da5b1}.quote-confirm p{display:block;margin:2mm 0 0;font-size:7.5pt;color:#718591}
.quote-footer{display:flex;justify-content:space-between;gap:5mm;border:0;margin-top:6mm;padding:0;font-size:7pt;color:#718591}
.service-appendix{padding-top:6mm;margin-top:12mm}.service-card{break-inside:auto}.service-block p{overflow-wrap:anywhere}
@page{size:A4;margin:11mm 14.5mm 14mm;@bottom-left{content:"範本版本 TPL 1.0（示意）";font-family:Arial,"Noto Sans TC",sans-serif;font-size:7pt;color:#718591}@bottom-right{content:counter(page) "/" counter(pages);font-family:Arial,sans-serif;font-size:7pt;color:#718591}}
@media print{.no-print{display:none!important}.quote-footer{display:none!important}#quote-paper{padding:0!important;font-size:9pt!important}.quote-main{display:flow-root}.quote-masthead,.quote-parties,.quote-summary,.quote-signoff{break-inside:avoid}.quote-items thead{display:table-header-group}.quote-items td[rowspan]{break-inside:avoid}.quote-items tr{break-inside:avoid}.quote-items th,.quote-items tbody tr,.quote-demo-seal{-webkit-print-color-adjust:exact;print-color-adjust:exact}.quote-notes li{break-inside:avoid;page-break-inside:avoid}.quote-qr-placeholder{-webkit-print-color-adjust:exact;print-color-adjust:exact}.service-appendix{page-break-before:always;break-before:page;margin-top:0}.service-card h3,.service-block h4{break-after:avoid}}
@media(max-width:700px){.quote-meta-grid,.sales-grid{grid-template-columns:1fr 1fr}.group-card .field-grid{grid-template-columns:1fr 1fr}.group-card .field-grid button{grid-column:1/-1}.target-panel{grid-template-columns:1fr}}
@media(max-width:420px){.quote-meta-grid,.sales-grid{grid-template-columns:1fr}}

.target-panel[hidden]{display:none!important}

/* Let oversized scope rows and shared-price cells flow across printed pages.
   Keep normal screen layout and the one shared group amount unchanged. */
@media print{.quote-items tbody tr,.quote-items td[rowspan]{break-inside:auto;page-break-inside:auto}}


/* Workbench-only controls. Approved paper and print rules remain unchanged. */
@media screen {
  body{padding-bottom:94px}.workspace{margin-bottom:32px}
  .workbench-totals{display:flex;align-items:center;justify-content:flex-end;gap:24px;flex-wrap:wrap;border-top:1px solid var(--line);padding:15px 4px;margin-top:16px;font-size:13px}.workbench-totals b{margin-left:9px;font-size:18px}.workbench-totals>strong{font-size:15px}.workbench-totals>strong b{font-size:23px}
  .validation-tools{display:flex;align-items:flex-start;gap:10px}.validation-tools p{flex:1;margin-top:0}.validation-tools button{flex:none;font-size:12px;padding:5px 10px}
  .action-dock{position:fixed;z-index:30;bottom:12px;left:50%;transform:translateX(-50%);width:min(calc(100% - 32px),1110px);display:flex;align-items:center;gap:14px;padding:12px 18px;border:1px solid #c1d1d9;background:#fffffff5;box-shadow:0 5px 25px #19384733;border-radius:12px;backdrop-filter:blur(8px)}.action-dock>div{display:flex;align-items:baseline;gap:16px;flex:1;min-width:0}.action-dock strong{font-size:19px}.action-dock span{font-size:12px;color:var(--muted)}
  .records-search{display:flex;gap:20px;align-items:end;margin-bottom:14px}.records-search label{flex:1;font-size:13px}.records-search p{flex:1;margin:0;font-size:12px}
  .reverse-editor{margin-top:12px;padding:10px;border:1px solid #c9d9df;border-radius:6px;background:#f3f8fa;font-size:12px}.reverse-editor summary{font-weight:700;cursor:pointer}.reverse-editor p{font-size:11px;color:#55717d;margin:8px 0}.reverse-editor label{font-size:12px;margin:8px 0}.reverse-editor select{font-size:12px;padding:7px}.reverse-editor button{font-size:12px;padding:7px 10px;width:100%}.reverse-editor .reverse-result{color:#234a5c;line-height:1.65;overflow-wrap:anywhere}
  #intake-dialog{max-width:min(94vw,760px)}.intake-dialog .dialog-actions{flex-wrap:wrap;position:sticky;bottom:0;background:#fff;padding:12px 0;margin-bottom:-25px;border-top:1px solid var(--line);z-index:1}.intake-evidence-editor{margin-top:10px;color:#55717d;font-size:12px}.intake-evidence-editor summary{cursor:pointer}.intake-evidence-editor p{white-space:pre-wrap;overflow-wrap:anywhere}.intake-customer{display:flex;gap:16px;flex-wrap:wrap;padding:12px;background:#eef4f7;border-radius:6px}.intake-warnings{font-size:13px;padding-left:20px;color:#76521d}.intake-lines{margin:0;padding-left:24px}.intake-lines li{border-bottom:1px solid var(--line);padding:10px 0}.intake-lines p{font-size:12px;margin:6px 0}.intake-lines span{font-size:13px}.intake-lines .intake-evidence{color:#6c7f89;font-size:11px}#intake-status{color:#285c70;font-weight:700}
  @media(max-width:700px){body{padding-bottom:130px}.action-dock{gap:8px;padding:10px}.action-dock>div{display:grid;gap:2px}.action-dock strong{font-size:15px}.action-dock button{padding:9px;font-size:12px}.records-search{display:block}.records-search p{margin-top:8px}.workbench-totals{gap:14px}.validation-tools{display:block}.validation-tools button{margin-top:8px}}
}
/* Narrow-screen editing only: keep every price beside its own item. */
@media screen and (max-width:850px) {
  .editor-table{display:block;min-width:0;width:100%;border-collapse:separate;table-layout:auto}
  .editor-table thead{display:none}
  .editor-table tbody{display:grid;gap:14px;width:100%}
  .editor-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;padding:13px;border:1px solid #c3d2d9;border-radius:9px;background:#fff}
  .editor-table tbody td{display:block;border:0;padding:0;min-width:0;overflow-wrap:anywhere}
  .editor-table tbody td:nth-child(1){grid-column:1 / -1;grid-row:1;display:flex;align-items:center;gap:6px;min-height:44px;padding-right:50px;text-align:left;font-weight:700}
  .editor-table tbody td:nth-child(1)::before{content:"工項"}
  .editor-table tbody td:nth-child(1)::after{content:"合併計價";font-size:11px;font-weight:400;color:#55717d}
  .editor-table .line-select{display:inline-block;width:23px;height:23px;margin:0 0 0 7px;flex:none}
  .editor-table tbody td:nth-child(2){grid-column:1 / -1;grid-row:2}
  .editor-table tbody td:nth-child(3){grid-column:1;grid-row:3}
  .editor-table tbody td:nth-child(3)::before{content:"未稅單價"}
  .editor-table tbody td.negotiated-only{display:none}
  .negotiated-mode .editor-table tbody td:nth-child(3)::before{content:"議價前未稅單價"}
  .negotiated-mode .editor-table tbody td.negotiated-only{display:block;grid-column:2;grid-row:3}
  .editor-table tbody td:nth-child(4)::before{content:"議價後未稅單價"}
  .editor-table tbody td:nth-child(5){grid-column:2;grid-row:3}
  .editor-table tbody td:nth-child(5)::before{content:"數量"}
  .editor-table tbody td:nth-child(6){grid-column:1 / -1;grid-row:4;padding-top:9px;border-top:1px solid #e1e9ed;font-size:18px}
  .editor-table tbody td:nth-child(6)::before{content:"項目合計（未稅）"}
  .negotiated-mode .editor-table tbody td:nth-child(5){grid-column:1;grid-row:4}
  .negotiated-mode .editor-table tbody td:nth-child(6){grid-column:2;grid-row:4;border-top:0;padding-top:0}
  .editor-table tbody td:nth-child(n+3):nth-child(-n+6)::before{display:block;margin-bottom:7px;color:#385969;font-size:12px;font-weight:700;text-align:left;line-height:1.4}
  .editor-table tbody td:nth-child(7){grid-column:2;grid-row:1;justify-self:end;align-self:center}
  .editor-table tbody td:nth-child(7) button{min-width:44px;min-height:44px;border:1px solid #eed5d3;border-radius:6px;background:#fff8f7}
  .editor-table input:not([type=checkbox]),.editor-table textarea,.workspace input:not([type=checkbox]),.workspace select,dialog input:not([type=checkbox]),dialog select,dialog textarea{font-size:16px;min-height:44px}
  .editor-table textarea{height:auto;min-height:72px;margin-top:7px;line-height:1.5}
  .editor-table .reverse-editor{margin-top:12px}
  .editor-table .reverse-editor select{font-size:16px}
  .editor-table .reverse-editor button{min-height:44px}
  .editor-table .reverse-editor .reverse-result{font-size:13px}
  .editor-table .grouped-price{display:block;padding:8px 0;font-size:13px;line-height:1.5}
  .group-card h3,.target-result,.calculation-status,.intake-customer{overflow-wrap:anywhere}
  .records-table button{min-height:44px}
  .intake-dialog .dialog-actions button{min-height:44px}
}
@media screen and (max-width:550px) {
  body{padding-bottom:calc(180px + env(safe-area-inset-bottom,0px))}
  .action-dock{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:10px;bottom:max(10px,env(safe-area-inset-bottom,0px))}
  .action-dock>div{grid-column:1 / -1;display:flex;align-items:center;justify-content:space-between;gap:10px}
  .action-dock strong{font-size:16px;overflow-wrap:anywhere;min-width:0}
  .action-dock span{font-size:11px;flex:none;max-width:100px;text-align:right}
  .action-dock button{width:100%;min-height:44px;font-size:13px;padding:8px 10px}
  .action-dock #dock-save{grid-column:2}
  .action-dock #dock-missing[hidden]+#dock-save{grid-column:1 / -1}
  .intake-dialog .dialog-actions{display:grid;grid-template-columns:1fr;width:100%;gap:7px}
  .intake-dialog .dialog-actions button{width:100%;min-height:44px}
  .workbench-totals{display:grid;grid-template-columns:1fr;gap:8px}
  .workbench-totals>span,.workbench-totals>strong{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
  .workbench-totals b{overflow-wrap:anywhere;text-align:right}
}
/* Narrow-screen history keeps customer, amount and actions on one card. */
@media screen and (max-width:850px) {
  .records-table{display:block;min-width:0;width:100%;table-layout:auto;border-collapse:separate}
  .records-table thead{display:none}
  .records-table tbody{display:grid;gap:12px;width:100%}
  .records-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:11px;padding:13px;border:1px solid #c3d2d9;border-radius:9px;background:#fff}
  .records-table tbody td{display:block;min-width:0;border:0;padding:0;text-align:left;overflow-wrap:anywhere;font-size:14px}
  .records-table tbody td::before{display:block;color:#657a83;font-size:11px;font-weight:600;margin-bottom:4px}
  .records-table tbody td:nth-child(1){grid-column:1 / -1;grid-row:1;font-weight:700}
  .records-table tbody td:nth-child(1)::before{content:"報價編號"}
  .records-table tbody td:nth-child(2){grid-column:1 / -1;grid-row:2;font-weight:700}
  .records-table tbody td:nth-child(2)::before{content:"客戶"}
  .records-table tbody td:nth-child(3){grid-column:1;grid-row:3}
  .records-table tbody td:nth-child(3)::before{content:"格式"}
  .records-table tbody td:nth-child(4){grid-column:2;grid-row:3}
  .records-table tbody td:nth-child(4)::before{content:"報價日期"}
  .records-table tbody td:nth-child(5){grid-column:1;grid-row:4;font-size:18px;font-weight:700}
  .records-table tbody td:nth-child(5)::before{content:"含稅金額（元）"}
  .records-table tbody td:nth-child(6){grid-column:2;grid-row:4}
  .records-table tbody td:nth-child(6)::before{content:"版本"}
  .records-table tbody td:nth-child(7){grid-column:1 / -1;grid-row:5;border-top:1px solid #e1e9ed;padding-top:10px}
  .records-table tbody td:nth-child(7)::before{content:none}
  .records-table .record-actions{gap:7px;white-space:normal}
  .records-table .record-actions>span{display:none}
  .records-table .record-actions button{flex:1;min-width:0;min-height:44px;border:1px solid #c3d2d9;border-radius:5px;padding:7px 4px;font-size:12px;text-decoration:none;white-space:normal;background:#f5f9fb}
  .records-table tbody td.empty-row{grid-column:1 / -1;grid-row:auto;padding:10px!important;text-align:center}
  .records-table tbody td.empty-row::before{content:none}
  .intake-lines li{overflow-wrap:anywhere}
}

/* Draft-file preview and retention, screen only. */
@media screen{
 .draft-load-dialog{max-width:700px}.draft-load-dialog p,.draft-load-dialog li{overflow-wrap:anywhere}.draft-load-dialog ol{padding-left:24px}.draft-load-dialog li{margin:12px 0}.draft-load-dialog li p{white-space:pre-wrap;margin:5px 0}.draft-load-dialog input[type=file]{max-width:100%;min-width:0;font-size:16px;min-height:44px}.draft-load-confirm{display:flex;gap:12px;align-items:flex-start;padding:16px 0}.draft-load-confirm input{width:22px;height:22px;flex:0 0 22px}.draft-load-dialog .dialog-actions{flex-wrap:wrap}.draft-load-dialog .dialog-actions button{min-height:44px;flex:1;white-space:normal}.draft-recovery{margin-top:20px;border-top:1px solid #dbe1e8;padding-top:12px}.draft-recovery label{display:block;max-width:100%;margin-bottom:10px}.draft-recovery select{width:100%;min-width:0;min-height:44px}.draft-recovery button{min-height:44px}
}
/* Explicit synthetic backend controls. Never change the frozen print rules. */
@media screen{
 .backend-test{margin-top:24px;border:1px solid #cbd5e1;border-radius:12px;padding:16px;background:#f8fafc}.backend-test p{overflow-wrap:anywhere}.backend-test label{display:block;margin:16px 0 10px}.backend-test input{display:block;width:100%;min-width:0;min-height:44px;font-size:16px;margin-top:6px}.backend-test button{min-height:44px;white-space:normal}.backend-test .save-actions{flex-wrap:wrap}.backend-test h3{margin:0 0 8px}
}
