/* Physical phones/tablets only. Desktop sizing, permission visibility and
   native document events remain owned by their existing components. */
@media screen {
/* A wide iPad also scrolls rows, totals and checkout in the same page flow. */
html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]:has([data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])) {
  height: auto;
  min-height: 100dvh;
  max-height: none;
  overflow: visible;
}

html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]:has([data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])) .my-slider-workspace {
  height: auto;
  min-height: 0;
  max-height: none;
  grid-template-rows: max-content max-content;
  align-content: start;
  overflow: visible;
}

html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]:has([data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])) :is(.my-slider-content, .my-slider-screen) {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]
  [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"]),
html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]
  [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"]) > .my-document-shell {
  height: auto !important;
  min-height: 0 !important;
  max-height: none;
  overflow: visible;
}

html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]
  [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])
  :is(#tabContent, [data-erp-tab-exclusive], #divOpr, [data-erp-explicit-tab-pane], .sales-invoice-editor-surface,
    .my-document-main, #divOprInnerTabsContent, #divOprSalesTabPane, [data-document-pane="items"],
    [data-document-pane="accounts"], [data-document-pane="raw-materials"]) {
  flex: 0 0 auto;
  height: auto !important;
  min-height: 0 !important;
  max-height: none;
  overflow: visible;
}

html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]
  [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])
  .sales-invoice-editor-surface:is(.is-totals-bottom, .is-totals-side) {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
}

html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]
  [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])
  .sales-invoice-editor-surface :is([data-document-pane="items"], [data-document-pane="accounts"], [data-document-pane="raw-materials"])
  > :is(.erp-invoice-detail-table-scroll-x, .entag11-table-frame) {
  flex: 0 0 auto;
  height: auto !important;
  min-height: 120px !important;
  max-height: none !important;
}

/* The absolute empty state cannot size its frame; reserve its message, hint and add action. */
html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]
  [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])
  .sales-invoice-editor-surface :is([data-document-pane="items"], [data-document-pane="accounts"]) > .invoice-lines-table.invoice-lines-is-empty {
  min-height: 168px !important;
}

html[data-mobile-document-device="true"] body [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])
  .invoice-lines-table .my-document-empty-lines:not([hidden]) {
  inset: 50px 8px 6px !important;
  gap: 6px !important;
  padding: 4px !important;
}

html[data-mobile-document-device="true"] body [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])
  .invoice-lines-table .my-document-empty-lines .invoice-empty-icon {
  display: none !important;
}

html[data-mobile-document-device="true"] body [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])
  .invoice-lines-table .my-document-empty-lines small {
  display: block !important;
}

