/* Extracted final contract layer from styles.css. Keep this file loaded after styles.css and before styles-layout.css. */

/* 2026-06-22 desktop polish: staff account anchor, payment header rhythm, compact record filters. */
.staff-account-id {
  display: inline-block;
  max-width: 22ch;
  overflow: hidden;
  color: #746164;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.staff-user-table tr.is-inactive-staff td {
  background: rgba(245, 231, 235, 0.52);
  color: #746164;
}

.staff-user-card.is-inactive-staff {
  background: rgba(245, 231, 235, 0.72);
  border-style: dashed;
}

.staff-user-meta em.inactive {
  background: #f7e3e8;
  color: var(--danger);
}

.customer-payment-staff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 12px;
  min-width: 0;
}

.customer-payment-staff-grid .field {
  margin: 0;
  min-width: 0;
}

.customer-payment-invoice-reset-row {
  display: grid;
  grid-template-columns: minmax(360px, max-content) minmax(80px, 1fr);
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.customer-payment-invoice-reset-row .customer-payment-reset {
  justify-self: end;
  align-self: end;
}

.record-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 10px;
}

.record-table-toolbar .page-note {
  margin: 0;
}

.record-table-toolbar .record-bulk-toolbar {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
}

@media (min-width: 901px) {
  .customer-payment-details-head {
    grid-template-columns: minmax(160px, 220px) minmax(150px, 180px) minmax(360px, 1fr);
    align-items: end;
  }

  .customer-payment-details-head > .customer-payment-staff-grid {
    align-self: end;
  }

  .record-list-card > .record-filter-bar {
    margin: 4px 0 8px;
  }

  .record-filter-bar {
    grid-template-columns:
      minmax(220px, 1.55fr)
      minmax(176px, .95fr)
      repeat(4, minmax(118px, .7fr))
      minmax(238px, 1fr)
      46px;
    gap: 8px;
    align-items: end;
    padding: 9px 10px;
    border-radius: 16px;
  }

  .record-filter-bar .field > span {
    display: block;
    min-height: 16px;
    overflow: hidden;
    color: #776467;
    font-size: 11px;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .record-filter-bar input,
  .record-filter-bar select,
  .record-filter-bar .range-trigger,
  .record-filter-reset {
    min-height: 40px;
    border-radius: 13px;
    font-size: 13px;
  }

  .record-filter-branch {
    grid-template-columns: minmax(0, 1fr) minmax(62px, auto);
    gap: 6px;
  }

  .record-branch-staff-scope {
    min-width: 62px;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 11px;
  }
}

@media (max-width: 900px) {
  .customer-payment-invoice-reset-row {
    grid-template-columns: 1fr;
  }

  .customer-payment-invoice-reset-row .customer-payment-reset {
    justify-self: stretch;
    width: 100%;
    min-height: 42px;
    border-radius: 14px;
  }

  .record-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .record-table-toolbar .record-bulk-toolbar {
    width: 100%;
    margin: 0;
  }
}

/* Ordering supplier field: company-name display was removed, so the K-code input owns the freed space. */
.kcode-combo {
  position: relative;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  width: 100%;
}

.kcode-combo input#salesOrderKNumber {
  width: 100%;
  min-width: 0;
  padding-inline: 14px;
  text-align: left;
}

.kcode-combo b {
  display: none !important;
}

@media (min-width: 761px) {
  .kcode-combo .ordering-supplier-choose,
  .kcode-combo .ordering-supplier-hidden-select {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .kcode-combo {
    grid-template-columns: 40px minmax(0, 1fr) 40px !important;
    min-height: 48px;
  }

  .kcode-combo span,
  .kcode-combo input,
  .kcode-combo .ordering-supplier-choose {
    min-height: 48px;
  }

  .kcode-combo input#salesOrderKNumber {
    padding-inline: 10px;
    text-align: left;
  }

  .kcode-combo .ordering-supplier-choose {
    display: grid !important;
    place-items: center;
    border: 0;
    border-left: 1px solid #eadbdd;
    background: #fff8fb;
    color: var(--brand);
    font-size: 19px;
    font-weight: 950;
    padding: 0;
  }

  .kcode-combo .ordering-supplier-hidden-select {
    display: block !important;
    position: absolute !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto !important;
    width: 40px;
    height: 100%;
    min-height: 48px;
    border: 0;
    opacity: 0.01;
    pointer-events: auto;
  }
}

