/* Keep dense workspace data legible on phones and let mobile dialogs use the full screen. */
@media (max-width: 700px) {
  .modal-backdrop {
    z-index: 700;
  }

  .modal-backdrop:has(#payment-entry-form) {
    justify-content: center;
  }

  #payment-entry-form .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #payment-entry-form .form-grid > * {
    min-width: 0;
  }

  .pullout-summary + .client-record-table-wrap {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
  }

  .pullout-summary + .client-record-table-wrap::-webkit-scrollbar {
    height: 8px;
  }

  .pullout-summary + .client-record-table-wrap::-webkit-scrollbar-thumb {
    background: #9aa0a6;
    border-radius: 8px;
  }

  .pullout-summary + .client-record-table-wrap .client-record-table {
    width: max-content;
    min-width: 1050px;
    table-layout: auto;
    font-size: 14px;
  }

  .pullout-summary + .client-record-table-wrap .client-record-table th,
  .pullout-summary + .client-record-table-wrap .client-record-table td {
    width: auto;
    min-width: 76px;
    padding: 12px 10px;
    white-space: nowrap;
    overflow-wrap: normal;
    line-height: 1.45;
  }

  .pullout-summary + .client-record-table-wrap .client-record-table th {
    font-size: 13px;
  }

  .pullout-summary + .client-record-table-wrap .client-record-table th:nth-child(1),
  .pullout-summary + .client-record-table-wrap .client-record-table td:nth-child(1) {
    min-width: 86px;
  }

  .pullout-summary + .client-record-table-wrap .client-record-table th:nth-child(2),
  .pullout-summary + .client-record-table-wrap .client-record-table td:nth-child(2) {
    min-width: 115px;
  }

  .pullout-summary + .client-record-table-wrap .client-record-table th:nth-child(6),
  .pullout-summary + .client-record-table-wrap .client-record-table td:nth-child(6) {
    min-width: 190px;
    max-width: 260px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .pullout-summary + .client-record-table-wrap .client-record-table th:nth-child(9),
  .pullout-summary + .client-record-table-wrap .client-record-table td:nth-child(9) {
    min-width: 120px;
  }
}

@media (max-width: 700px) {
  .odf-records {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .odf-records .odf-record-card {
    width: 100%;
    min-width: 0;
    min-height: 76px;
    padding: 10px;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: start;
    gap: 5px;
  }

  .odf-record-card strong,
  .odf-record-card span {
    min-width: 0;
    max-width: 100%;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .odf-meta,
  .odf-meta strong,
  .odf-meta span,
  .odf-result > strong,
  .odf-result > span:not(.odf-result-swatch) {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.4;
  }
}

/* Give the workspace title and account actions their own space on phones. */
@media (max-width: 700px) {
  .page > header.topbar {
    height: auto;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 10px 14px;
  }
  .page > .topbar .breadcrumbs {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    line-height: 1.4;
  }
  .page > .topbar .breadcrumbs strong {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .page > .topbar .topbar-right {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px 8px;
  }
  .page > .topbar .topbar-right > .btn,
  .page > .topbar .topbar-right > .back-landing {
    flex: 0 0 auto;
    min-height: 36px;
    max-width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
  }
  .page > .topbar .topbar-right > .avatar { flex-shrink: 0; }
  .page > .topbar .client-location-picker { max-width: 100%; }
}
