/* Selan v53 - final phone card spacing and package-photo containment. */
@media (max-width: 767px) {
  /* This is the only summary label long enough to collide with its value. */
  .staff-declarations-view .declaration-summary-row > td[data-label="Declaration / HBL"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  .staff-declarations-view .declaration-summary-row > td[data-label="Declaration / HBL"]::before {
    display: block !important;
    width: 100% !important;
  }

  /* A portrait upload must remain inside the Photo row, never cover Contents. */
  .staff-declarations-view .packing-review-table td[data-label="Photo"] {
    align-items: start !important;
  }

  .staff-declarations-view .packing-review-table td[data-label="Photo"] > button {
    display: block !important;
    width: min(100%, 180px) !important;
    height: 132px !important;
    min-height: 132px !important;
    max-height: 132px !important;
    margin: 0 !important;
    padding: 4px !important;
    overflow: hidden !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
  }

  .staff-declarations-view .packing-review-table td[data-label="Photo"] > button > img {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 7px !important;
    background: #f8fafc !important;
  }

  .staff-declarations-view .packing-review-table td[data-label="Contents"] {
    position: relative !important;
    z-index: 1 !important;
    background: #fff !important;
  }
}

@media (max-width: 359px) {
  .staff-declarations-view .packing-review-table td[data-label="Photo"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