body.mobile-preview-mode .kcode-combo {
  grid-template-columns: 40px minmax(0, 1fr) 40px !important;
}

body.mobile-preview-mode .kcode-combo input#salesOrderKNumber {
  padding-inline: 10px;
  text-align: left;
}

body.mobile-preview-mode .kcode-combo .ordering-supplier-choose {
  display: grid !important;
  place-items: center;
  border-left: 1px solid #eadbdd;
  background: #fff8fb;
}

body.mobile-preview-mode .kcode-combo .ordering-supplier-hidden-select {
  display: block !important;
  position: absolute !important;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto !important;
  width: 40px;
  height: 100%;
  min-height: 48px;
  opacity: 0.01;
  pointer-events: auto;
}

/* Final shared filter / date-range contract.
   Keep this at the end of the main stylesheet so older module rules cannot clip
   dropdowns or stretch date pickers back into oversized fields. */
.cs-document-database-card,
.record-list-card,
.deleted-records-card,
.task-section,
.audit-log-card,
.ops-toolbar,
.cs-filter-bar,
.record-filter-bar,
.task-filters,
.audit-filter-bar {
  overflow: visible !important;
}

.cs-filter-bar,
.record-filter-bar,
.task-filters,
.audit-filter-bar {
  position: relative !important;
  z-index: 70 !important;
}

body:not(.mobile-preview-mode) .cs-filter-bar,
body:not(.mobile-preview-mode) .record-filter-bar,
body:not(.mobile-preview-mode) .task-filters,
body:not(.mobile-preview-mode) .audit-filter-bar {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.05fr) repeat(4, minmax(150px, .85fr)) !important;
  grid-auto-flow: row !important;
  grid-auto-rows: minmax(42px, auto) !important;
  gap: 8px 10px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
}

body:not(.mobile-preview-mode) .cs-filter-bar > input,
body:not(.mobile-preview-mode) .record-filter-search,
body:not(.mobile-preview-mode) .task-filters > input,
body:not(.mobile-preview-mode) .audit-filter-bar .field:first-child {
  grid-column: 1 !important;
  grid-row: span 2 !important;
  min-width: 0 !important;
  min-height: 100% !important;
}

body:not(.mobile-preview-mode) .cs-filter-bar > input,
body:not(.mobile-preview-mode) .record-filter-search input,
body:not(.mobile-preview-mode) .task-filters > input,
body:not(.mobile-preview-mode) .audit-filter-bar .field:first-child input {
  min-height: 100% !important;
}

body:not(.mobile-preview-mode) .cs-filter-bar .date-range-control,
body:not(.mobile-preview-mode) .record-filter-bar .date-range-control,
body:not(.mobile-preview-mode) .task-filters .date-range-control,
body:not(.mobile-preview-mode) .audit-filter-bar .date-range-control {
  grid-column: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 220px !important;
  justify-self: stretch !important;
}

.date-range-control .range-trigger {
  min-width: 0 !important;
  min-height: 40px !important;
  grid-template-columns: 28px minmax(0, 1fr) 14px !important;
  gap: 7px !important;
  padding: 6px 9px !important;
  border-radius: 14px !important;
}

.date-range-control .calendar-icon {
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  border-radius: 10px !important;
  font-size: 15px !important;
}

.date-range-control .range-picker-label {
  min-width: 0 !important;
  overflow: hidden !important;
  gap: 1px !important;
}

.date-range-control .range-picker-label small {
  font-size: 9px !important;
  line-height: 1 !important;
}

.date-range-control .range-picker-label b {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
}

