.md-cost-box .dce-head { flex-wrap: wrap; }
.md-cost-box .md-cost-list article { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line,#e5e7eb); overflow-wrap: anywhere; }
.md-cost-box .dce-head p { flex-wrap: wrap; }
.md-cost-list .md-note { grid-column: 1 / -1; overflow-wrap: anywhere; color: var(--muted); }
.md-cost-list em { font-style: normal; color: var(--store-theme); }
.md-service-modal .dialog { position: relative; width: min(680px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow: auto; margin: auto; padding: 24px; box-sizing: border-box; }
.md-service-modal { display: flex; align-items: center; justify-content: center; }
.md-person-suggestions { display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.md-person-suggestions button { text-align: left; color: var(--store-theme); }
.md-account-page { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
.md-account-page .srm-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.md-account-page .srm-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.md-account-page .srm-filter > input { width: 220px; }
.md-account-page .srm-filter select { width: auto; min-width: 130px !important; }
.md-account-page .srm-filter input { font-size: inherit; }
.md-account-page .srm-filter label { display: grid; gap: 6px; }
.md-account-page table { width: 1640px !important; min-width: 100%; table-layout: fixed; font-size: inherit; }
.md-account-page th:nth-child(1) { width: 44px !important; }
.md-account-page th:nth-child(2) { width: 110px !important; }
.md-account-page th:nth-child(3) { width: 150px !important; }
.md-account-page th:nth-child(4) { width: 180px !important; }
.md-account-page th:nth-child(5) { width: 105px !important; }
.md-account-page th:nth-child(6) { width: 130px !important; }
.md-account-page th:nth-child(7) { width: 140px !important; }
.md-account-page th:nth-child(8),.md-account-page th:nth-child(9),.md-account-page th:nth-child(10) { width: 110px !important; }
.md-account-page th:nth-child(11) { width: 100px !important; }
.md-account-page th:nth-child(12) { width: 245px !important; }
.md-account-page .srm-badge { white-space: nowrap; }
.md-account-page .srm-table-scroll { overflow-x: auto; }
.md-account-page td { white-space: normal; }
.md-account-page td:last-child { min-width: 230px; }
@media (max-width: 760px) {
  .md-cost-box .md-cost-list article { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .md-service-modal .form-grid { grid-template-columns: 1fr; }
  .md-service-modal .span2 { grid-column: auto; }
}

/* Only the measurement/design account history dialog uses this layout. */
.dialog:has(.md-account-detail) {
  width: min(1280px, calc(100vw - 48px)) !important;
  max-width: 1280px !important;
  height: auto !important;
  max-height: calc(100dvh - 40px) !important;
  padding: 25px !important;
  overflow: auto !important;
}
.md-account-detail .md-history-scroll { overflow-x: auto; }
.md-account-detail .md-history-table {
  width: 100% !important;
  min-width: 1080px !important;
  table-layout: auto !important;
}
.md-history-table .md-history-date { width: 110px !important; }
.md-history-table .md-history-total { width: 140px !important; }
.md-history-table .md-history-allocation { width: 130px !important; }
.md-history-table .md-history-person { width: calc(58% - 382.8px) !important; }
.md-history-table .md-history-operator { width: 110px !important; }
.md-history-table .md-history-note { width: calc(42% - 277.2px) !important; }
.md-history-table .md-history-action { width: 170px !important; }
.md-account-detail .md-history-table th,
.md-account-detail .md-history-table td {
  vertical-align: top;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.6;
}
.md-account-detail .md-history-table th { white-space: nowrap; }
.md-account-detail .md-history-table td:nth-child(1),
.md-account-detail .md-history-table td:nth-child(2),
.md-account-detail .md-history-table td:nth-child(3) { white-space: nowrap; }
.md-account-detail .md-history-table td:nth-child(4) { min-width: 220px; }
.md-account-detail .md-history-table td:nth-child(6) { min-width: 160px; }
.md-history-person-name, .md-history-order { display: block; }
.md-history-order { white-space: nowrap; }
.md-account-detail .md-history-table td:last-child { min-width: 150px; }
.md-account-detail .md-history-table button {
  max-width: 100%;
  white-space: normal;
}

.dialog:has(.md-account-detail) > #modalBody {
  height: auto !important;
  width: auto !important;
  max-width: 100%;
  padding: 0 !important;
  overflow: visible !important;
}
.dialog:has(.md-account-detail) > .close {
  left: auto !important;
  right: 18px !important;
  top: 12px !important;
}
.md-account-detail > h2 { margin-right: 40px; }

.md-account-detail .md-history-table .business-column-resizer { display: none; }
.dialog:has(.md-account-detail) > .modal-table-export { display: none !important; }
