/* One authoritative desktop column map. Mobile layouts remain in mobile.css. */
@media (min-width: 901px) {
  html:not(.phone-desktop-layout) #ordersPage > .sheet-wrap {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    scrollbar-width: auto;
    touch-action: pan-x pan-y pinch-zoom;
  }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet {
    width: 100% !important;
    min-width: 1990px !important;
    max-width: none !important;
    table-layout: fixed !important;
  }
  /* Widths total 1990px. Exclude the after-sales colspan cell. */
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(1) { --order-column-width: 52px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(2) { --order-column-width: 72px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(3) { --order-column-width: 96px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(4) { --order-column-width: 102px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(5) { --order-column-width: 88px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(6) { --order-column-width: 148px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(7) { --order-column-width: 96px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(8) { --order-column-width: 68px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(9) { --order-column-width: 156px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(10) { --order-column-width: 52px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(11) { --order-column-width: 240px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(12) { --order-column-width: 160px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(13) { --order-column-width: 76px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(14) { --order-column-width: 132px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(15) { --order-column-width: 118px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(16) { --order-column-width: 64px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(17) { --order-column-width: 64px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(18) { --order-column-width: 58px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(19) { --order-column-width: 72px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(20) { --order-column-width: 76px; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :is(th, td) {
    box-sizing: border-box !important;
    width: var(--order-column-width) !important;
    min-width: var(--order-column-width) !important;
    max-width: none !important;
    padding-inline: 6px !important;
  }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(.inline-input, .inline-select, .shop-cell-editor) {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet input[type="date"] { padding-inline: 2px !important; }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet input[type="number"] {
    padding-inline: 5px !important;
    font-variant-numeric: tabular-nums;
  }
  /* Keep monetary values close to their cell edges without shrinking digits. */
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is(thead tr, tbody tr:not(.after-sales-row)) > :nth-child(n+16) {
    padding-inline: 4px !important;
  }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet input[type="number"]:is([data-field="salePrice"], [data-field="purchasePrice"], [data-field="freight"]) {
    padding-inline: 3px !important;
  }
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet :is([data-output="totalCost"], [data-output="profit"]) { white-space: nowrap !important; }
  /* Only compact selectors: reserve one arrow, not native + padded arrows. */
  html:not(.phone-desktop-layout) #ordersPage .orders-sheet .inline-select:is([data-field="source"], [data-field="status"], [data-field="shop"]) {
    appearance: none !important;
    -webkit-appearance: none !important;
    padding-left: 3px !important;
    padding-right: 16px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4 3 3 3-3' fill='none' stroke='%23536178' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 3px center !important;
    background-size: 10px 10px !important;
  }
}