.cs-multi-filter,
.record-multi-filter,
.task-multi-filter,
.audit-multi-filter {
  position: relative !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.cs-multi-filter[open],
.record-multi-filter[open],
.task-multi-filter[open],
.audit-multi-filter[open] {
  z-index: 4000 !important;
}

.cs-multi-filter > div.cs-multi-panel,
.record-multi-filter > div.record-multi-panel,
.task-multi-filter > div.task-multi-panel,
.audit-multi-filter > div.audit-multi-panel,
body.mobile-preview-mode .cs-multi-filter > div.cs-multi-panel,
body.mobile-preview-mode .record-multi-filter > div.record-multi-panel,
body.mobile-preview-mode .task-multi-filter > div.task-multi-panel,
body.mobile-preview-mode .audit-multi-filter > div.audit-multi-panel {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  right: auto !important;
  z-index: 4000 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px 8px !important;
  width: min(340px, calc(100vw - 28px)) !important;
  min-width: min(260px, calc(100vw - 28px)) !important;
  max-width: min(340px, calc(100vw - 28px)) !important;
  max-height: min(360px, calc(100vh - 150px)) !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
}

.cs-multi-filter[data-cs-multi="createdBy"] > div.cs-multi-panel,
.cs-multi-filter[data-cs-multi="issuedBy"] > div.cs-multi-panel,
.cs-multi-filter[data-cs-multi="approvedBy"] > div.cs-multi-panel,
.record-multi-filter[data-record-multi="createdBy"] > div.record-multi-panel,
.record-multi-filter[data-record-multi="issuedBy"] > div.record-multi-panel,
.record-multi-filter[data-record-multi="approvedBy"] > div.record-multi-panel,
.record-multi-filter[data-record-multi="paymentStyle"] > div.record-multi-panel,
.task-multi-filter[data-task-multi="createdBy"] > div.task-multi-panel,
.task-multi-filter[data-task-multi="issuedBy"] > div.task-multi-panel,
.task-multi-filter[data-task-multi="approvedBy"] > div.task-multi-panel,
.task-multi-filter[data-task-multi="status"] > div.task-multi-panel,
.audit-multi-filter[data-audit-multi="action"] > div.audit-multi-panel,
.audit-multi-filter[data-audit-multi="actor"] > div.audit-multi-panel,
.audit-multi-filter[data-audit-multi="targetType"] > div.audit-multi-panel {
  left: auto !important;
  right: 0 !important;
}

.cs-multi-filter > div.cs-multi-panel label,
.record-multi-filter > div.record-multi-panel label,
.task-multi-filter > div.task-multi-panel label,
.audit-multi-filter > div.audit-multi-panel label {
  min-width: 0 !important;
  white-space: normal !important;
}

.cs-multi-filter > div.cs-multi-panel label span,
.record-multi-filter > div.record-multi-panel label span,
.task-multi-filter > div.task-multi-panel label span,
.audit-multi-filter > div.audit-multi-panel label span {
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
  line-height: 1.2 !important;
}

body:not(.mobile-preview-mode) .record-filter-reset,
body:not(.mobile-preview-mode) .audit-clear-filter,
body:not(.mobile-preview-mode) #csResetWindow {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 120px !important;
  justify-self: stretch !important;
}

