/* Larger on-screen entry and customer-document editing; printed pages use
   their independent template and retain their original paper typography. */
@media screen {
  .document-editor-dialog .field .document-channel-reminder { color:#2563eb; }
}
@media screen and (min-width:761px) {
  .document-editor-dialog,
  .customer-document-dialog,
  body:has(.document-editor-dialog[open]) > .erp-product-picker-dialog {
    --ui-type-scale:1.5;
    font-size:18px;
  }
  dialog.document-editor-dialog,
  body:has(.document-editor-dialog[open]) > dialog.erp-product-picker-dialog { width:min(1360px,96vw); max-width:96vw; }
  dialog.document-preview-dialog { width:min(1360px,96vw); }
  .document-editor-dialog .close-btn,
  .customer-document-dialog .close-btn,
  body:has(.document-editor-dialog[open]) > .erp-product-picker-dialog .erp-product-picker-close { width:44px; min-height:44px; line-height:1; flex-shrink:0; }
  .document-editor-dialog .document-header-fields,
  .document-editor-dialog .document-header-fields.document-has-manual-number {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
  }
  .document-editor-dialog input:not([type=checkbox],[type=radio],[type=hidden],.erp-product-picker-native),
  .document-editor-dialog select:not(.erp-product-picker-native),
  .document-editor-dialog .erp-product-picker-trigger { min-height:46px; }
  /* Native macOS menus can paint a short bezel inside a taller layout box. */
  .document-editor-dialog select:not(.erp-product-picker-native) {
    -webkit-appearance:none;
    appearance:none;
    height:46px;
    line-height:24px;
    padding-right:36px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23697078' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat:no-repeat;
    background-position:right 12px center;
    background-size:14px 14px;
  }
  .document-editor-dialog .line-table .product-cell { min-width:260px; }
  .document-editor-dialog .line-table .unit-cell,
  .document-editor-dialog .line-table .location-cell { min-width:130px; }
  .document-editor-dialog .line-table .quantity-cell { min-width:110px; }
  .document-editor-dialog .line-table .price-cell { min-width:155px; }
  .document-editor-dialog #document-lines .sub-text { font-size:16px; line-height:1.5; white-space:normal; overflow-wrap:anywhere; }
  .document-editor-dialog .field small { font-size:16px; line-height:1.5; }
  .document-editor-dialog .document-form-section > summary { flex-wrap:wrap; }
  .document-editor-dialog .modal-footer { flex-wrap:wrap; }

  dialog.customer-document-dialog { width:min(1440px,96vw); }
  .customer-document-dialog .cd-editor-heading h2 { white-space:normal; }
  .customer-document-dialog .cd-paper,
  .customer-document-dialog .cd-preview { max-width:1240px; }
  .customer-document-dialog .cd-lines { min-width:1000px; }
  .customer-document-dialog .cd-paper { line-height:1.5; }
  .customer-document-dialog .cd-paper input:not([type=checkbox],[type=radio]),
  .customer-document-dialog .cd-paper select { min-height:42px; }
  .customer-document-dialog .cd-totals { --cd-value-width:170px; --cd-currency-width:36px; }
  .customer-document-dialog .cd-paper .cd-totals .cd-money input,
  .customer-document-dialog .cd-paper .cd-totals .cd-tax-mode,
  .customer-document-dialog .cd-paper .cd-totals .cd-payment-timing,
  .customer-document-dialog .cd-totals .cd-money > [data-cd-calculated] { height:42px; min-height:42px; }
  .customer-document-dialog .cd-lines th,
  .customer-document-dialog .cd-lines td { line-height:1.5; }
}
@media screen and (min-width:1051px) {
  .customer-document-dialog .modal-head { grid-template-columns:minmax(280px,310px) minmax(0,1fr) auto; }
}
@media screen and (min-width:761px) and (max-width:1100px) {
  .document-editor-dialog .document-header-fields,
  .document-editor-dialog .document-header-fields.document-has-manual-number { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .document-editor-dialog .invoice-address-grid,
  .document-editor-dialog .sales-pricing-layout,
  .customer-document-dialog .cd-summary { grid-template-columns:minmax(0,1fr); }
}
