/* Customer notes and price lookup belong to the editor, never printed documents. */
.customer-quick-actions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.customer-note-button { border:1px solid #e4c56c; border-radius:10px; padding:8px 12px; background:#fff9dd; color:#705214; font:inherit; font-weight:700; cursor:pointer; }
.customer-note-button.has-note { background:#fff0a9; box-shadow:0 2px 8px #b9952820; }
.customer-note-popover { position:fixed; z-index:12000; width:340px; max-width:calc(100vw - 24px); max-height:min(340px,55vh); overflow:auto; padding:16px; border:1px solid #e5ca70; border-radius:14px; background:#fff7cb; color:#594618; box-shadow:0 12px 35px #463a2233; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .18s ease,visibility .18s; }
.customer-note-popover.is-visible { opacity:1; visibility:visible; pointer-events:auto; }
.customer-note-popover p { margin:8px 0 12px; white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.65; }
.customer-note-popover strong { display:block; padding-top:2px; line-height:1.6; }
.customer-note-popover button { border:0; background:transparent; color:#785510; font:inherit; text-decoration:underline; cursor:pointer; padding:4px 0; }
.customer-note-field { padding:12px; border-radius:12px; background:#fff8d5; }
.customer-note-field small { line-height:1.6; color:#765f20; }
.customer-tool-dialog { border:1px solid #cbdde5; border-radius:18px; padding:22px; width:min(1000px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); overflow:auto; color:#193e50; background:#fff; box-shadow:0 20px 70px #0b25384d; }
.customer-tool-dialog::backdrop { background:#102f4b70; }
.customer-tool-dialog h3 { margin:0; line-height:1.6; }
.customer-tool-dialog .modal-close { display:grid; place-items:center; flex:0 0 34px; width:34px; height:34px; padding:0; color:#294c5d; background:#eef3f5; border:1px solid #cddce3; border-radius:50%; font:24px/1 Arial,sans-serif; cursor:pointer; }
.customer-tool-dialog .tool-head { display:flex; align-items:start; justify-content:space-between; gap:12px; margin-bottom:16px; }
.customer-tool-dialog .tool-help { font-size:12px; line-height:1.7; color:#536c79; }
.customer-tool-dialog .tool-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }
#customerNoteDialog { width:min(540px,calc(100vw - 28px)); background:#fff9de; }
#customerNoteText { width:100%; min-height:170px; line-height:1.7; }
.customer-price-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.customer-price-filters .wide { grid-column:1 / -1; }
.customer-price-table-wrap { margin-top:12px; overflow:auto; max-height:48vh; border:1px solid #dae5eb; border-radius:10px; }
.customer-price-table { width:100%; border-collapse:collapse; min-width:740px; font-size:13px; }
.customer-price-table th { position:sticky; top:0; background:#eaf3f8; z-index:1; text-align:left; white-space:nowrap; }
.customer-price-table td,.customer-price-table th { padding:10px 12px; border-bottom:1px solid #e4ebef; vertical-align:top; line-height:1.6; }
.customer-price-table td small { display:block; color:#607684; }
.customer-price-table .money { text-align:right; white-space:nowrap; }
.customer-price-table .description { min-width:180px; white-space:pre-wrap; overflow-wrap:anywhere; }
#customerPriceSummary { margin:14px 0 6px; font-size:13px; line-height:1.7; }
#customerPriceMore { display:block; margin:12px auto 0; }
#customerPriceMore[hidden] { display:none; }
/* Thai combining marks need a full line box. Avoid line-clamp clipping stacked vowels/tones. */
#documentPage .customer-print-fields > div.cust-line,
#costSummaryPage .customer-print-fields > div.cust-line { line-height:1.55; align-items:start; }
.document-page .customer-print-fields > .cust-line span { overflow:visible; padding-block:.35mm; }
.document-page .customer-print-fields > .cust-line strong { padding-block:.35mm; line-height:1.55; }
.document-page .customer-print-fields > .cust-wrap span,
#costSummaryPage .customer-print-fields > .cust-line span { display:block; -webkit-line-clamp:unset; white-space:pre-wrap; overflow-wrap:anywhere; }
.document-page .customer-print-fields { overflow:visible; }
@media(max-width:560px) {
  .customer-tool-dialog { padding:16px; }
  .customer-price-filters { grid-template-columns:minmax(0,1fr); }
}
@media(prefers-reduced-motion:reduce) { .customer-note-popover { transition:none; } }
@media print { .customer-tool-dialog,.customer-note-popover,.customer-quick-actions { display:none!important; } }