html[data-mobile-document-device="true"] body .my-slider-shell[data-document-viewport="true"]
  [data-document-root].erp-opr-invoice-shell:not(.pos2-restaurant-document):not([data-kt-document-kind="tailoring-invoice"])
  :is(.my-document-totals-host, .my-document-totals) {
  height: auto !important;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document) {
  container: document-touch / inline-size;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-layout, .my-document-layout.is-totals-side, .my-document-main) {
  grid-template-columns: minmax(0, 1fr) !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-shell, .my-document-panel, .my-document-workspace-tools,
    .my-document-identity-grid, .my-document-item-search-card, #tabContent,
    #divOpr, #divOprInnerTabsContent, #divOprSalesTabPane, #divOprTotalsHost,
    .my-document-totals, .invoice-totals-card) {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .sales-invoice-editor-surface.is-totals-side {
  height: auto !important;
  grid-template-rows: auto !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .sales-invoice-editor-surface.is-totals-side :is(.my-document-main, #divOprInnerTabsContent, .my-document-totals-host) {
  grid-column: 1 !important;
  grid-row: auto !important;
  height: auto !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .sales-invoice-editor-surface.is-totals-side > .my-document-main {
  display: grid !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .sales-invoice-editor-surface.is-totals-side .my-document-totals {
  height: auto !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .invoice-head-panel .my-document-identity-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)) !important;
  gap: 8px !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-field-grid, .my-document-field-grid.is-compact, .my-document-payment-grid) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-field, .my-document-inline-control, .invoice-party-field-shell,
    .my-document-workspace-tabs, .my-document-payment-methods) {
  min-width: 0 !important;
  max-width: 100%;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-field > span:first-child, .invoice-data-field > span:first-child) {
  white-space: normal;
  line-height: 1.4 !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([readonly]):not([disabled]),
    select:not([disabled]), textarea:not([readonly]):not([disabled])) {
  font-size: 16px !important;
  line-height: 1.35 !important;
  min-height: 44px !important;
  box-sizing: border-box;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-button, .my-document-icon-button, .my-document-workspace-tabs > button,
    .my-document-payment-methods > button, .opr-detail-quantity-step,
    .my-document-context-menu > button, .erp-search-action-menu > button, [data-delete-button]) {
  min-height: 44px !important;
  height: auto !important;
  line-height: 1.35;
  touch-action: manipulation;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-icon-button, .erp-document-search-button, .opr-detail-quantity-step, [data-delete-button]) {
  min-width: 44px !important;
  width: 44px !important;
  flex-shrink: 0;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .my-document-line-table td:has(> [data-delete-button]) {
  min-width: 52px !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-context-menu, .erp-search-action-menu) > button {
  font-size: 14px !important;
  white-space: normal;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-command-strip, .my-document-command-actions, .invoice-totals-actions-host) {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 6px;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .my-document-command-actions > .my-document-button {
  max-width: 100%;
  white-space: normal;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-inline-control:has(> #Ser), .voucher-identity-field .erp-document-number-shell,
    .invoice-head-panel .my-document-inline-control:has(> [data-erp-document-search])) {
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px !important;
  grid-template-rows: 44px !important;
  height: auto !important;
  min-height: 52px !important;
}

/* The saved-document report menu is the fifth control of every document number. */
html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-inline-control:has(> #Ser), .erp-document-number-shell):has(> .af-document-report-slot) {
  grid-template-columns: 44px 44px minmax(0, 1fr) 44px 44px !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .invoice-head-panel .invoice-party-field-shell {
  grid-template-columns: 44px 44px minmax(0, 1fr) 44px !important;
  grid-template-rows: 44px !important;
  height: auto !important;
  min-height: 52px !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-date-shell, .af-date-field-shell) {
  grid-template-columns: minmax(0, 1fr) 44px !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .my-document-item-search-card .my-document-search-input-shell {
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  grid-template-rows: 44px !important;
  min-height: 52px !important;
  height: auto !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .my-document-item-search-card .my-document-search-input-shell.barcode-camera-input-shell {
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(.my-document-table-wrap, .erp-invoice-detail-table-scroll-x) {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: auto;
  touch-action: pan-x pan-y;
  overscroll-behavior-inline: contain;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  :is(#divOprInnerTabsContent, #divOprSalesTabPane:not([hidden]):not(.d-none).active) {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  #tblOprDetail .opr-detail-quantity-control {
  grid-template-columns: 44px minmax(76px, 1fr) 44px !important;
  min-width: 176px !important;
  gap: 4px;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  #tblOprDetail .opr-detail-quantity-control[data-quantity-step-editable="false"] {
  grid-template-columns: minmax(76px, 1fr) !important;
  min-width: 76px !important;
}

/* The shared row-number layer owns important sizes and grid order. Override
   its physical and logical tracks in that same layer, on mobile devices only. */
@layer alfares-row-number-more {
  html[data-mobile-document-device="true"] body [data-document-root]
    .my-document-line-table :is(.invoice-line-context-trigger[data-row-more-trigger], .voucher-line-context-button) {
    width: 44px !important;
    inline-size: 44px !important;
    min-width: 44px !important;
    min-inline-size: 44px !important;
    max-width: 44px !important;
    max-inline-size: 44px !important;
    height: 44px !important;
    block-size: 44px !important;
    min-height: 44px !important;
    min-block-size: 44px !important;
    max-height: 44px !important;
    max-block-size: 44px !important;
    flex: 0 0 44px !important;
    padding: 0 !important;
    touch-action: manipulation;
  }

  html[data-mobile-document-device="true"] body [data-document-root]
    .my-document-line-table :is(.erp-invoice-row-number-actions, .voucher-line-row-head):not([hidden]):not(.d-none):not([aria-hidden="true"]) {
    grid-template-columns: minmax(28px, 1fr) 44px !important;
    gap: 4px !important;
    min-width: 76px !important;
    min-inline-size: 76px !important;
    min-height: 44px !important;
    min-block-size: 44px !important;
    height: auto !important;
    block-size: auto !important;
    max-height: none !important;
    max-block-size: none !important;
  }

  html[data-mobile-document-device="true"] body [data-document-root]
    .my-document-line-table :is([data-row-number-more-cell], [data-column-key="idx"], .col-no) {
    min-width: 88px !important;
    min-inline-size: 88px !important;
  }

  /* The heading column-settings menu and row-number sort share the row touch tracks. */
  html[data-mobile-document-device="true"] body [data-document-root]
    .my-document-line-table thead .invoice-column-settings-header-button[data-header-more-trigger] {
    width: 44px !important;
    inline-size: 44px !important;
    min-width: 44px !important;
    min-inline-size: 44px !important;
    max-width: 44px !important;
    max-inline-size: 44px !important;
    height: 40px !important;
    block-size: 40px !important;
    min-height: 40px !important;
    min-block-size: 40px !important;
    flex: 0 0 44px !important;
    touch-action: manipulation;
  }

  html[data-mobile-document-device="true"] body [data-document-root]
    .my-document-line-table thead .alfares-row-number-more {
    grid-template-columns: minmax(28px, 1fr) 44px !important;
    gap: 4px !important;
    min-height: 40px !important;
    min-block-size: 40px !important;
  }

  html[data-mobile-document-device="true"] body [data-document-root]
    .my-document-line-table thead [data-row-number] {
    height: 40px !important;
    block-size: 40px !important;
    min-height: 40px !important;
    line-height: 40px !important;
  }

  html[data-mobile-document-device="true"] body [data-document-root]
    .my-document-line-table thead [data-row-number] > button {
    min-width: 28px !important;
    height: 40px !important;
    min-height: 40px !important;
    line-height: 40px !important;
    touch-action: manipulation;
  }
}

/* Payment completion: the party buttons use the same 44px touch tracks, so the
   label takes its own row instead of floating over them. */
html[data-mobile-document-device="true"] body [data-document-root].erp-opr-invoice-shell[data-invoice-payment-ui="premium"]:not(.pos2-restaurant-document)
  .opr2-payment-dialog .opr2-payment-party-field {
  grid-template-rows: auto auto !important;
  row-gap: 3px !important;
}

html[data-mobile-document-device="true"] body [data-document-root].erp-opr-invoice-shell[data-invoice-payment-ui="premium"]:not(.pos2-restaurant-document)
  .opr2-payment-dialog .opr2-payment-party-field > span:first-child {
  position: static !important;
  padding-inline: 4px;
  font-size: 12px;
  line-height: 1.4;
}

html[data-mobile-document-device="true"] body [data-document-root].erp-opr-invoice-shell[data-invoice-payment-ui="premium"]:not(.pos2-restaurant-document)
  .opr2-payment-dialog .opr2-payment-party-field-shell {
  grid-template-columns: 44px 44px minmax(0, 1fr) 44px !important;
  grid-template-rows: 44px !important;
  padding-top: 3px !important;
}

html[data-mobile-document-device="true"] body [data-document-root]
  :is(.my-document-totals-host, [data-testid="totals-panel"], [data-testid="totals-card"], [data-testid="totals-card-peek"]) {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  z-index: auto !important;
}

html[data-mobile-document-device="true"] body [data-document-root]
  :is([data-opr2-summary-placement], [data-testid="totals-placement-toggle-button"], .invoice-summary-pin-button) {
  display: none !important;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .my-document-totals .invoice-actions-grid:not([hidden]):not(.d-none) {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)) !important;
  gap: 6px;
  width: 100%;
}

html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
  .my-document-totals .invoice-actions-grid > .my-document-button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  height: auto !important;
  padding: 8px !important;
  white-space: normal;
  font-size: 13px;
}

html[data-mobile-document-device="true"] body [data-document-root]
  .my-document-totals .invoice-actions-grid > .my-document-button kbd { display: none; }

/* The same native search input is raised with its results, including wide iPad. */
html[data-mobile-document-device="true"] body :is([data-document-root], [data-report-root]) .is-mobile-lookup-source {
  position: fixed !important;
  inset: auto !important;
  left: var(--lookup-source-left, 10px) !important;
  top: var(--lookup-source-top, 10px) !important;
  width: var(--lookup-source-width, calc(100vw - 20px)) !important;
  inline-size: var(--lookup-source-width, calc(100vw - 20px)) !important;
  min-inline-size: 0 !important;
  max-inline-size: var(--lookup-source-width, calc(100vw - 20px)) !important;
  height: var(--lookup-source-height, 44px) !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  transform: none !important;
  overflow: visible !important;
  z-index: 1300 !important;
  background: var(--my-doc-surface, #fff);
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(20, 45, 80, .1);
}

html[data-mobile-document-device="true"] body :is([data-document-root], [data-report-root]) .is-mobile-lookup-source::backdrop {
  background: transparent !important;
  pointer-events: none !important;
}

html[data-mobile-document-device="true"] body :is([data-document-root], [data-report-root]) .document-lookup-source-slot {
  pointer-events: none;
  visibility: hidden;
}

html[data-mobile-document-device="true"] body [data-voucher-account-search-host].is-mobile-lookup-source {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  padding: 0 !important;
  border: 0 !important;
}

html[data-mobile-document-device="true"] body [data-voucher-account-search-host].is-mobile-lookup-source > .item-search-field {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

html[data-mobile-document-device="true"] body [data-voucher-account-search-host].is-mobile-lookup-source .my-document-search-input-shell {
  width: 100% !important;
  height: 100% !important;
  min-height: 44px !important;
  padding: 3px !important;
  box-sizing: border-box;
  align-items: center;
}

html[data-mobile-document-device="true"] body [data-voucher-account-search-host].is-mobile-lookup-source input[data-voucher-account-search-input] {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  height: 44px !important;
}

/* A filtered ancestor shifts fixed descendants out of the visual viewport. */
html[data-mobile-document-device="true"] body #VoucherAccountSearchModal#VoucherAccountSearchModal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Keep the original raised input; its hidden mirror still drives native queries. */
html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
  #VoucherAccountSearchModal#VoucherAccountSearchModal .voucher-account-menu-search {
  display: none !important;
}

html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
  #VoucherAccountSearchModal#VoucherAccountSearchModal .erp-voucher-account-search-premium-box {
  grid-template-rows: minmax(0, 1fr) !important;
}

html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
  #VoucherAccountSearchModal#VoucherAccountSearchModal .voucher-account-menu-toolbar {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 10px;
  z-index: 6;
  width: 44px;
  height: 44px;
  padding: 0 !important;
}

html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
  #VoucherAccountSearchModal#VoucherAccountSearchModal [data-voucher-account-search-close] {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  touch-action: manipulation;
}

html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
  #VoucherAccountSearchModal#VoucherAccountSearchModal .erp-item-search-toolbar {
  padding-inline-end: 58px !important;
  grid-template-columns: 78px minmax(0, 1fr) 44px 96px !important;
}

html[data-mobile-document-device="true"] body #VoucherAccountSearchModal#VoucherAccountSearchModal
  :is(.erp-item-search-view-button, .erp-item-search-density-toggle) {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
}

html[data-mobile-document-device="true"] body #VoucherAccountSearchModal#VoucherAccountSearchModal .erp-item-search-view-switch {
  width: 96px !important;
  grid-template-columns: repeat(2, 44px) !important;
}

html[data-mobile-document-device="true"] body #VoucherAccountSearchModal#VoucherAccountSearchModal
  .erp-item-search-filter .my-report-select-combobox.my-document-select-combobox > button.my-report-select-button {
  min-height: 44px !important;
  height: 44px !important;
  font-size: 16px !important;
}

html[data-mobile-document-device="true"] body #VoucherAccountSearchModal#VoucherAccountSearchModal
  .erp-item-search-filter .my-report-select-button > .my-report-select-value {
  display: block !important;
}

/* Native keyboard mode hides filters; reserve the close row above the table. */
html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
  #VoucherAccountSearchModal#VoucherAccountSearchModal[data-account-search-keyboard="true"] .erp-voucher-account-search-premium-box {
  grid-template-rows: 52px minmax(0, 1fr) !important;
}

html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
  #VoucherAccountSearchModal#VoucherAccountSearchModal[data-account-search-keyboard="true"] .voucher-account-menu-toolbar {
  position: static;
  inset: auto;
  width: 100%;
  height: 52px;
  padding: 4px 10px !important;
  box-sizing: border-box;
  justify-content: flex-end;
}

html[data-mobile-document-device="true"] body .pos2-restaurant-document
  .restaurant-categories-panel .category-strip button:is(.is-active, .myButton_custom_Cat_clicked) {
  background: var(--my-doc-chip-bg, #e8f1f5) !important;
  background-image: none !important;
  border-color: var(--my-doc-primary, #123f60) !important;
  color: var(--my-doc-primary, #123f60) !important;
}

html[data-mobile-document-device="true"] body .erp-opr-invoice-shell.pos2-restaurant-document .pos2-legacy-stage
  :is(.cart-order-type-strip, .invoice-action-order-types) .workspace-order-type[data-pos2-order-type] {
  background: var(--my-doc-chip-bg, #e8f1f5) !important;
  background-image: none !important;
  border-color: var(--my-doc-primary, #123f60) !important;
  color: var(--my-doc-primary, #123f60) !important;
}

html[data-mobile-document-device="true"] body .erp-opr-invoice-shell.pos2-restaurant-document .pos2-legacy-stage
  :is(.cart-order-type-strip, .invoice-action-order-types) .workspace-order-type[data-pos2-order-type].is-active {
  background: var(--my-doc-primary, #123f60) !important;
  background-image: none !important;
  color: #fff !important;
}

@media (max-width: 620px) {
  html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
    #VoucherAccountSearchModal#VoucherAccountSearchModal .erp-item-search-toolbar {
    padding-inline-end: 7px !important;
    grid-template-columns: minmax(68px, 1fr) 44px 96px !important;
  }

  html[data-mobile-document-device="true"] body:has([data-voucher-account-search-host].is-mobile-lookup-source)
    #VoucherAccountSearchModal#VoucherAccountSearchModal .erp-item-search-filter {
    padding-inline-end: 52px !important;
  }
}

/* Dialogs retain their native visibility and scroll owners while the keyboard opens. */
html[data-mobile-document-device="true"]:has([data-document-root]) [data-alfares-mobile-overlay],
html[data-mobile-document-device="true"] .alfares-quick-entry-frame [data-alfares-mobile-overlay] {
  max-block-size: calc(var(--alfares-visual-viewport-height) - var(--alfares-safe-area-top) - var(--alfares-safe-area-bottom) - 12px);
}

html[data-mobile-document-device="true"]:has([data-document-root]) [data-alfares-mobile-overlay] [data-alfares-overlay-header] {
  position: sticky;
  inset-block-start: 0;
  z-index: 6;
}

html[data-mobile-document-device="true"]:has([data-document-root]) [data-alfares-mobile-overlay] [data-alfares-overlay-footer] {
  position: sticky;
  inset-block-end: 0;
  z-index: 5;
  padding-block-end: max(8px, var(--alfares-safe-area-bottom));
}

html[data-mobile-document-device="true"]:has([data-document-root]) .modal[data-alfares-mobile-overlay] {
  position: fixed;
  top: var(--alfares-visual-viewport-offset-top, 0px);
  right: auto;
  bottom: auto;
  left: var(--alfares-visual-viewport-offset-left, 0px);
  width: var(--alfares-visual-viewport-width, 100vw);
  inline-size: var(--alfares-visual-viewport-width, 100vw);
  block-size: var(--alfares-visual-viewport-height);
  max-inline-size: none;
  max-block-size: none;
  padding-block-start: var(--alfares-safe-area-top);
  padding-block-end: var(--alfares-safe-area-bottom);
}

html[data-mobile-document-device="true"]:has([data-document-root]) .modal[data-alfares-mobile-overlay] .modal-dialog {
  max-block-size: calc(var(--alfares-visual-viewport-height) - var(--alfares-safe-area-top) - var(--alfares-safe-area-bottom) - 16px);
  margin-block: 8px;
}

html[data-mobile-document-device="true"]:has([data-document-root]) .modal[data-alfares-mobile-overlay] .modal-content {
  max-block-size: inherit;
  overflow: hidden;
}

html[data-mobile-document-device="true"] body.alfares-quick-entry-frame
  :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([readonly]):not([disabled]), select:not([disabled]), textarea:not([readonly]):not([disabled])),
html[data-mobile-document-device="true"] body.alfares-quick-entry-frame
  :is(#OprItems_Page, #OprAccounts_Page, #OprUnites_Page, #OprMsader_Page, #OprMrTklfa_Page, #OprBarcode_Page, [data-categories-root], [data-activities-root])
  :is(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([readonly]):not([disabled]), select:not([disabled]), textarea:not([readonly]):not([disabled])) {
  font-size: 16px !important;
  min-height: 44px !important;
}

html[data-mobile-document-device="true"] body.alfares-quick-entry-frame
  :is(#OprItems_Page, #OprAccounts_Page, #OprUnites_Page, #OprMsader_Page, #OprMrTklfa_Page, #OprBarcode_Page, [data-categories-root], [data-activities-root])
  :is(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]) {
  min-width: 44px !important;
  min-height: 44px !important;
  height: auto !important;
  touch-action: manipulation;
}

html[data-mobile-document-device="true"].alfares-keyboard-open:has([data-document-root])
  :is([data-alfares-overlay-scroll], .my-slider-screen, .my-slider-content) {
  scroll-padding-block-start: calc(var(--alfares-safe-area-top) + 12px);
  scroll-padding-block-end: calc(var(--alfares-safe-area-bottom) + 20px);
}

@container document-touch (max-width: 560px) {
  html[data-mobile-document-device="true"] body [data-document-root]:is(#OprDocumentRoot, #SndatDocumentRoot, [data-document-root]):not(.pos2-restaurant-document)
    :is(.invoice-head-panel .my-document-identity-grid, .my-document-workspace-tools) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
}
