/* TradeFlow v7.14.19 R19 — live iPhone Xero-preview compatibility repair. */

@media (max-width: 640px), (max-height: 500px) and (max-width: 950px) {
  /*
   * Preserve the compact invoice as a real table. The marker prevents the
   * generic mobile enhancer from converting it to cards; these explicit
   * display resets also recover safely if an older cached enhancer already
   * attached its card classes.
   */
  #tf714-preview table.tf718-mobile-table,
  #tf714-preview table.tf718-mobile-table.tfm-card-table {
    display: table !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  #tf714-preview table.tf718-mobile-table > colgroup {
    display: table-column-group !important;
  }

  #tf714-preview table.tf718-mobile-table > colgroup > col {
    display: table-column !important;
  }

  #tf714-preview table.tf718-mobile-table > thead {
    display: table-header-group !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    white-space: normal !important;
  }

  #tf714-preview table.tf718-mobile-table > tbody {
    display: table-row-group !important;
  }

  #tf714-preview table.tf718-mobile-table > tfoot {
    display: table-footer-group !important;
  }

  #tf714-preview table.tf718-mobile-table > thead > tr,
  #tf714-preview table.tf718-mobile-table > tbody > tr,
  #tf714-preview table.tf718-mobile-table > tfoot > tr {
    display: table-row !important;
    grid-template-columns: none !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  #tf714-preview table.tf718-mobile-table th,
  #tf714-preview table.tf718-mobile-table td {
    display: table-cell !important;
    grid-template-columns: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    position: static !important;
  }

  #tf714-preview table.tf718-mobile-table th::before,
  #tf714-preview table.tf718-mobile-table td::before {
    content: none !important;
    display: none !important;
  }

  #tf714-preview .tf718-col-row {
    width: 6% !important;
  }

  #tf714-preview .tf718-col-description {
    width: 37% !important;
  }

  #tf714-preview .tf718-col-quantity {
    width: 8% !important;
  }

  #tf714-preview .tf718-col-unit {
    width: 14% !important;
  }

  #tf714-preview .tf718-col-account {
    width: 10% !important;
  }

  #tf714-preview .tf718-col-total {
    width: 25% !important;
  }

  #tf714-preview table.tf718-mobile-table .tf718-number,
  #tf714-preview table.tf718-mobile-table tbody > .tf718-line > td:nth-child(n + 3) {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: clamp(8px, 2.35vw, 11px) !important;
  }

  #tf714-preview table.tf718-mobile-table .tf718-source-row > td {
    width: auto !important;
  }
}
