/* Small touch workspaces keep the original row controls, drafts and permissions. */
.task-mobile-toggle { display: none; }

@media (max-width: 700px), (max-height: 520px) and (max-width: 960px) {
  .rdx.rdc .desk-process .desk-process-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rdx.rdc .desk-process { height: auto; min-height: 0; gap: 10px; }
  .rdx.rdc .desk-process .desk-process-actions > button { height: auto; min-height: 46px; }
  .rdx.rdc .desk-process .desk-process-actions b { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
  .rdx.rdc :is(.dd-heading,.pg-task-tools,.pd-heading-actions,.ib-heading,.sh-heading,.sh-return-cta) { flex-wrap: wrap; }
  .rdx.rdc :is(.dd-button,.dd-create,.ib-button,.sh-button,.pg-task-tools button,.rdx-filters button,.dd-source-filter button) { min-height: 42px; }
  .design-desk .dd-filters { flex-wrap: wrap; align-items: center; }
  .design-desk .dd-status-filters { flex: 1 0 100%; flex-wrap: wrap; gap: 4px; overflow: visible; }
  .design-desk .dd-status-filters > button { padding: 6px 9px; font-size: 13px; }
  .design-desk :is(.dd-source-filter,.dd-more-filter) select { min-height: 42px; max-width: 100%; font-size: 16px; }
  .rdx.rdc :is(.dd-status-filters,.ib-tabs,.sh-status-tabs) button { min-height: 40px; }
  .rdx.rdc .dd-designs { min-height: 0; height: auto; }
  .rdx.rdc .dd-empty { min-height: 120px; }
  .rdx.rdc .rpf-flow-head { flex-wrap: wrap; height: auto; min-height: 24px; }
  .rdx.rdc .rpf-snake { min-width: 320px; }
  .rdx.rdc .rpf-flow-foot button, .rddl .rddl-point { min-width: 44px; min-height: 44px; }
  .rddl-detail li { grid-template-columns: minmax(0,1fr) auto; overflow-wrap: anywhere; }

  .ec-orders-page .ec-order-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ec-orders-page .ec-order-filters :is(input,select) { min-height: 44px; font-size: 16px; }
  .ec-orders-page .ec-order-filters .ec-order-search { grid-column: 1/-1; }
  .ec-orders-page :is(.ec-order-tabs button,.ec-orders-toolbar .ec-button) { min-height: 42px; }
  .rdx.rdc :is(.ib-task-tools,.ib-stock-tools,.sh-order-tools,.pg-task-tools,.prd-search-tools) :is(input,select) { min-width: 0; max-width: 100%; min-height: 42px; font-size: 16px; }


  /* A warehouse record and its expanded ledger detail scroll with the overview. */
  .wh-page .wh-scroll, .task-dual-view > .table-overflow { width: 100%; min-width: 0; max-height: none; overflow: visible; }
  .wh-page .wh-scroll { flex: none; }
  .wh-page .wh-banner { position: relative; }
  .wh-page .wh-actions .wh-btn, .wh-page .wh-tab, .wh-page .wh-next { min-height: 44px; }
  .wh-page .wh-actions .wh-exit { width: 44px; height: 44px; }
  .wh-page .wh-filters { width: 100%; display: flex; gap: 7px; }
  .wh-page .wh-search { flex: 1 0 100%; height: 44px; }
  .wh-page .wh-search :is(input,button) { min-height: 42px; }
  .wh-page .wh-search button { width: 44px; }
  .wh-page .wh-select { flex: 1 1 105px; min-width: 0; }
  .wh-page .wh-select select { width: 100%; max-width: 100%; min-height: 44px; font-size: 16px; }

  .wh-page .wh-table, .task-dual-view .table-overflow > .task-workspace-table {
    display: block; width: 100%; min-width: 0; background: transparent;
  }
  .wh-table > thead, .task-workspace-table > thead {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .wh-table > tbody, .task-workspace-table > tbody { display: block; width: 100%; }
  .wh-page .wh-table tbody > tr:not(.wh-detail-row),
  .task-dual-view .task-workspace-table [data-task-inline] {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start;
    gap: 9px 13px; padding: 13px; margin-block: 10px 0; background: #fff;
    border: 1px solid #dae3f4; border-radius: 8px;
  }
  .wh-page .wh-table tbody tr > :is(th,td),
  .task-dual-view .task-workspace-table tbody tr > td {
    position: static; display: block; min-width: 0; width: auto; height: auto;
    padding: 0 !important; border: 0; text-align: start; white-space: normal; overflow-wrap: anywhere;
    background: transparent; line-height: 1.4;
  }
  .wh-table [data-cell-label]::before, .task-workspace-table [data-cell-label]::before {
    display: block; content: attr(data-cell-label); content: attr(data-cell-label) / "";
    font: 500 12px/1.45 var(--font-ui,system-ui); color: #556783; margin-bottom: 3px;
  }
  .wh-page .wh-table tbody th[scope=row], .wh-page .wh-table .wh-time,
  .wh-page .wh-table tbody tr > td:last-child { grid-column: 1/-1; }
  .wh-page .wh-table tbody th[scope=row] { position: static; width: auto; }
  .wh-page .wh-product { width: 100%; min-height: 42px; justify-content: center; }
  .wh-page .wh-product strong { font-size: 16px; }
  .wh-page .wh-table tbody tr > td:last-child { display: flex; justify-content: flex-end; }
  .wh-page .wh-table .wh-text { min-height: 42px; padding-inline: 7px; white-space: normal; }
  .wh-page .wh-table .wh-detail-row:not([hidden]) { display: block; }
  .wh-page .wh-table .wh-detail-row > td { display: block; margin-top: 3px; background: #f2f5fb; border-radius: 6px; padding: 10px 12px !important; }
  .wh-page .wh-detail-row dl { grid-template-columns: 1fr; }
  .wh-page .wh-detail-row dd { overflow-wrap: anywhere; }

  /* The catalogue's existing edit mode exposes every master-data field.
     Summary cards retain the original permission-aware edit, copy and detail actions. */
  .whf-catalog-body .whf-table-wrap { overflow: visible; }
  .whf-page .whf-catalog-table, .whf-catalog-table > tbody {
    display: block; min-width: 0; width: 100%; background: transparent;
  }
  .whf-catalog-table > colgroup { display: none; }
  .whf-catalog-table > thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .whf-catalog-table [data-goods-inline-row] {
    display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
    align-items: start; gap: 8px 12px; margin-block: 9px 0; padding: 12px;
    border: 1px solid #dae3f4; border-radius: 8px; background: #fff;
  }
  .whf-page .whf-catalog-table [data-goods-inline-row] > :is(th,td) {
    display: block; min-width: 0; padding: 0; height: auto; text-align: start;
    border: 0; background: transparent; white-space: normal;
  }
  .whf-page .whf-catalog-table [data-goods-inline-row]:not(.is-editing) > [data-mobile-edit-only] { display: none; }
  .whf-page .whf-catalog-table .whf-product-name { grid-column: 1/-1; grid-row: 1; font-size: 16px; font-weight: 650; }
  .whf-catalog-table .whf-inline-actions { grid-column: 1/-1; }
  .whf-page .whf-catalog-table [data-goods-inline-row] > .whf-inline-actions {
    position: static; box-shadow: none; border-top: 1px solid #e1e8f5; padding-top: 8px;
  }
  .whf-catalog-table [data-cell-label]::before {
    display: block; content: attr(data-cell-label); content: attr(data-cell-label) / "";
    font: 500 12px/1.45 var(--font-ui,system-ui); color: #556783; margin-bottom: 2px;
  }
  .whf-page .whf-catalog-table .gii-cell-button { min-height: 40px; text-align: start; margin: 0; padding: 2px 0; }
  .whf-page .whf-catalog-table .gii-control { min-height: 44px; font-size: 16px; text-align: start; }
  .whf-page .whf-catalog-table .gii-actions { flex-wrap: wrap; gap: 6px; }
  .whf-page .whf-catalog-table .gii-actions .gii-icon {
    display: inline-flex; width: auto; min-width: 44px; min-height: 44px;
    padding: 0 8px; gap: 5px; font-size: 13px;
  }
  .whf-catalog-table .gii-actions .gii-icon::after {
    content: attr(aria-label); content: attr(aria-label) / "";
  }
  .whf-page .whf-catalog-table .is-editing { background: #f5f8ff; border-color: #8da8e3; }
  .whf-page .whf-catalog-table .gii-row-message:not([hidden]),
  .whf-page .whf-catalog-table .gii-row-message > td { display: block; height: auto; width: 100%; }
  .whf-page .whf-catalog-table .gii-status { overflow-wrap: anywhere; }

  .task-dual-view .task-workspace-table [data-task-inline].is-dirty { background: #f4f7ff; border-color: #8da8e3; }
  .task-dual-view .task-workspace-table [data-task-inline].has-error { border-color: #c57e76; }
  .task-workspace-table tbody td:first-child, .task-workspace-table [data-mobile-task-field] { grid-column: 1/-1; }
  .task-dual-view .task-workspace-table [data-task-inline]:not(.mobile-fields-open) > [data-mobile-task-field] { display: none; }
  .task-dual-view .task-inline-name:has(.task-origin-chip) {
    display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 2px 8px;
  }
  .task-dual-view .task-inline-name .rd-row-number { display: none; }
  .task-dual-view .task-inline-name :is(.task-title-link,input) { font-weight: 650; text-align: start; }
  .task-dual-view .task-title-link { white-space: normal; min-height: 44px; }
  .task-dual-view .task-detail-link { width: 44px; height: 44px; }
  .task-dual-view .task-mobile-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 42px;
    padding: 0 3px; font: 550 13px/1.4 var(--font-ui,system-ui); color: var(--blue);
    cursor: pointer; background: transparent; border: 0;
  }
  .task-mobile-toggle[aria-expanded=true] > span { transform: rotate(180deg); }
  .task-dual-view .task-workspace-table [data-task-inline-field],
  .task-dual-view .task-workspace-table input[data-task-inline-field][type=datetime-local] {
    width: 100%; min-width: 0; min-height: 44px; font-size: 16px;
    border-color: #ced9ed; background-color: white; padding: 7px 8px;
  }
  .task-dual-view .task-inline-status { align-items: center; }
  .task-dual-view .task-planning-cell { padding: 0; }
  .task-dual-view .task-planning-cell.is-missing { padding: 2px; }
  .task-dual-view .task-inline-project select { width: 0; }
  .task-dual-view .task-inline-files :is(.task-file-upload,summary),
  .task-dual-view .task-comment-count, .task-dual-view .task-inline-actions button { min-height: 44px; }
  .task-dual-view .task-inline-actions { justify-content: flex-end; }
  .task-dual-view .task-inline-actions button { min-width: 42px; padding-inline: 7px; }
  .task-dual-view .task-workspace-table tr.task-inline-extra:not([hidden]) { display: block; }
  .task-dual-view .task-workspace-table .task-inline-extra > td {
    width: 100% !important; padding: 10px 13px !important; border: 1px solid #dae3f4; border-radius: 6px;
  }
  .task-dual-view .task-inline-note { flex-direction: column; gap: 5px; min-width: 0; }
  .task-dual-view .task-inline-extra textarea { width: 100%; min-height: 78px; }
}