@media (max-width: 1180px) {
  body:not(.mobile-preview-mode) .cs-filter-bar,
  body:not(.mobile-preview-mode) .record-filter-bar,
  body:not(.mobile-preview-mode) .task-filters,
  body:not(.mobile-preview-mode) .audit-filter-bar {
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(145px, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .cs-filter-bar,
  .record-filter-bar,
  .task-filters,
  .audit-filter-bar,
  body.mobile-preview-mode .cs-filter-bar,
  body.mobile-preview-mode .record-filter-bar,
  body.mobile-preview-mode .task-filters,
  body.mobile-preview-mode .audit-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .cs-filter-bar > input,
  .record-filter-search,
  .task-filters > input,
  .audit-filter-bar .field:first-child,
  body.mobile-preview-mode .cs-filter-bar > input,
  body.mobile-preview-mode .record-filter-search,
  body.mobile-preview-mode .task-filters > input,
  body.mobile-preview-mode .audit-filter-bar .field:first-child {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    min-height: 46px !important;
  }

  .cs-multi-filter > div.cs-multi-panel,
  .record-multi-filter > div.record-multi-panel,
  .task-multi-filter > div.task-multi-panel,
  .audit-multi-filter > div.audit-multi-panel,
  body.mobile-preview-mode .cs-multi-filter > div.cs-multi-panel,
  body.mobile-preview-mode .record-multi-filter > div.record-multi-panel,
  body.mobile-preview-mode .task-multi-filter > div.task-multi-panel,
  body.mobile-preview-mode .audit-multi-filter > div.audit-multi-panel {
    width: min(320px, calc(100vw - 24px)) !important;
    min-width: min(250px, calc(100vw - 24px)) !important;
  }
}

/* Final mobile safety zone: fixed bottom navigation must not cover task/record content. */
body.mobile-layout-mode,
body.mobile-preview-mode {
  overflow: hidden !important;
}

body.mobile-layout-mode .main,
body.mobile-preview-mode .main {
  box-sizing: border-box !important;
  height: calc(100dvh - 104px - env(safe-area-inset-bottom)) !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch !important;
  padding-bottom: calc(22px + env(safe-area-inset-bottom)) !important;
  scroll-padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important;
}

@supports (height: 100svh) {
  body.mobile-layout-mode .main,
  body.mobile-preview-mode .main {
    height: calc(100svh - 104px - env(safe-area-inset-bottom)) !important;
  }
}

body.mobile-layout-mode .task-card,
body.mobile-preview-mode .task-card,
body.mobile-layout-mode .details-row,
body.mobile-preview-mode .details-row {
  scroll-margin-bottom: calc(138px + env(safe-area-inset-bottom)) !important;
}

body.mobile-layout-mode .task-section:last-child,
body.mobile-preview-mode .task-section:last-child,
body.mobile-layout-mode .deleted-records-card,
body.mobile-preview-mode .deleted-records-card {
  margin-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
}

body.mobile-layout-mode .details-row .detail-panel,
body.mobile-preview-mode .details-row .detail-panel,
body.mobile-layout-mode .deleted-records-card .detail-panel,
body.mobile-preview-mode .deleted-records-card .detail-panel {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

body.mobile-layout-mode .details-row td,
body.mobile-preview-mode .details-row td {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

body.mobile-layout-mode .details-row .record-detail-list,
body.mobile-preview-mode .details-row .record-detail-list,
body.mobile-layout-mode .details-row .record-detail-text,
body.mobile-preview-mode .details-row .record-detail-text,
body.mobile-layout-mode .details-row .full-record,
body.mobile-preview-mode .details-row .full-record {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

body.mobile-layout-mode .details-row .detail-item,
body.mobile-preview-mode .details-row .detail-item,
body.mobile-layout-mode .task-summary-list div,
body.mobile-preview-mode .task-summary-list div {
  grid-template-columns: minmax(92px, 34%) minmax(0, 1fr) !important;
  gap: 8px !important;
  font-size: 13px !important;
}

body.mobile-layout-mode .details-row .detail-item dd,
body.mobile-preview-mode .details-row .detail-item dd,
body.mobile-layout-mode .task-summary-list dd,
body.mobile-preview-mode .task-summary-list dd {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

@media (max-width: 760px) {
  body.has-app {
    overflow: hidden !important;
  }

  body.has-app .main {
    box-sizing: border-box !important;
    height: calc(100dvh - 104px - env(safe-area-inset-bottom)) !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: calc(22px + env(safe-area-inset-bottom)) !important;
    scroll-padding-top: calc(92px + env(safe-area-inset-top)) !important;
    scroll-padding-bottom: calc(140px + env(safe-area-inset-bottom)) !important;
  }

  @supports (height: 100svh) {
    body.has-app .main {
      height: calc(100svh - 104px - env(safe-area-inset-bottom)) !important;
    }
  }

  body.has-app .task-card,
  body.has-app .details-row {
    scroll-margin-top: calc(92px + env(safe-area-inset-top)) !important;
    scroll-margin-bottom: calc(138px + env(safe-area-inset-bottom)) !important;
  }

  body.has-app .task-section:last-child,
  body.has-app .deleted-records-card {
    margin-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
  }

  body.has-app .details-row .detail-panel,
  body.has-app .deleted-records-card .detail-panel {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body.has-app .details-row td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body.has-app .details-row .record-detail-list,
  body.has-app .details-row .record-detail-text,
  body.has-app .details-row .full-record {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body.has-app .details-row .detail-item,
  body.has-app .task-summary-list div {
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr) !important;
    gap: 8px !important;
    font-size: 13px !important;
  }

  body.has-app .details-row .detail-item dd,
  body.has-app .task-summary-list dd {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
}

/* Final Customer Payment edit layout contract.
   Keep desktop edit rows inside the modal instead of relying on fixed-width
   columns that can exceed the modal and crush amount digits. */
.modal-card #editRecordForm [data-edit-customer-payment-row].customer-payment-row-card {
  grid-template-columns: 82px repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  max-width: 100% !important;
  overflow: visible !important;
}

.modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-row-card-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-amount-field,
.modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-amount-field .amount-number-control,
.modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-amount-field .amount-digit-wrap,
.modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-amount-field .amount-digit-row {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-amount-field .amount-digit-row {
  grid-template-columns: repeat(5, minmax(14px, 1fr)) 5px repeat(2, minmax(14px, .86fr)) !important;
  gap: 2px !important;
  overflow: visible !important;
}

.modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-amount-field .amount-lock-window .amount-digit,
.modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-amount-field .amount-lock-window .amount-cent-digit {
  font-size: clamp(12px, 1.2vw, 17px) !important;
  min-width: 0 !important;
}

@media (max-width: 980px) {
  .modal-card #editRecordForm [data-edit-customer-payment-row].customer-payment-row-card {
    grid-template-columns: 76px repeat(2, minmax(0, 1fr)) !important;
  }

  .modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-deposit-field,
  .modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-full-field,
  .modal-card #editRecordForm [data-edit-customer-payment-row] .customer-payment-row-card-fields {
    grid-column: 2 / -1 !important;
  }
}

/* Final Store Item / Preview Guideline contract.
   Store Database and Ordering share the same Store Item editor; desktop stays
   four-column, while locked system fields use the same quiet color treatment. */
.preview-guideline-settings {
  gap: 14px;
}

.preview-guideline-split {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.preview-phone-panel,
.branch-location-admin-panel {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d9ece8;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(245, 252, 250, .92), rgba(247, 250, 255, .86));
}

.preview-phone-panel p,
.branch-location-admin-panel p {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.preview-phone-panel .btn {
  justify-self: start;
}

.preview-guideline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.preview-guideline-grid > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #d9ece8;
  border-radius: 14px;
  background: rgba(244, 251, 250, .82);
}

.preview-guideline-grid dt {
  color: var(--brand);
  font-size: 11px;
  font-weight: 950;
  text-transform: none;
}

.preview-guideline-grid dd {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.preview-phone-panel .card-head.compact,
.branch-location-admin-panel .card-head.compact {
  margin: 0;
}

.preview-phone-panel .card-head.compact h3,
.branch-location-admin-panel .card-head.compact h3 {
  margin: 2px 0 0;
  font-size: 20px;
}

.branch-location-form {
  display: grid;
  grid-template-columns: minmax(96px, 132px) minmax(300px, 1fr);
  gap: 10px;
  align-items: end;
}

.branch-location-form .field {
  margin: 0;
  min-width: 0;
}

.branch-location-address-field textarea {
  min-height: 78px;
  resize: vertical;
}

.branch-location-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.branch-location-list {
  display: grid;
  gap: 7px;
}

.branch-location-list > div:not(.empty) {
  display: grid;
  grid-template-columns: minmax(80px, 120px) minmax(0, 1fr) minmax(110px, auto);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid #e5efec;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
}

.branch-location-list b,
.branch-location-list span,
.branch-location-list small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.branch-location-list b {
  color: var(--brand);
  font-weight: 950;
}

.branch-location-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.store-db-manual-entry .store-db-manual-grid,
.store-db-edit-modal .store-db-manual-grid,
.shared-store-item-modal .store-db-manual-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: start;
}

.store-db-stock-locked,
.store-db-stock-locked[readonly],
.store-db-stock-locked[disabled],
.store-db-stock-locked[aria-readonly="true"],
.store-db-manual-grid :is(input, select, textarea).readonly-field,
.store-db-manual-grid :is(input, select, textarea).locked-field {
  border-color: #b9d8d2 !important;
  background: linear-gradient(145deg, rgba(229, 242, 239, .96), rgba(238, 247, 245, .9)) !important;
  color: #42675f !important;
  cursor: not-allowed !important;
}

select[data-store-db-branch-select] {
  background: #fff !important;
  cursor: pointer;
}

.store-db-branch-location {
  min-height: 74px !important;
  resize: none !important;
}

.customer-payment-extra-row.customer-payment-row-card {
  grid-template-columns: 86px minmax(170px, .82fr) minmax(170px, .82fr) minmax(0, 1fr) minmax(0, 1fr) !important;
}

.customer-payment-extra-row .customer-payment-amount-field,
.customer-payment-extra-row .customer-payment-amount-field .amount-number-control,
.customer-payment-extra-row .customer-payment-amount-field .amount-digit-wrap,
.customer-payment-extra-row .customer-payment-amount-field .amount-digit-row {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.customer-payment-extra-row .customer-payment-amount-field .amount-digit-row {
  grid-template-columns: repeat(5, minmax(12px, 1fr)) 5px repeat(2, minmax(12px, .86fr)) !important;
  gap: 2px !important;
  overflow: hidden !important;
}

.customer-payment-extra-row .customer-payment-amount-field .amount-lock-window,
.customer-payment-extra-row .customer-payment-amount-field .amount-lock-window .amount-digit,
.customer-payment-extra-row .customer-payment-amount-field .amount-lock-window .amount-cent-digit {
  min-width: 0 !important;
  width: 100% !important;
}

.customer-payment-extra-row .customer-payment-amount-field .amount-lock-window .amount-digit,
.customer-payment-extra-row .customer-payment-amount-field .amount-lock-window .amount-cent-digit {
  font-size: clamp(12px, 1.05vw, 16px) !important;
}

.amount-number-control > .amount-number-hidden,
.invoice-number-control > .invoice-number-hidden,
.modal-card .amount-number-control > .amount-number-hidden,
.modal-card .invoice-number-control > .invoice-number-hidden,
.customer-payment-row-card .amount-number-control > .amount-number-hidden,
#editRecordForm [data-edit-customer-payment-row] .amount-number-control > .amount-number-hidden {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  width: 1px !important;
  min-width: 0 !important;
  max-width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  max-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
}

@media (max-width: 760px) {
  .store-db-batch-photo-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-db-batch-photo-controls [data-store-db-batch-submit] {
    grid-column: 1 / -1;
  }

  .store-db-batch-photo-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .store-db-batch-item,
  .store-db-batch-target,
  .store-db-batch-photo-row small {
    grid-column: 2 / -1;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .preview-guideline-split,
  .preview-guideline-grid {
    grid-template-columns: 1fr;
  }

  .branch-location-form,
  .branch-location-list > div:not(.empty) {
    grid-template-columns: 1fr;
  }

  .branch-location-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .branch-location-list small {
    text-align: left;
  }

  .preview-phone-panel,
  .branch-location-admin-panel {
    padding: 10px;
    gap: 8px;
    overflow: hidden;
  }

  .branch-location-admin-panel .card-head.compact h3,
  .preview-phone-panel h3 {
    font-size: 18px;
    line-height: 1.08;
  }

  .branch-location-address-field textarea {
    min-height: 64px;
  }

  .store-db-manual-entry .store-db-manual-grid,
  .store-db-edit-modal .store-db-manual-grid,
  .shared-store-item-modal .store-db-manual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
